Device Finger Print
Integration process:
- Please Click here to get the token authentication
- Please download SDK and integrate into your app
- Please see How To Get The Device Info
Notes:
- ADVANCE service is deployed overseas. If your test/official environment is in countries with restricted internet access, please request the service via VPN to avoid packet loss, service timeout and other problems
Get Device Info
Request Example:
curl -X POST \
-H "X-ACCESS-TOKEN: {Your Access Token}" \
-H "Content-Type: application/json" \
-d "dfpId": "c524306f58fa9ea5" \
"https://sg-api.advance.ai/intl/openapi/face-identity/v1/get-device-info"
Request Url
https://sg-api.advance.ai/intl/openapi/face-identity/v1/get-device-info
POST
(application/json)
Request Header Parameters:
Parameter | Description |
---|---|
X-ACCESS-TOKEN | string Please Click here to get your access token |
Request Parameters:
Parameter | Description |
---|---|
dfpId | string A unique Id returned by SDK |
Example of SUCCESS Response:
{
"code":"SUCCESS",
"message":"OK",
"data":{
"deviceLabel":{
"dvid":"DD_71JnTZteaEXgmy0R-bIz8v0xrtqYXB8uBQdNq-ynzjx",
"imei":"no_permission",
"imsi":"no_permission",
"iccid":"no_permission",
"macDevice":"D4:62:EA:1B:26:5F",
"macBluetooth":"empty",
"androidId":"40cff7e94f023884",
"diskTotalVolume":"115882328064",
"diskRemainingVolume":"101287841792",
"memSize":"5826712",
"idfa":null,
"idfv":null,
"serialNumber":"40cff7e94f023884",
"deviceName":"HWMAR",
"deviceModel":"MAR-LX2",
"operatingSystem":"Android",
"operatingSystemVersion":"10",
"screenWidth":"1080",
"screenHeight":"2312",
"userAgent":"Mozilla/5.0 (Linux; Android 10; MAR-LX2 Build/HUAWEIMAR-L22B; wv) AppleWebKit/537.36 (KHTML,like Gecko) Version/4.0 Chrome/99.0.4844.88 Mobile Safari/537.36",
"language":"zh_CN_#Hans",
"voiceVolume":"{
\"ringermode\":\"1\",
\"call\":\"1\",
\"system\":\"0\",
\"ring\":\"0\",
\"music\":\"2\",
\"alarm\":\"12\"
}",
"timezone":"GMT+08:00",
"localTime":"2022/04/02 14:27:14",
"bootTime":"945901752",
"wifiMac":"no_permission",
"ssid":"empty",
"networkType":"1",
"screenBrightness":"144",
"cpuAbiType":"arm64-v8a",
"mobileCarrierName":"no_permission",
"mobileCarrierCode":"no_permission",
"bootTimePoint":"1647934934856",
"batteryLevel":"50",
"batteryCharging":"2",
"hardwareName":"kirin710",
"deviceBrand":"HUAWEI",
"deviceManufacture":"HUAWEI",
"isVpnEnabled":"0",
"sensorCount":"18",
"sdCardName":"empty",
"sdCardCid":"empty",
"sdCardCsd":"empty",
"sdCardSerialNumber":"empty",
"simStatus":"no_permission",
"deviceId":"no_permission",
"usbDebuggingEnabled":"1",
"imeiGsm":"no_permission",
"meid":"no_permission",
"wifiNearby":"no_permission",
"reflectionImei10":"no_permission",
"reflectionImei1":"no_permission",
"reflectionImei2":"no_permission",
"androidUserId":"0",
"macFromWifiManager":"empty",
"screenLengthWidthRatio":"2312*1080",
"uuid":"db2b095d-ff80-4a8d-8fa3-a6b2135bd869",
"cpuCount":"8",
"cpuFrequency":"960000\n",
"cpuVendor":"Hisilicon Kirin710",
"andoirdUuid":"17374_4fc9ebdf-3de8-4eb5-b494-fd92961d4870",
"isPad":"0",
"isLockScreenEnabled":"0",
"appSignature":"19db688d427fa2ea911bb14eda636d7a8f471475",
"localTimeUtcTimestamp":"1648880834642",
"cpuModel":null,
"localIp":"10.255.15.134",
"locallplpv6Wifi":"fe80::f346:cf0:6daf:5d30",
"locallplpv6Mobile":"empty",
"networkGatewayIp":"10.255.12.1",
"publicNetworkIp":"45.251.107.111",
"countryCode":"HK",
"provinceCode":null,
"city":null,
"networkMask":"255.255.252.0",
"proxyInfo":"empty",
"networkGatewayMacAddress":"10.255.12.1 dev wlan0 lladdr b8:45:f4:8c:0a:b6 REACHABLE",
"appName":"Device Fingerprint Demo",
"appPackName":"ai.advance.device.fingerprint.demo",
"appVersion":"1.0.0",
"sdkVersion":"3.5.5.20220120_Android",
"appDirectory":null,
"fileSystemDirectory":"/data/user/0/ai.advance.device.fingerprint.demo/files",
"appInstallTime":"1648624321574",
"appUpdatedTime":"1648880571219"
},
"riskLabel":{
"emulator":0,
"debugMode":1,
"cloudPhone":0,
"root":0,
"appCloner":0,
"hook":0,
"vmos":0,
"tamper":0
}
},
"extra":null,
"transactionId":"2588149bf3d995cb",
"pricingStrategy":"FREE"
}
Example of NO_RECORD Response:
{
"code":"NO_RECORD",
"message":"No query record",
"data":null,
"extra":null,
"transactionId":"919cb6d188f08ca3",
"pricingStrategy":"FREE"
}
Example of PARAMETER_ERROR Response:
{
"code":"PARAMETER_ERROR",
"message":"Parameter error,please check your request whether has illegal parameters",
"data":null,
"extra":null,
"transactionId":"18b806bd4b84a766",
"pricingStrategy":"FREE"
}
Response Description:
Parameter | Description |
---|---|
code | Get Device Info Status Code |
transactionId | The request id, the max length is 64 |
pricingStrategy | Whether the request will be charged, enum type: FREE , PAY |
message | Status Code Explanation |
data | deviceLabel object The information of the device |
riskLabel object The risk label of the device |
|
extra | Extra response info (Exception Message) |
Response Code
Status Code | Message |
---|---|
SUCCESS |
free OK |
NO_RECORD |
free No query record |
PARAMETER_ERROR |
free Parameter error,please check your request whether has illegal parameters |
Note: Please remember to add a handler for the Status Codes in the Glossary as well
Token Authentication
Request Parameters:
Parameter | Description |
---|---|
accessKey | string the accessKey |
timestamp | string 13-digit-long timestamp, suggested 300 seconds before or after the current time when requesting the token |
signature | string Combined accessKey, secretKey and timestamp, encrypted by SHA256. eg. accessKey: sampleaccesskey secretKey: samplesecretkey timestamp: 1665993522952 Combined: sampleaccesskeysamplesecretkey1665993522952 Encrypted based on the combined: 02209bbeaf0d0a3dd587f6a1ba22f84c98d142e3b545e77db7e4906ca56349f5 |
periodSecond | string optional Validity period defaults to 3600 seconds, minimum 60 seconds, maximum 86400 seconds. Unit is seconds |
Note:
- You can find accessKey, secretKey on the Websaas Platform -> Account -> Account Management
- The timestamp in the “signature” must be consistent with parameter
timestamp
- Please remember to re-obtain a new valid token to do the authentication for the open APIs when the previous one is expired
Code Sample
curl -X POST \
-H "Content-Type: application/json" \
-d '{"accessKey":"22********70b","signature":"f786441e7b3d95f*****************853a5a244f9522","timestamp":1648785145789,"periodSecond":120}' \
"https://sg-api.advance.ai/openapi/auth/ticket/v1/generate-token"
Request Url
https://sg-api.advance.ai/openapi/auth/ticket/v1/generate-token
POST (application/json)
Notes:
- ADVANCE service is deployed overseas. If your test/official environment is with Internet restrictions, please request the service via VPN to avoid packet loss, service timeout and other problems
Example of Success Response:
{
"code":"SUCCESS",
"message":"OK",
"data":{
"token":"eyJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJoNV9saXZlbmVzcyIsInN1YiI6IntcImN1c3RvbWVySWRcIjo1NTAwMDI4MixcImFjY291bnRJZFwiOjU1MDAwMjg0LFwicmVhbElwXCI6XCI0NS4yNTEuMTA3LjExMVwifSIsImF1ZCI6IldFQiIsImlhdCI6MTY0MjU4MDA3MiwiZXhwIjoxNjQyNTgwMTkyfQ.HmIDcuSW67A59x7bnumjGp0Wdcz-FmoDrnHF1YGui6wVPfulLn4Izonay5LQnySgph1dbyC1E0LtifS-BJo8VA",
"expiredTime":1642580192430
},
"extra":null,
"transactionId":"6c2c50a3049ce67e",
"pricingStrategy":"FREE"
}
Example of PARAMETER_ERROR Response:
{
"code":"PARAMETER_ERROR",
"message":"Parameter should not be empty",
"data":null,
"extra":null,
"transactionId":"040e769e38f87e3e",
"pricingStrategy":"FREE"
}
{
"code":"PARAMETER_ERROR",
"message":"Timestamp error",
"data":null,
"extra":null,
"transactionId":"a9c2a6c199ad5db5",
"pricingStrategy":"FREE"
}
{
"code":"PARAMETER_ERROR",
"message":"Signature error",
"data":null,
"extra":null,
"transactionId":"00b05cb9cf6f0fed",
"pricingStrategy":"FREE"
}
Example of ACCOUNT_DISABLED Response:
{
"code":"ACCOUNT_DISABLED",
"message":"Account Disabled",
"data":null,
"extra":null,
"transactionId":"5e00fded1272490e",
"pricingStrategy":"FREE"
}
Example of CLIENT_ERROR Response:
{
"code":"CLIENT_ERROR",
"message":"HTTP 400 - Bad Request",
"data":null,
"extra":null,
"transactionId":"bd5d5653c45d4c6e",
"pricingStrategy":"FREE"
}
Response Description:
Parameter | Description |
---|---|
code |
Response Status Code |
message |
Message returned from server |
data |
token AccessToken |
expiredTime Expiration timestamp |
|
extra |
Extra response info such as exception message |
transactionId |
the request id, the max length is 64 |
pricingStrategy |
whether the request will be charged, enum type: FREE , PAY |
Response Code
Status Code | Message |
---|---|
SUCCESS |
free OK |
PARAMETER_ERROR |
free Parameter should not be empty |
free Timestamp error |
|
free Signature error |
|
ACCOUNT_DISABLED |
free Account Disabled |
CLIENT_ERROR |
free HTTP 400 - Bad Request |