Deprecated - API v1 will be switched off on 01.07.2022. Please upgrade to API v2
Cities
City properties
Country is described by the following properties
Name | Type | Description |
---|---|---|
id |
long |
Unique identifier of city. |
name |
string |
City name. |
country |
Country | Contry city is located in. |
List cities with given name
GET Geo/Cities
Returns paginated cities list, in country identified by countryId
.
Parameters
Name | Type | Description |
---|---|---|
countryId |
long |
Required. Country identifier. |
name |
string |
City name. Request returns cities with name containing name parameter value. |
page |
int |
Page number, defaults to 1 . |
Example request
In this example we fetch list of all polish cities that name contains Warszawa
string.
curl -i -X GET -H "Authorization: Bearer $ACCESS_TOKEN" http://yoursubdomain.perfectgym.com/Api/Geo/Cities ?countryId=187 &name=Warszawa
Example response
Status: 200 OK
{
"elements": [
{
"id": 1695965,
"name": "Bukowno Warszawa",
"country": {
"id": 187,
"symbol": "PL",
"name": "Poland",
"nativeName": "Polska"
}
},
{
"id": 1722157,
"name": "Warszawa",
"country": {
"id": 187,
"symbol": "PL",
"name": "Poland",
"nativeName": "Polska"
}
}
]
}