Quickly verify in a single request if a mobile phone number is a carrier's secondary number assignment.
Operation description
Before you use this API, make sure you understand the pricing for Phone Number Verification Service.
You are charged only when the API response returns
Code="OK"andVerifyResultis not0. No charge is incurred in any other case.Before you use this API, log in to the Phone Number Verification Service console. On the Tag Square page, find the tag you need, click Request Activation, and complete the application form. You can use the API once your application is approved.
QPS limits
The QPS limit is 100 per user. If you exceed this limit, the system throttles your API calls, which may affect your business. Plan your API calls accordingly.
Authorization
By default, only an Alibaba Cloud account can call this API. A RAM user must be granted the required permissions to call the API. For more information, see Grant permissions to a RAM user.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dytns:DescribePhoneTwiceTelVerify |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| AuthCode |
string |
Yes |
The authorization code. Note
On the My Applications page in the Phone Number Verification Service console, get the Authorization ID. This ID is your authorization code. |
Dd1r***4id |
| InputNumber |
string |
Yes |
The phone number to be queried. The number can be a mobile phone number or an encrypted string.
Important The encrypted string is not case-sensitive. |
139******* |
| Mask |
string |
Yes |
The encryption method of the phone number. Valid values:
|
NORMAL |
| StartTime |
string |
Yes |
The registration time of a phone number. The time must be in the Note
|
2018-01-01 00:00:00 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
A data structure. |
||
| RequestId |
string |
The unique ID of the request. This common parameter is returned with each request. Use this ID to troubleshoot issues. |
68A40250-50CD-034C-B728-0BD135850177 |
| Code |
string |
The request status code. Valid values:
Note
A charge applies when the value of |
OK |
| Message |
string |
A description of the returned status code. |
OK |
| Data |
object |
A data structure that contains the verification results. |
|
| VerifyResult |
string |
The verification result. Valid values:
|
1 |
| Carrier |
string |
The carrier that provides service for the number. Valid values:
Note
The carrier that currently provides service for the number. For a ported number, this is the destination carrier. |
CMCC |
Status codes
| Http code | Status code | Reason | Solution |
| 200 | OK: The request was successful. | The request parameters are valid. | Indicates a successful API call. |
| 200 | PortabilityNumberNotSupported: The specified number has been ported and is not supported. | This error code is returned for some ported numbers. | Try querying a different number. For a ported number, the original carrier has deactivated the account, and the new carrier treats the port-in date as the account opening date. This makes it impossible to accurately determine the number's true status. |
| 200 | RequestNumberNotSupported: Queries for the specified number are not supported. | The service does not support queries for numbers from China Broadcasting Network (starting with 192), virtual operators, or other unsupported carriers. | Try again with a number from a supported carrier. |
Exceptions
| Http code | Status code | Reason | Solution |
| 400 | AuthCodeNotExist: The authorization code does not exist. | The specified authorization code does not exist. | Apply for the required tag in the Phone Number Verification Service console. After your application is approved, use the received authorization code to retry the API call. |
| 400 | MobileNumberIllegal: The mobile number has an invalid format. | The mobile number is in an invalid format. | If the number is not encrypted, provide a valid 11-digit number. If the number is MD5-encrypted, provide a 32-character string. If the number is SHA256-encrypted, provide a 64-character string. |
| 400 | MobileNumberTypeIllegal: The encryption method is invalid. | The specified encryption method is unsupported or incorrectly formatted. | Use one of the following uppercase values for the encryption method: NORMAL, MD5, or SHA256. |
| 500 | Unknown: An unknown exception occurred. | The system returned an unknown exception. | Retry the API call up to three times. |
| 500 | SystemError: A network element system exception occurred. | A system error occurred. | Retry the API call up to three times. |
Examples
Success response
JSON format
{
"RequestId": "68A40250-50CD-034C-B728-0BD135850177",
"Code": "OK",
"Message": "OK",
"Data": {
"VerifyResult": "1",
"Carrier": "CMCC"
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 200 | PortabilityNumberNotSupported | 不支持2021年6月前携号转网的号码查询 | |
| 200 | RequestNumberNotSupported | 不支持中国广电号码(192开头)和虚拟运营商号码的查询 | |
| 200 | RequestFrequencyLimit | 因运营商限制,禁止在短时间内高频对同一个号码进行反复查询 | |
| 400 | Product.Unsubscript | You have not subscribed to the specified product. | |
| 400 | Ram.PermissionDeny | You are not authorized to perform the operation. | |
| 400 | System.LimitControl | The system is under flow control. | |
| 400 | Unknown.ResourceOwnerId | The resource does not belong to the current user. | |
| 400 | MobileNumberIllegal | Wrong format of phone number | |
| 400 | MobileNumberTypeNotMatch | Phone number and encryption type do not match | |
| 400 | InputParamIllegal | Wrong format of input parameter | |
| 400 | AuthCodeIllegal | Illegal authCode. | |
| 400 | ThresholdIllegal | Please fill in the threshold range from 0 to 100 correctly. | |
| 400 | AuthCodeNotExist | The label application form does not exist, please replace the authorization code. | |
| 400 | MobileNumberTypeIllegal | Invalid number type. | |
| 400 | TagNotExist | The label does not exist. | |
| 400 | InvalidParameter | Invalid parameter. | |
| 500 | Unknown | Unknown error | |
| 500 | SystemError | System error | |
| 500 | RequestSupplierError | Request supplier error. | Request supplier error. |
| 500 | RequestTimeout | Request supplier timed out. | Request supplier timeout |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.