Documentação da API para uso do Filtros e Paginação
Introdução
O RSQL (RESTful Service Query Language) é uma linguagem de consulta de serviços RESTful que permite filtrar, classificar e paginar recursos RESTful.
Uso
Filtragem
A filtragem é feita usando o operador ==
para igualdade e o operador !=
para desigualdade. Você também pode usar os operadores <
, <=
, >
, >=
para comparações numéricas e =gt=
, =ge=
, =lt=
e =le=
para comparar datas.
Exemplo: /api/transaction?search=status=="APPROVED"
Classificação
Para classificar os recursos, use o parâmetro sort
na consulta. A ordem padrão é ascendente, mas você pode especificar a ordem descendente usando o prefixo -
.
Exemplo: /api/transaction?search=nome==%CREDIT_CARD%22&sort=-preco
Paginação
Use os parâmetros offset
e limit
para a paginação. offset
define a posição do primeiro recurso e limit
define o número de recursos a serem retornados.
Exemplo: /api/transaction?search=typeTransaction==%22CREDIT_CARD%22&offset=10&limit=5
Conclusão
O RSQL é uma linguagem de consulta poderosa e flexível para serviços RESTful. Na PoolPay, os nossos clientes devem utilizar o padrão RSQL nos campos denominados como CRITERIA
.
API Documentation for using RSQL
Introduction
RSQL (RESTful Service Query Language) is a query language for RESTful services that allows filtering, sorting, and pagination of RESTful resources. The RSQL API is easy to use and can be used to query any service that supports the RESTful interface.
Usage
Filtering
Filtering is done using the ==
operator for equality and the !=
operator for inequality. You can also use the <
, <=
, >
, >=
operators for numeric comparisons and =gt=
, =ge=
, =lt=
, and =le=
to compare dates.
Example: /api/transaction?search=status=="APPROVED"
Sorting
To sort resources, use the sort
parameter in the query. The default order is ascending, but you can specify descending order using the -
prefix.
Example: /api/transaction?search=typeTransaction==%22CREDIT_CARD%22&sort=-price
Pagination
Use the offset
and limit
parameters for pagination. offset
defines the position of the first resource and limit
defines the number of resources to be returned.
Example: /api/transaction?search=typeTransaction==%22CREDIT_CARD%22&offset=10&limit=5
Conclusion
RSQL is a powerful and flexible query language for RESTful services. At PoolPay, our customers should use the RSQL standard in fields called CRITERIA
. We hope this documentation has been helpful in understanding how to use RSQL in your API. If you have any questions, please don't hesitate to contact us.