Summary: Provide the country of the requester
Authentication: None, X-Auth
GET /services/geo/v1/location/where_am_i
Description
Use this API to determine the location of the user. This request can be made with the X-Auth token and an interim result of INPRO can be returned meaning the geo location lookup is in progress.
Query String Request Parameters
Parameter | Description |
---|---|
ip_address | Optional. Use this specific IP address in the geo lookup. |
Response Parameters
Parameter | Type | Description |
---|---|---|
country_code | string | ISO 3166-1 two-letter country code. |
ip_address | string | The IP address of the requester. |
Examples
Geo Location Request
curl -i 'https://store.shift72.com/services/geo/v1/location/where_am_i'
Geo Location Request With IP Address
curl -i 'https://store.shift72.com/services/geo/v1/location/where_am_i?ip_address=8.8.8.8'
Geo Location Request With Auth Token
curl -i 'https://store.shift72.com/services/geo/v1/location/where_am_i' \
-H 'x-auth-token: e7ddfaf607c1b9f165500b312dc3d6d5'
Response: In Progress
HttpStatus: 200
{
"country_code":"IPRO"
}
Response: Success
HttpStatus: 200
{
"country_code":"nz",
"ip_address":"8.8.8.8"
}