Queries the attribute information of a mobile phone number. This includes the province, city, basic carrier (China Mobile, China Unicom, China Telecom, or China Broadnet), mobile virtual network operator (MVNO) such as Alibaba Communications, mobile number portability (MNP) status, and number segment.
Operation description
-
Before you call this API, make sure that you understand the billing of Cell Phone Number Service.
-
By default, only Alibaba Cloud accounts can call this API. Resource Access Management (RAM) users can call this API only after they are granted the required permissions. For more information, see Grant permissions to RAM users.
-
This API is used to obtain the current service carrier, location, and mobile number portability information of a phone number. It supports queries for phone numbers in plaintext or encrypted with MD5 or SHA256.
-
Before you use this API, log on to the Cell Phone Number Service console. On the Tag Square page, find the required tag, click Request Access, and then fill in the application form. You can use the service after your application is approved.
QPS limits
The queries per second (QPS) limit for a single user is 2,000 calls/second. If you exceed this limit, API calls are throttled, which may affect your services. To avoid service interruptions, call this API at a reasonable rate.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dytns:DescribePhoneNumberOperatorAttribute |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InputNumber |
string |
Yes |
The phone number to query.
Important The letters in the encrypted string are not case-sensitive. |
139****1234 |
| AuthCode |
string |
Yes |
The authorization code. Note
On the My Applications page in the Cell Phone Number Service console, obtain the authorization ID. The authorization ID is the authorization code. |
Dd1r***4id |
| Mask |
string |
Yes |
The encryption method of the phone number. Valid values:
Important All letters in the string must be in uppercase. |
MD5 |
| FlowName |
string |
No |
A system parameter. You do not need to specify this parameter. |
- |
| ResultCount |
string |
No |
A system parameter. You do not need to specify this parameter. |
- |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The data returned. |
||
| AccessDeniedDetail |
string |
The details of the access denial. This parameter is returned only when RAM authentication fails. |
- |
| Message |
string |
The description of the status code. |
OK |
| RequestId |
string |
The request ID. |
68A40250-50CD-034C-B728-0BD135850177 |
| Data |
object |
The struct. |
|
| BasicCarrier |
string |
The basic carrier. Valid values:
|
中国移动 |
| NumberSegment |
integer |
The number segment. |
139 |
| IsNumberPortability |
boolean |
Indicates whether the number has been ported. Valid values:
|
false |
| Carrier |
string |
The actual carrier, including virtual carriers. If the number has been ported, this is the carrier after porting. |
中国移动 |
| City |
string |
The city where the number is registered. |
杭州 |
| Province |
string |
The province where the number is registered. |
浙江 |
| Code |
string |
The status code of the request. Valid values:
|
OK |
Causes and solutions for status codes
| Status code | Cause | Solution |
| OK: The request was successful. | The request parameters meet the requirements. | The API call was successful. |
| InvalidParameter: The specified phone number is invalid or the parameter format is incorrect. | The format of the phone number in the request is incorrect, or the request parameters do not meet the API requirements. | Enter a valid phone number or adjust the format of the request parameters, and then resubmit the request. For example, remove invisible characters or spaces from the phone number, or use half-width characters. |
| PhoneNumberNotfound: The attribute information for the specified phone number cannot be found. | The attribute information for the specified phone number cannot be found. | Query a different phone number. |
| isp.UNKNOWN: An unknown error occurred. | The system returned an unknown error. | Retry the API call. Do not retry more than three times. |
Meanings of the BasicCarrier and Carrier fields
| Number segment attribution | Mobile number portability status | Value of the BasicCarrier field | Value of the Carrier field |
| Basic carrier number segment | Yes | The basic carrier after porting (China Mobile, China Unicom, China Telecom, or China Broadnet) | The basic carrier after porting (China Mobile, China Unicom, China Telecom, or China Broadnet) |
| Basic carrier number segment | No | The basic carrier (China Mobile, China Unicom, China Telecom, or China Broadnet) | The basic carrier (China Mobile, China Unicom, China Telecom, or China Broadnet) |
| Virtual carrier number segment | Not supported | The basic carrier (China Mobile, China Unicom, China Telecom, or China Broadnet) | The virtual carrier (for example, Alibaba Communications) |
Examples
Success response
JSON format
{
"AccessDeniedDetail": "-",
"Message": "OK",
"RequestId": "68A40250-50CD-034C-B728-0BD135850177",
"Data": {
"BasicCarrier": "中国移动",
"NumberSegment": 139,
"IsNumberPortability": false,
"Carrier": "中国移动",
"City": "杭州",
"Province": "浙江"
},
"Code": "OK"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | EncyrptTypeIllegal | The encryption type of the mobile phone number is illegal | |
| 400 | InvalidParameter | The specified mobile phone number is invalid. | Invalid Phone Number |
| 400 | PhoneNumberNotfound | The queried number is not found. | |
| 400 | MobileNumberTypeNotMatch | The number and number type do not match. | |
| 400 | AuthCodeNotExist | The authorization code application failed and cannot be used. | Failed to apply for an authorization code. |
| 400 | MobileNumberIllegal | Wrong format of phone number | |
| 400 | AuthCodeIllegal | Illegal authCode. | |
| 500 | InternalError | A system error occurred. | |
| 500 | RequestTimeout | Request supplier timed out. | Request supplier timeout |
| 500 | RequestSupplierError | Request supplier error. | Request supplier error. |
See for a complete list.
Release notes
See Release Notes for a complete list.