How to save multiple objects using android PARSE library

In my Android application, I get a user from facebook who runs a FQL query, and I want to save the results on the PARSE platform. Instead of saving each object separately, is there a way to make a batch request?

+4
source share
2 answers

Using the Parse REST API, you can perform batch operations (create, read, update, delete, etc.).

Here is an example of saving multiple objects:

curl -X POST \
  -H "X-Parse-Application-Id: ${APPLICATION_ID}" \
  -H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
        "requests": [
          {
            "method": "POST",
            "path": "/1/classes/GameScore",
            "body": {
              "score": 1337,
              "playerName": "Sean Plott"
            }
          },
          {
            "method": "POST",
            "path": "/1/classes/GameScore",
            "body": {
              "score": 1338,
              "playerName": "ZeroCool"
            }
          }
        ]
      }' \
  https://api.parse.com/1/batch

For more information, see Batch Operations in the Parse REST API Guide .

+2
source

All Articles