GetUAIDApplyTokenSign

更新时间:
复制 MD 格式

This API only provides the signing functionality for acquiring an authorization token during UAID retrieval from the three-network operators.

Operation description

This API provides only the signing function for obtaining an authorization token as part of the UAID retrieval process for China's three major operators.

  • To generate the other parameters required to obtain the authorization token, refer to the respective operator's documentation.

  • To request the authorization token, refer to the respective operator's documentation. Note that the request must be sent from the user's mobile device over a cellular network.

  • After obtaining the authorization token, call the UAIDVerification API to complete the UAID retrieval.

How to request an authorization token

Important When you request an authorization token, the client or H5 page must be connected to a cellular network.

China Mobile (CM)

Protocol: HTTPS + application/json
Method: POST
URL: https://msg.cmpassport.com/h5/getMobile

Request parameters

Request example:

{ "traceId": "mfawsxtcmyplwzpayzzvdvbsowxmkynr", "appId": "300011580392", "sign": "2c61b3c58ffbeed97461e31be4fd931a", "msgId": "redbyxsdetddwaaffajcwwapspykftzx", "expandParams": "", "businessType": "3", "version": "1.0", "timestamp": "20201125101540980" }

Parameter description:

  • version: Use 1.0.

  • timestamp: The request timestamp, with millisecond precision. This value and its format must match the Time input parameter for this API.

  • appId: Use 300011580392.

  • businessType: Use 3.

  • traceId: The trace ID. This value must match this API's OutId input parameter.

  • sign: Obtained by calling this API.

  • msgId: A unique message identifier.

Response parameters

Response example:
{ "header": { "appId": "300011580392", "msgId": "redbyxsdetddwaaffajcwwapspykftzx", "timestamp": "20201125101607932" }, "body": { "resultCode": "103000", "expandParams": "", "resultDesc": "成功", "token": "H5HTTPS4187AE9743AFCB14F8D99B9D65ED9E01" } }

Retrieve the token from the response body.

China Unicom (CU)

Obtain the token in two steps.

Step 1: Obtain the authurl

Send a request to the portal server to get the authentication server address (authurl).

Protocol: HTTPS + application/json
Method: GET
URL: https://nisportal.10010.com:9001/api

Request parameters

Request examples:
JSON request: ?appid=1554778161153
JSONP request: ?appid=1554778161153&callback=callbackFunction

Parameter description:

  • appid: Use 1554778161153.

  • callback: The name of the JSONP callback function. This parameter is required only for JSONP requests.

Response parameters

Response examples:
JSON response: {"authurl": "https://enrichgw.10010.com/d93222629f52ec79"}
JSONP response: callbackFunction({"authurl":"https://enrichgw.10010.com/d93222629f52ec79"})

Retrieve the authurl from the response.

Step 2: Obtain the token

Protocol: HTTPS + application/json
Method: GET
URL: The authurl from Step 1, with /api appended.

Request URL example: https://enrichgw.10010.com/d93222629f52ec79/api

Request parameters

Request examples:
JSON request: ?appid=1554778161153
JSONP request: ?appid=1554778161153&callback=callbackFunction

Parameter description:

  • appid: Use 1554778161153.

  • callback: The name of the JSONP callback function. This parameter is required only for JSONP requests.

Response parameters

Response examples:
JSON response: { "province": "1", "code": "7nHS1nggx2WP613750206700RN6oiRN1" }
JSONP response: callbackFunction({"province":"1","code":"7nHS3Dnkd1BS701851092400RN6oiRN1"})

Retrieve the code from the response.

China Telecom (CT)

Protocol: HTTPS + application/x-www-form-urlencoded;charset=UTF-8
Method: GET
URL: https://id6.me/gw/preuniq.do

Request parameters

Request example:
?clientType=30100&appId=9390188202&format=json&sign=D63C166FA19E1996EF********09C6A5397C10B4&paramKey=1D7C25EB8B0B8B4CB3CF8DC60628F6549********786B0AF1FEF93FA1335057A35BF5F0B39A3867EAA9BE14B3898********8B01DE34965060445B6E1F66401D714650E4AB161CD6DCF4A72********3B856F22A192B8B0C39D7A55B961062E68C89C928894F119B25********7C548355FE9DB82852EB93C939F2200B48CD17&paramStr=140********95AF8E138B94754CB4CF83BA6FB********52B258BFDFD38BF233&version=1.1

Parameter description:

  • appId: Use 9390188202.

  • clientType: The client type. This value must match the ClientType input parameter for this API.

  • format: Use json or jsonp.

  • version: Use 1.1.

  • sign: Obtained by calling this API.

  • paramKey: The ciphertext of key A. Key A is a 16-character random string generated by the client. To generate paramKey, encrypt key A using the RSA algorithm and the China Telecom public key. The padding mode is RSA/ECB/PKCS1Padding. Download the China Telecom RSA public key.

  • paramStr: The ciphertext of a parameter string. This string contains timeStamp (a Unix timestamp with millisecond precision, for example 1697791988302, that corresponds to the value of the Time parameter of this API) and callback (the name of the JSONP callback function, required only when format is set to jsonp). To generate paramStr, encrypt the string using AES with key A. The padding mode is AES/CBC/PKCS5Padding, and the initialization vector is 0000000000000000.

Response parameters

Response example:
callback?result=10000&msg=success&data=a35336711c70456cb883f4f224e9a259

The data parameter contains the ciphertext of the business result. To get the result, decrypt the data value using key A, the AES/CBC/PKCS5Padding mode, and an initialization vector of 0000000000000000.

Decrypted business result example:
{"accessCode": "H5HTTPS4187AE9743AFCB14F8D99B9D65ED9E01"}

Retrieve the accessCode from the decrypted result.

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:GetUAIDApplyTokenSign

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

AuthCode

string

Yes

The authorization code.

Note

To obtain this authorization code, navigate to Tag Plaza in the Phone Number Verification Service console, select a tag, and submit an application. You receive the code after your application is approved.

HwD97InG

OutId

string

Yes

The external ID.

Note

For China Mobile (CM), this parameter corresponds to traceId and msgId. The values of OutId, traceId, and msgId must be the same.

b8b5b3a*******0b9893484fdf412c99

ClientType

string

Yes

The client type. Valid values:

  • 30100: Android

  • 30300: iOS

  • 20200: H5

  • 10010: Web

30300

ParamKey

string

No

This parameter is required if the carrier is China Telecom (CT). For details, see the China Telecom documentation.

955EC1A869852EA8BC66F********D7C6E92017BBD5B001C736EFEAFB775C232

ParamStr

string

No

This parameter is required if the carrier is China Telecom (CT). For details, see the China Telecom documentation.

B2F0D4CD7A216D16CE2AF4BBC********29A454FDDD991F919106C12CB89ABA8

Time

string

Yes

The event timestamp, accurate to the millisecond.
Format: yyyyMMddHHmmssSSS.

20121227180001165

Carrier

string

Yes

The mobile carrier. Valid values:

  • CM: China Mobile

  • CU: China Unicom

  • CT: China Telecom

CM

Response elements

Element

Type

Description

Example

object

The response object.

AccessDeniedDetail

string

Details about the access denial.

-

RequestId

string

The request ID.

68A40250-50CD-034C-B728-0BD******177

Message

string

The response message.

OK

Data

object

The response data.

OutId

string

The external ID.

b8b5b3a*******0b9893484fdf412c99

Sign

string

The signature value.

D2E204D74EEB373E468632********23F592C4C9

Carrier

string

The mobile carrier. Valid values:

  • CM: China Mobile

  • CU: China Unicom

  • CT: China Telecom

CM

Code

string

The response status code. Valid values:

  • OK: The request was successful.

OK

Examples

Success response

JSON format

{
  "AccessDeniedDetail": "-",
  "RequestId": "68A40250-50CD-034C-B728-0BD******177",
  "Message": "OK",
  "Data": {
    "OutId": "b8b5b3a*******0b9893484fdf412c99",
    "Sign": "D2E204D74EEB373E468632********23F592C4C9",
    "Carrier": "CM"
  },
  "Code": "OK"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter Invalid parameter.
400 AuthCodeIllegal Illegal authCode.
500 RequestTimeout Request supplier timed out. Request supplier timeout
500 RequestSupplierError Request supplier error. Request supplier error.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.