Sorting

Used for sorting the fields returned by the request, with a comma , separating the included fields.

Note

If the sorting option is not used, then by default the fetched data is sorted according to the ID number (such as country ID, order ID, CDR ID) assigned to the primary response data by DIDWW.

For example, to sort the list of DIDs according to their expiration timestamp, include the sort option expires_at.

http

GET v3/dids?sort=expires_at HTTP/1.1
Host: api.didww.com
Accept: application/vnd.api+json

curl

curl -i -X GET 'https://api.didww.comv3/dids?sort=expires_at' -H "Accept: application/vnd.api+json"

Note

Dot-separated sort fields can be used to request sorting based on relationship attributes. For example, a sort field of did_group.area_name could be used to request that the primary data be sorted based upon the area_name attribute of the did_group relationship.

Endpoints support multiple sort fields by allowing comma-separated sort fields ordered by priority.

http

GET /v3/dids?sort=did_group.area_name%2Cnumber HTTP/1.1
Host: api.didww.com
Accept: application/vnd.api+json

curl

curl -i -X GET 'https://api.didww.com/v3/dids?sort=did_group.area_name%2Cnumber' -H "Accept: application/vnd.api+json"

Note

Note that inserting a minus sign (-) at the beginning of any sort option results in reverse sorting.

http

GET /v3/dids?sort=-did_group.area_name%2Cnumber HTTP/1.1
Host: api.didww.com
Accept: application/vnd.api+json

curl

curl -i -X GET 'https://api.didww.com/v3/dids?sort=-did_group.area_name%2Cnumber' -H "Accept: application/vnd.api+json"

The above example will return the DIDs sorted by newly added countries (sorted by the ID numbers allocated to the supported countries in descending order). DIDs with same did_group.area_name will be sorted according to their number, in ascending alphabetical order.

Note

This section applies to any endpoint that responds with a resource collection as primary data, regardless of the request type.