DescribePhoneTwiceTelVerify

更新时间:
复制 MD 格式

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" and VerifyResult is not 0. 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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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.

  • If the value of Mask is NORMAL, InputNumber is an 11-digit mobile phone number.

  • If the value of Mask is MD5, InputNumber is a 32-bit encrypted string.

  • If the value of Mask is SHA256, InputNumber is a 64-bit encrypted string.

Important The encrypted string is not case-sensitive.

139*******

Mask

string

Yes

The encryption method of the phone number. Valid values:

  • NORMAL: The phone number is not encrypted.

  • MD5

  • SHA256

NORMAL

StartTime

string

Yes

The registration time of a phone number. The time must be in the yyyy-MM-dd HH:mm:ss format. The value of this parameter is the registration time of a mobile phone user in your business. If the registration time is later than the time when a carrier assigns a number, the number is not a recycled number. Otherwise, the number is a recycled number.

Note
  • If a phone number is assigned for multiple times, the system uses the last assignment time as the criterion.

  • The registration time must be later than 1970-01-01 00:00:00.

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:

  • OK: The request was successful.

  • PortabilityNumberNotSupported: Queries for this ported number are not supported.

  • RequestNumberNotSupported: Queries are not supported for numbers from China Broadnet (starting with 192), mobile virtual network operators, and other unsupported carriers.

  • RequestFrequencyLimit: Carriers limit frequent queries for the same number. If you receive this error code, try again later.

Note

A charge applies when the value of Code is OK and the value of VerifyResult is not 0. For more information, see Phone Number Service pricing.

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:

  • 0: Cannot be determined.

  • 1: The number is a recycled number.

  • 2: The number is not a recycled number.

  • 3: The number has been deactivated.

  • 4: Unknown: The number was transferred to a new owner.

1

Carrier

string

The carrier that provides service for the number. Valid values:

  • CMCC: China Mobile.

  • CUCC: China Unicom.

  • CTCC: China Telecom.

Note

The carrier that currently provides service for the number. For a ported number, this is the destination carrier.

CMCC

Status codes

Http codeStatus codeReasonSolution
200OK: The request was successful.The request parameters are valid.Indicates a successful API call.
200PortabilityNumberNotSupported: 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.
200RequestNumberNotSupported: 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 codeStatus codeReasonSolution
400AuthCodeNotExist: 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.
400MobileNumberIllegal: 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.
400MobileNumberTypeIllegal: 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.
500Unknown: An unknown exception occurred.The system returned an unknown exception.Retry the API call up to three times.
500SystemError: 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 不支持20216月前携号转网的号码查询
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.