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
3
curl --location 'https://bre-b-sandbox.api.visionamos.passportfintech.com/v1/paas/entities/customers/accounts?page_size=10' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer 0a3b39a14842e49c79249e1df649ebf9aaecb053386d2ad3dc8da201bd54373f'
Supported Query Parameters
The following query parameters can be used for filtering, sorting, and pagination:
Pagination Parameters
Parameter | Description |
---|---|
page_size | The number of results per page. Default varies based on the endpoint. |
page_number | The current page number for paginated results. Default is 1 . |
Sorting Parameters
Parameter | Description |
---|---|
order_key | The field to sort results by (e.g., created_at , updated_at ). |
order_direction | The sorting order: asc (ascending) or desc (descending). Default is asc . |
Date Filtering Parameters
Parameter | Description |
---|---|
created_at | Filters by exact creation date. |
created_from | Filters results created after this date. |
created_to | Filters results created before this date. |
updated_at | Filters by exact update date. |
updated_from | Filters results updated after this date. |
updated_to | Filters results updated before this date. |
ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ
).
Filtering Parameters
Parameter | Description |
---|---|
customer_id | Filters results by a specific customer ID. |
customer_status | Filters customers based on their status (e.g., active , inactive ). |
Filters results based on an exact email address. | |
mobile | Filters results by a specific mobile phone number. |
Example of Requests
Paginated Requests
GET /v1/paas/entities/customers/accounts?page_size=10&page_number=2 HTTP/1.1
Sorting by Creation Date in Descending Order
GET /v1/paas/entities/customers/accounts?order_key=created_at&order_direction=desc HTTP/1.1
Date Range Filtering
GET /v1/paas/entities/customers/accounts?created_from=2023-01-01T00:00:00Z&created_to=2023-12-31T23:59:59Z HTTP/1.1
Best Practices for Using Query Parameters
- Use pagination (
page_size
andpage_number
) to avoid excessive API load. - Filter using
created_from
andcreated_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.
On This Page
Query ParametersIntroductionQuery Parameter StructureExample of Endpoint and Query ParametersSupported Query ParametersPagination ParametersSorting ParametersDate Filtering ParametersFiltering ParametersExample of RequestsPaginated RequestsSorting by Creation Date in Descending OrderDate Range FilteringBest Practices for Using Query Parameters