/api/import/:id
Posts data to BellaDati in JSON format.
This endpoint is designed to consume larger amounts of data. If you want to insert single records (record by record), use POST Form Data endpoint instead.
Resource Information
Resource URL | |
HTTP Method |
|
Request Parameters
Parameters | Detail | Example | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ID of the data set. You can find the ID in the response to | 123 | ||||||||||||||||||||||||||||
| JSON file containing data content to submit with following structure:
| { "overwrite": { "policy": "DELETE_ALL", "dateAttribute": "L_MY_DATE", "dateFrom": "2014-12-01", "dateTo": "2014-12-31", "attributesAll": false, "overwriteAttributes": [ "L_ID", "L_MY_DATE" ] }, "columns" : [ { "code" : "L_COUNTRY_OR_AREA" }, { "code" : "L_MY_DATE", "format" : "yyyy-MM-dd" }, { "code" : "L_MY_TIME", "format" : "HH:mm:ss.SSS" }, { "code" : "L_MY_DATETIME", "format" : "yyyy-MM-dd HH:mm:ss.SSS" }, { "code" : "M_REVENUE" } ], "data" : [ [ "Country or Area 1", "2015-12-01", "22:33:44.555", "2015-12-01 22:33:44.555", "10000" ], [ "Country or Area 2", "2015-12-02", "16:27:38.123", "2015-12-02 16:27:38.123", "23456" ] ] } |
Sample Request / Response
Using curl
:
curl -H "Authorization: OAuth realm=\"https://service.belladati.com/\", oauth_consumer_key=\"myConsumer\", oauth_token=\"mh7an9dkrg59\", oauth_timestamp=\"135131231\", oauth_nonce=\"randomString\"" -H "Content-Type: application/octet-stream" --data-binary @MyDataFile.json https://service.belladati.com/api/import/123
When the file has been submitted successfully, the server replies with an HTTP status code of 200 and the content contains import ID:
Import id=456 started