Filtering
The filtering system is highly flexible and allows you to create complex queries by combining multiple conditions. Resource filtering can be achieved by providing parameters which start with filter
. For example, to only fetch cities within a specified country ID, include the filter option country.id
.
GET /v3/cities?filter%5Bcountry.id%5D=72f22218-ab1f-4933-a74d-a6467f3f6cb0 HTTP/1.1
Host: api.didww.com
Accept: application/vnd.api+json
curl -i -X GET 'https://api.didww.com/v3/cities?filter%5Bcountry.id%5D=72f22218-ab1f-4933-a74d-a6467f3f6cb0' -H "Accept: application/vnd.api+json"
Multiple parameters may be included as filters. For example, to fetch cities within specified country and region IDs, include the filter options country.id
and region.id
.
GET /v3/cities?filter%5Bcountry.id%5D=72f22218-ab1f-4933-a74d-a6467f3f6cb0&filter%5Bregion.id%5D=0800cac6-a0eb-4d58-8284-e5207b65a91b HTTP/1.1
Host: api.didww.com
Accept: application/vnd.api+json
curl -i -X GET 'https://api.didww.com/v3/cities?filter%5Bcountry.id%5D=72f22218-ab1f-4933-a74d-a6467f3f6cb0&filter%5Bregion.id%5D=0800cac6-a0eb-4d58-8284-e5207b65a91b' -H "Accept: application/vnd.api+json"
Note
Arrays
should be separated by a comma: “filter[features]=voice,sms,sms_out” and NOT filtered separately: “filter[features]=voice&filter[did_group.features]=sms”.