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.
Written by Jose Jesus Perez Aguinaga
Related protips
3 Responses
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.
@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.
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?
Have a fresh tip? Share with Coderwall community!
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside