Reputation: 178
I am trying to get relation objects from a class. What I am doing looks something like this, but it is not working. Does anybody know what I could be doing wrong?
curl -X GET \
-H "X-Parse-Application-Id: xxxxx" \
-H "X-Parse-REST-API-Key: xxxx" \
--data-urlencode 'where={"$relatedTo":{"object":{"__type”:"Relation","className”:”Dog","objectId":"xkxJOVMcMv"},"key”:"dogs"}}' \
https://api.parse.com/1/classes/owner
Thank you !
Upvotes: 1
Views: 707
Reputation: 2717
I assume that your owner class has a relation field to Dog class and you want to get all the dogs someone owns via that relation. You should then to do this instead:
curl -X GET \
-H "X-Parse-Application-Id: xxxxx" \
-H "X-Parse-REST-API-Key: xxxx" \
--data-urlencode 'where={"$relatedTo":{"object":{"__type":"Pointer","className":"owner","objectId":"<ownerid>"},"key":"dogs"}}' \
https://api.parse.com/1/classes/Dog
Upvotes: 2