Filtering¶
Although, filtering of resources is not strictly defined in JSON:API, we chose to follow the recommendations regarding the format.
So let's take an example resource named Book. Let's assume it has the
mandatory identifier id, an attribute title and a relationship author
to a resource having an identifier id and an attribute name.
The following requests MAY be supported:
/books/?filter[id]=123/books/?filter[id][in]=123,456/books/?filter[name]=Foundation/books/?filter[name][contains]=dat/books/?filter[author][name]=Asimov/books/?filter[name]=Foundation&filter[author][name]=Asimov
Info
When an endpoint supports filtering, it's explicitly mentioned in the documentation, along with supported attributes and relationships.
Warning
Venues and Projects
list endpoint does not require any filter to be present, but most of the
other endpoints require either a venue filter or a project filter.
If you try to use the list operation on such endpoints, you will receive
and error response similar to:
{
"errors": [
{
"status": 400,
"source": {},
"title": "Bad request",
"detail": "Venue or project filter must be specified for this endpoint."
}
],
"jsonapi": {
"version": "1.0"
}
}