0
votes

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 Answers

1
votes

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.