PHP access to mobile phone number attribution by API

Source: Internet
Author: User
Tags json

This API support 1, can enter 11-digit mobile phone number of the location of the attribution, such as: 13858861234, 2, can be entered into the 7-bit paragraph query attribution such as: 1335586, 3, support number 13, 14, 15, 17, 18, the need for small partners can refer to.

The API interface since the 2011 SAE platform stable operation so far, increased the support of section 17th, welcomed the various collection of Notes limit concurrent 10

Detailed use instructions

Interface Address: Http://appyun.sinaapp.com/index.php?app=mobile&controller=index&action=api

Request method: Get

Request Parameters:

Parameter name type Required parameters Position description default value

App string is Urlparam module name (invariant) mobile

Controller string is Urlparam Controller name index

Action string is the Urlparam action name API

Mobile string is Urlparam cell phone number or number 13800138000

OUTFMT string is the desired result type JSON for Urlparam

Request Sample:

http://appyun.sinaapp.com/index.php?app=mobile&controller=index&action=api&outfmt=json&mobile= 13800138000

JSON return Example:

?

1 2 3 4 5 6 7 8 9 10 {"id": "80012", "Mobile": "13800138000", "Province": "U5317u4eac", "City": "U5317u4eac", "AreaCode": "010", "Postcode": " 100000 "," Operators ":" U4e2du56fdu79fbu52a8 "," card ":" GSM "}

XML Return Example:

?

1 2 3 4 5 6 7 8 9 10 11 <?xml version= "1.0" encoding= "Utf-8"?> <queryresponse xmlns= "http://appyun.sinaapp.com/" > <mobile >13800138000</Mobile> <QueryResult>True</QueryResult> <Province> Beijing </Province> <City> Beijing </City> <AreaCode>010</AreaCode> <PostCode>100000</PostCode> < operators> China Mobile </Operators> <Card>GSM</Card> </QueryResponse>

How to use

?

1 2 3 4 5 6 function Getmobileinfo ($mobile) {$response = file_get_contents (' Http://appyun.sinaapp.com/index.php?app=mobile &controller=index&action=api&outfmt=json&mobile= '. $mobile) $result = Json_decode ($response, true); return $result; }

The above mentioned is the entire content of this article, I hope you can enjoy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.