1

If this has already been answered please feel free to direct to a relevant Q&A. The only answer I have found is what I am already trying and I am not getting the result I am hoping for. Also looked over the REST API documentation for Parse and no luck in figuring this out. That being said...

I have two classes in Parse.com: Invites and Events Each Invite has a relation to an Event. Ideally I would like to query the Invite but also receive event_name and event_address from the Events object related to the invite.

This is the curl query I have been trying (pulled from the other answer I mentioned and Parse.com docs):

       curl -X GET \
       -H "X-Parse-Application-Id: xxxxx" \
       -H "X-Parse-REST-API-Key: xxxxxx" \
       --data-urlencode 'where={"$relatedTo":{"object":{"__type":"Pointer","className":"Events","objectId":"Yp04m8QT2N"},"key":"event_name"}}' \
       https://api.parse.com/1/classes/Invites/XXQ0191KSv

Yp04m8QT2N is the related 'Events' objectId, event_name is in the Events class

I am getting results from the invite class but was expecting event_name to be included in the results. What am I missing? I haven't gotten as far as including multiple columns from events so if you could save me another question it would be much appreciated!

Response:

    {"createdAt":"2014-06-07T20:26:04.877Z","event_objectId":{"__type":"Relation","className":"Events"},"invite_email":"[email protected]","invite_firstname":"Steven","invite_lastname":"Carlton","invite_opendate":{"__type":"Date","iso":"2014-06-08T19:16:00.000Z"},"invite_phone":"1234567890","invite_sentdate":{"__type":"Date","iso":"2014-06-07T20:26:00.000Z"},"objectId":"XXQ0191KSv","updatedAt":"2014-06-08T19:17:17.980Z"}

Thanks for your help!

1 Answer 1

3

if it really is a pointer, then as docs say in 'retreiving objects' section , you can just do

--data-urlencode 'include=$pointer' 

where $pointer is the field name in Invites whose value is the pointer to Events.

If you are useing a relation type instead of a pointer then you can not flatten the query in this way.

Sign up to request clarification or add additional context in comments.

1 Comment

Man I can't tell you how many times I looked at those docs. I did try include as well but did not try the pointer column from Invites. Once I did this, I got the expect result. '--data-urlencode 'include=event_objectId'' was what I needed for this specific example.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.