GET /regions¶
Scope |
|
Accept |
|
This URL returns the a map of id to regions in the format described in
Regions for the id’s requested in parameter regionIds
.
This parameter is a comma separated list of integers.
If the parameter regionIds
contains invalid data, i.e. not a positive
integer, the server returns 400 Bad Request.
Parameters¶
Name |
Type |
Description |
---|---|---|
regionIds |
string |
Comma-separated-list of integer id’s to get regions for. |
_include |
string |
Comma-separated-list of fields to include. Optional, default is all fields. |
_exclude |
string |
Comma-separated-list of fields to omit. Optional, default empty. |
Errors¶
Field |
Code |
Error message |
Description |
---|---|---|---|
regionIds |
2000 |
missing argument |
The parameter needs to be present |
regionIds |
2001 |
invalid argument |
The comma-separated-list contains one or more non-integer values |
regionIds |
2004 |
too short |
The value needs to be non-empty |
regionIds |
2005 |
too long |
The comma-separated-list contains more than 100 items |
Example¶
GET /api/sellside/regions?regionIds=1700093,1700195,1700196 HTTP/1.1
Accept: application/sellside.region.list-v1+json; application/json
200 OK HTTP/1.1
Content-Length: 808
Content-Type: application/sellside.region.list-v1+json; charset=UTF-8
Date: Fri, 02 Sep 2016 14:00:35 GMT
Oauth-Scope: api_ro api_rw
Oauth-Scope-Required: get_region
{
"1700093": {
"links": {
"parent": "/api/sellside/region/9009",
"self": "/api/sellside/region/1700093"
},
"id": 1700093,
"parentId": 9009,
"level": 2,
"path": "9009_1700093",
"center": {
"latitude": 50.283,
"longitude": -107.767
},
"label": {
"en_CA": "Swift Current",
"fr_CA": "Swift Current"
}
},
"1700195": {
"links": {
"parent": "/api/sellside/region/1700194",
"self": "/api/sellside/region/1700195"
},
"id": 1700195,
"parentId": 1700194,
"level": 3,
"path": "9009_1700194_1700195",
"center": {
"latitude": 50.4,
"longitude": -105.55
},
"label": {
"en_CA": "Moose Jaw",
"fr_CA": "Moose Jaw"
}
},
"1700196": {
"links": {
"parent": "/api/sellside/region/1700194",
"self": "/api/sellside/region/1700196"
},
"id": 1700196,
"parentId": 1700194,
"level": 3,
"path": "9009_1700194_1700196",
"center": {
"latitude": 50.448009,
"longitude": -104.595177
},
"label": {
"en_CA": "Regina",
"fr_CA": "Regina"
}
}
}