Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update message regarding 200 OK responses #339

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions guides/Getting-Started/filtering.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,36 @@ An incorrectly formatted filter or an unsupported operator returns a `400` respo
}
```

:::note
When a query with a filter returns no matching results, the API will respond with the following: HTTP Status Code: 200 OK
This indicates that the request was successful, even if no records match the filter criteria.
- Response Body:
```json
{
"meta": {
"page": {
"limit": 25,
"offset": 0,
"current": 1,
"total": 0
},
"results": {
"total": 0
}
},
"data": [],
"links": {
"current": "{base_url}/example/?filter=eq(name,Elastic)&page[offset]=0&page[limit]=25",
"first": "{base_url}/example/?filter=eq(name,Elastic)&page[offset]=0&page[limit]=25",
"last": "{base_url}/example/?filter=eq(name,Elastic)&page[offset]=0&page[limit]=25",
"next": "null",
"prev": "null"
}
}
```
The empty data array signifies that no records were found.
:::

### Performance

Filtered queries may be less performant than non-filtered queries, especially at scale (either with high
Expand Down