checkresult
Overview
- API URL: /api/v1/zoloz/location/checkresult
- API Description: This API is used to retrieve the location detection result, including information such as IP address, geographical location, VPN detection result, and simulated location detection result.
Note: This API does not support repeated calls and is therefore not idempotent.
Request Parameter
Field Name | Data Type | Max Length | Mandatory | Fault Value | Description | Sample |
bizId | String | 32 | Y | - | Business ID, the unique identifier of a business transaction, used for business tracking. For example, a serial number from the merchant's business-related database. | "2017839040588699" |
transactionId | String | 64 | Y | - | The transaction ID to be queried, returned by the GeoTrust Locator initialize API. | "G000000005FID2020030400000000000157****" |
Response Parameter
Field Name | Data Type | Mandatory | Description | Sample |
result | Y | The result of the API request, including the operation status, result code, and message. | { "resultCode": "SUCCESS", "resultMessage": "Success", "resultStatus": "S" } | |
geoResult | String | N | Overall result of the location detection process.
| "Success" |
ipLocation | Map | N | Geolocation result parsed from the user’s IP address, including country, region, city, and coordinates. For details, see IpLocation. | { "ip": "140.*.*.19", "country": "China", "city": "Zhejiang", "latitude": "30.2672", "longitude": "120.1551" } |
matchedGeoFence | Boolean | N | Geofencing match result.
| true |
vpnDetected | Boolean | N | Result of the VPN connection detection.
| false |
mockDetected | Boolean | N | Result of the simulated location detection.
| false |
IpLocation
Field Name | Data Type | Mandatory | Description | Sample |
ip | String | N | The IP address of the user's device | "140.*.*.19" |
country | String | N | Country, Chinese is supported for return values. | "China" |
city | String | N | City, Chinese is supported for return values. | "Zhejiang" |
latitude | String | N | Latitude | "30.2672" |
longitude | String | N | Longitude | "120.1551" |
Result
Perform the next action based on the request result, as follows:
- When the value of
result.resultStatusisS, it indicates that the call to the ZOLOZ GeoTrust Locator checkresult API was successful:
- If
geoResultreturnsSuccess, the location detection has passed. - If
geoResultreturnsFailure, the location detection has failed. Analyze the specific cause using the returned parameters:vpnDetected,mockDetected, andmatchedGeoFence.
- When the value of
result.resultStatusisF, it indicates that the call to the ZOLOZ GeoTrust Locator checkresult API failed. Please check the error code for more details about the error, and analyze the cause of the failure.
API-common Result codes
For the full list of common result codes, see the API common result code.
Sample
Request Sample
{
"bizId": "2017839040588699",
"transactionId": "G000000005FID2020030400000000000157****"
}Response Sample
Success Response
{
"result": {
"resultCode": "SUCCESS",
"resultMessage": "Success",
"resultStatus": "S"
},
"geoResult": "Success",
"ipLocation": {
"ip": "140.*.*.19",
"country": "China",
"city": "Zhejiang",
"latitude": "30.2672",
"longitude": "120.1551"
},
"matchedGeoFence": true,
"vpnDetected": false,
"mockDetected": false
}Failure response: VPN detected
{
"result": {
"resultCode": "SUCCESS",
"resultMessage": "Success",
"resultStatus": "S"
},
"geoResult": "Failure",
"ipLocation": {
"ip": "140.*.*.19",
"country": "China",
"city": "Zhejiang",
"latitude": "30.2672",
"longitude": "120.1551"
},
"matchedGeoFence": true,
"vpnDetected": true,
"mockDetected": false
}Failure response: Not within the specified administrative region
{
"result": {
"resultCode": "SUCCESS",
"resultMessage": "Success",
"resultStatus": "S"
},
"geoResult": "Failure",
"ipLocation": {
"ip": "203.*.*.67",
"country": "Singapore",
"city": "Singapore",
"latitude": "1.3521",
"longitude": "103.8198"
},
"matchedGeoFence": false,
"vpnDetected": false,
"mockDetected": false
}