Last Updated: February 25, 2016
·
3.799K
· jjperezaguinaga

Batch import into Parse.com with cURL

If you want to import, let's say, a data.json file with all your entries for a Parse.com class with cURL, you can't do this:

curl -X POST \
-H "X-Parse-Application-Id:<<PARSE_APP_ID>>" \
-H "X-Parse-REST-API-Key: <<PARSE_REST_ID>> " \
-H "Content-Type: application/json" \
-d @import_ready.json \
https://api.parse.com/1/classes/<<CLASS_NAME>>

This won't work, you either need to load them individually or create a Javascript file that wraps that functionality for each entry in class.

3 Responses
Add your response

Hi, Jose. You might want to take a look at Parse's batch REST endpoint. It will let you save up to 20 objects at one time.

https://www.parse.com/docs/rest#objects-batch

over 1 year ago ·

@bklimt Ah, thank you, I indeed saw that, but the problem is that you need to structure your json file in differente individual objects wrapped around a requests array. Chances are that all my objects will have the same REST method, so why putting it anyway? I wish it could just take a single array (no need to wrap) and import it inside my class without the dibbi-dibba-biddi.

over 1 year ago ·

Hi Jose, I wrote PhantomJS script that automates bulk data import via the web interface. The script and instructions are available here: https://gist.github.com/yanirs/eddedf152f42c1ee02b2

Other solutions I've tried are discussed here: http://yanirseroussi.com/2015/01/15/automating-parse-com-bulk-data-imports/

Does this answer your question?

over 1 year ago ·