When using the Region Entry and Exit API or the Segment Queries API region IDs are returned as part of their responses. To turn this into something meaningful you can map these to their names and types using the regions API.
To get a list of all of the regions use the following API call:
GET https://api.crowdconnected.com/prod/external/regions
Headers:
Auth: "YOUR_API_KEY"
Response:
{
"Count": 1,
"Regions": [
{
"regionID": "e3fa0528-32b6-46ce-a512-910206e82058",
"name": "Crowd Connected Stand_CC28",
"type": "stand"
}
]
}
Using the API when there is more than 1,000 regions
The regions API is paginated if there are more than 1,000 regions in the response. If there are additional items to get the response will contain the LastEvaluatedKey, this can then be used in the query params to fetch any remaining regions.
Initial GET
GET https://api.crowdconnected.com/prod/external/regions
Response:
{
"Count": 1000,
"Regions": [
{
"regionID": "e3fa0528-32b6-46ce-a512-910206e82058",
"name": "Crowd Connected Stand_CC28",
"type": "stand"
},
...
],
"LastEvaluatedKey": "e3fa0528-32b6-46ce-a512-910206e82058"
}
Next GET
GET https://api.crowdconnected.com/prod/external/regions?lastEvaluatedKey=e3fa0528-32b6-46ce-a512-910206e82058
Response:
{
"Count": 10,
"Regions": [
{
"regionID": "f6c3bec7-630c-451b-8b49-ce884af2df97",
"name": "Crowd Connected Stand_CC03",
"type": "stand"
},
...
]
}