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
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: Use1.0.timestamp: The request timestamp, with millisecond precision. This value and its format must match theTimeinput parameter for this API.appId: Use300011580392.businessType: Use3.traceId: The trace ID. This value must match this API'sOutIdinput 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¶mKey=1D7C25EB8B0B8B4CB3CF8DC60628F6549********786B0AF1FEF93FA1335057A35BF5F0B39A3867EAA9BE14B3898********8B01DE34965060445B6E1F66401D714650E4AB161CD6DCF4A72********3B856F22A192B8B0C39D7A55B961062E68C89C928894F119B25********7C548355FE9DB82852EB93C939F2200B48CD17¶mStr=140********95AF8E138B94754CB4CF83BA6FB********52B258BFDFD38BF233&version=1.1
Parameter description:
appId: Use9390188202.clientType: The client type. This value must match theClientTypeinput parameter for this API.format: Usejsonorjsonp.version: Use1.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 isRSA/ECB/PKCS1Padding. Download the China Telecom RSA public key.paramStr: The ciphertext of a parameter string. This string containstimeStamp(a Unix timestamp with millisecond precision, for example1697791988302, that corresponds to the value of theTimeparameter of this API) andcallback(the name of the JSONP callback function, required only whenformatis set tojsonp). To generateparamStr, encrypt the string using AES with key A. The padding mode isAES/CBC/PKCS5Padding, and the initialization vector is0000000000000000.
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
Test
RAM authorization
|
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 |
b8b5b3a*******0b9893484fdf412c99 |
| ClientType |
string |
Yes |
The client type. Valid values:
|
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. |
20121227180001165 |
| Carrier |
string |
Yes |
The mobile carrier. Valid values:
|
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 |
| Code |
string |
The response status code. Valid values:
|
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.