bdizzle
bdizzle

Reputation: 419

Issue using "where" in parse.com rest api - query constraints

Using the rest API for parse.com, however, struggling to get the where clause to work properly. I've read through their documentation, but don't understand why I'm not getting results. I get a 200 status, but no results.

curl -X "GET" "https://api.parse.com/1/classes/companies?limit=10000&where=%7B%22company_id%22%3A%221%22%7D" \
-H "X-Parse-Application-Id: 444444" \
-H "X-Parse-Master-Key: 444444"

Basing this on their query constraints found here

Upvotes: 1

Views: 314

Answers (1)

meeDamian
meeDamian

Reputation: 1164

Try:

curl -X GET \
-H "Content-Type: application/json" \
-H "X-Parse-Application-Id: 444444" \
-H "X-Parse-REST-API-Key: 444444" \
-G \
--data-urlencode "where={\"company_id\":\"1\"}" \
--data-urlencode "limit=10000" \
https://api.parse.com/1/classes/companies

Note: Either consider using REST key, or change relevant line to master key.


Additionally, you have a nice curl request generator under API Console tab in your Parse project, and the URL to it will look sth like:

https://www.parse.com/apps/<PROJECT_NAME>/api_console

Upvotes: 1

Related Questions