Start a new topic

Api console with query body

Is there any way to use the API Console to get data from collections using a custom query body?

Neto - if you are requesting collection data with a GET request, you can definitely add a custom query to filter your results. Querying is done through the query string parameters, rather than the request body (GET requests don't typically have a request body).

For details on the query syntax for the REST API, check out the Dev Center guide on querying:
Dave, my question was about using custom query on web api console just for testing, you know what I mean? I'm asking because there is only fields to put new headers to the request using GET method ...
Neto - not sure I understand. To add a query to a GET request, just append a "?" to the end of the url, followed by the filters you want. There is no separate input box for the query, if that is what you are asking.

For example, to get all books from the `books` collection whose `author` is `Ian Fleming`, your url field would look something like this:

`/appdata/kid-abc123/books/?query={"author":"Ian Fleming"}`

Note that I didn't URL encode the query JSON itself - the API console should do that automatically for you.

Let me know if I'm still misunderstanding your question.
Thanks Dave! That solved my problem!
Login or Signup to post a comment