0

I am new to executing curl statements to update my database on Parse.com. I am able to add new rows to my class without a problem by using POST. Now... I am wondering how to update a current row in my Parse database by fetching the objectId and then updating my Parse database. *I want to make sure that I am querying by the correct id and then update the status.


I am on the right track.

curl -X GET \
  -H "X-Parse-Application-Id: my_id" \
  -H "X-Parse-REST-API-Key: my_key" \
  -G \
  --data-urlencode 'keys=SiteID,site_status' \
  https://api.parse.com/1/classes/MyClassName

How do I turn this GET method containing the objectId and put it into Parse by using it at the end of the PUT method?

output from curl: {"SiteID":"MOCMBS0006","site_status":"Online","createdAt":"2014-06-05T19:58:26.843Z","updatedAt":"2014-06-18T22:34:39.779Z","objectId":"randomobjectid"}

Can anyone please help me? Thank you in advance!!! Any advice would be appreciated. :)

1

1 Answer 1

1

It's in the docs here: https://parse.com/docs/rest#objects-updating

curl -X PUT \
  -H "X-Parse-Application-Id: app-id-here" \
  -H "X-Parse-REST-API-Key: rest-api-key" \
  -H "Content-Type: application/json" \
  -d '{"score":73453}' \
  https://api.parse.com/1/classes/GameScore/Ed1nuqPvcm

Note the PUT method at the top, and the objectId at the end of the URL. You pass in only the fields you wish to modify.

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

9 Comments

"I am wondering how to update a current row in my Parse database without having to use the objectID generated by Parse" - is what I was aiming for. I currently do not have access to the objectId generated by parse when I am executing this command. Is there a way to query in a PUT?
No, you have to query first.
How do I use a queried GET method and then call a PUT method?
Get the object id from the results of your query.
I am having a hard time finding how to fetch the objectID from my GET method. How do I call/include on my GET method to retrieve the objectID result? is it like --data-urlencode 'keys=objectID, site_id' \
|

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.