Get Regions#
Description
Returns a collection of Regions. Pagination is disabled.
Request#
HTTP Method: GET
URI Path: /v3/regions
URI Query Parameters:
Name |
Type |
Is Required? |
Description |
|---|---|---|---|
filter[<filter_name>] |
|
Optional |
|
include |
|
Optional |
|
sort |
|
Optional |
Includes:
Value |
Description |
|---|---|
country |
Filters:
Filter Name |
Type |
Allow Blank |
Allow Array |
Filters by: |
|---|---|---|---|---|
id |
|
No |
Yes |
Region |
name |
|
Yes |
Yes |
Region |
country.id |
|
Yes |
Yes |
A |
Sorting:
Value |
Sorts by: |
|---|---|
name |
Region |
Examples#
http
1GET /v3/regions HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API Token]
curl
1curl -i -X GET https://api.didww.com/v3/regions -H "Accept: application/vnd.api+json" -H "Api-Key: [API Token]" -H "Content-Type: application/vnd.api+json"
response
1HTTP/2 200 OK
2Content-Type: application/vnd.api+json
3
4{
5 "data": {
6 "id": "8ce33ee2-73da-4baa-85a0-cd607d0e9733",
7 "type": "regions",
8 "attributes": {
9 "name": "Alberta"
10 },
11 "relationships": {
12 "country": {
13 "links": {
14 "self": "https://api.didww.com/v3/regions/8ce33ee2-73da-4baa-85a0-cd607d0e9733/relationships/country",
15 "related": "https://api.didww.com/v3/regions/8ce33ee2-73da-4baa-85a0-cd607d0e9733/country"
16 }
17 }
18 }
19 },
20 "meta": {
21 "api_version": "2017-09-18"
22 }
23 }
http
1GET /v3/regions?filter%5Bcountry.id%5D=3b11ad09-dc7e-451a-9d32-ae9c1604aaa8&sort=-name HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API Token]
curl
1curl -i -X GET 'https://api.didww.com/v3/regions?filter%5Bcountry.id%5D=3b11ad09-dc7e-451a-9d32-ae9c1604aaa8&sort=-name' -H "Accept: application/vnd.api+json" -H "Api-Key: [API Token]" -H "Content-Type: application/vnd.api+json"
response
1HTTP/1.1 200 OK
2Content-Type: application/vnd.api+json
3
4{
5 "data": [{
6 "id": "e2f3f115-11f1-43cf-8279-08b29d94403d",
7 "type": "regions",
8 "attributes": {
9 "name": "Alberta"
10 },
11 "relationships": {
12 "country": {
13 "links": {
14 "self": "https://api.didww.com/v3/regions/e2f3f115-11f1-43cf-8279-08b29d94403d/relationships/country",
15 "related": "https://api.didww.com/v3/regions/8ce33ee2-73da-4baa-85a0-cd607d0e9733/country"
16 }
17 }
18 }
19 }],
20 "meta": {
21 "api_version": "2017-09-18"
22 }
23}
http
1GET /v3/regions?include=country HTTP/1.1
2Host: api.didww.com
3Content-Type: application/vnd.api+json
4Accept: application/vnd.api+json
5Api-Key: [API Token]
curl
1curl -i -X GET 'https://api.didww.com/v3/regions?include=country' -H "Accept: application/vnd.api+json" -H "Api-Key: [API Token]" -H "Content-Type: application/vnd.api+json"
response
1HTTP/1.1 200 OK
2Content-Type: application/vnd.api+json
3
4{
5 "data": [
6 {
7 "id": "8ce33ee2-73da-4baa-85a0-cd607d0e9733",
8 "type": "regions",
9 "attributes": {
10 "name": "Alberta"
11 },
12 "relationships": {
13 "country": {
14 "links": {
15 "self": "https://api.didww.com/v3/regions/8ce33ee2-73da-4baa-85a0-cd607d0e9733/relationships/country",
16 "related": "https://api.didww.com/v3/regions/8ce33ee2-73da-4baa-85a0-cd607d0e9733/country"
17 },
18 "data": {
19 "type": "countries",
20 "id": "fa914558-9c64-4e01-967b-3302bd65a97b"
21 }
22 }
23 }
24 }
25 ],
26 "included": [
27 {
28 "id": "fa914558-9c64-4e01-967b-3302bd65a97b",
29 "type": "countries",
30 "attributes": {
31 "name": "Canada",
32 "prefix": "1",
33 "iso": "CA"
34 },
35 "relationships": {
36 "regions": {
37 "links": {
38 "self": "https://api.didww.com/v3/countries/24eb6e85-f628-4765-bbb2-420e48de76f2/relationships/regions",
39 "related": "https://api.didww.com/v3/countries/24eb6e85-f628-4765-bbb2-420e48de76f2/regions"
40 }
41 }
42 }
43 }
44 ],
45 "meta": {
46 "api_version": "2017-09-18"
47 }
48}
Other Responses#
Code |
Success |
Description |
|---|---|---|
404 |
No |
|
401 |
No |