Query Parameters

Introduction

Query parameters allow you to filter, sort, and paginate API responses, ensuring efficient data retrieval. This guide explains how to use query parameters in Passport API requests, including how they interact with pagination.

Query Parameter Structure

Query parameters are appended to the endpoint URL in key-value pairs. Multiple parameters are joined using &.

Example of Endpoint and Query Parameters

JSON
Copy

Supported Query Parameters

The following query parameters can be used for filtering, sorting, and pagination:

Pagination Parameters

ParameterDescription
page_sizeThe number of results per page. Default varies based on the endpoint.
page_numberThe current page number for paginated results. Default is 1.

Sorting Parameters

ParameterDescription
order_keyThe field to sort results by (e.g., created_at, updated_at).
order_directionThe sorting order: asc (ascending) or desc (descending). Default is asc.

Date Filtering Parameters

ParameterDescription
created_atFilters by exact creation date.
created_fromFilters results created after this date.
created_toFilters results created before this date.
updated_atFilters by exact update date.
updated_fromFilters results updated after this date.
updated_toFilters results updated before this date.

ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ).

Filtering Parameters

ParameterDescription
customer_idFilters results by a specific customer ID.
customer_statusFilters customers based on their status (e.g., active, inactive).
emailFilters results based on an exact email address.
mobileFilters results by a specific mobile phone number.

Example of Requests

Paginated Requests

JSON
Copy

Sorting by Creation Date in Descending Order

JSON
Copy

Date Range Filtering

JSON
Copy

Best Practices for Using Query Parameters

  • Use pagination (page_size and page_number) to avoid excessive API load.
  • Filter using created_from and created_to for efficient date-based searches.
  • Sort results (order_key, order_direction) to get structured responses.
  • Combine multiple filters to refine search results effectively.
  • Validate query parameters before sending requests to avoid errors.
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard