Upply API Sorting and Filtering
The Upply API allows clients to sort and filter API responses to help find the data they need more quickly and easily.
Sorting
Sorting in the Upply API is controlled by a query parameter called sort
. The sort
parameter specifies the field or fields to sort on, and the direction of the sort (ascending or descending).
For example, to sort a list of shipments by the created_at
field in descending order, you would set the sort
parameter to created_at.desc
. To sort by multiple fields, separate the fields with a comma (,
). For example, to sort by created_at
in descending order, then by origin_city
in ascending order, you would set the sort
parameter to created_at.desc,origin_city.asc
.
Filtering
Filtering in the Upply API is controlled by query parameters called filter
. The filter
parameter allows clients to specify one or more conditions that the data must meet to be included in the response.
For example, to retrieve all shipments that have an origin city of "Paris", you would set the filter
parameter to origin_city=Paris
. To filter by multiple conditions, separate the conditions with an ampersand (&
). For example, to retrieve all shipments that have an origin city of "Paris" and a destination country of "Spain", you would set the filter
parameter to origin_city=Paris&destination_country=Spain
.
Sorting and Filtering Best Practices
We recommend that clients follow these best practices when using sorting and filtering in the Upply API:
- Use sorting and filtering to help find the data you need more quickly and easily.
- Use the
sort
andfilter
parameters consistently across all API requests to ensure consistent behavior. - Be aware of any limitations or restrictions on the fields that can be sorted or filtered.
- Use appropriate syntax and encoding for special characters and values in sort and filter parameters.
Contact Us
If you have any questions or concerns about sorting and filtering in the Upply API, please contact us at [email protected].