You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

/api/import/forms/:id

Posts data to BellaDati using the form with the specified ID (read how to create form here Data Collection Module)

This endpoint is designed to collect single data records (record by record). For bulk imports use POST JSON data endpoint instead.

Resource Information

Request Parameters

Parameters

Detail

Example

id

ID of the form to fill. You can find the ID in the response to /api/import/forms.

123

data

Form contents to submit in JSON format. For each field, the key is the ID of the form element to save as the given value.

Prior to saving your data. You need to get the element ID (in our example element ID for value John is rN5hVdAXBJ) by calling /api/import/forms GET REST API request.

{
  "rN5hVdAXBJ" : "John" ,
  "mNdZBe1rMY" : 1000
}

best practices (lightbulb)

If your application is sending small data very frequently. You should use /api/import/forms/:id instead of using /api/import/:id.

Typical business case is IoT sensor sending data every second.We also recommend to give your application at least 3 sec buffer between each REST API call

 

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\"" -d "data={\"rN5hVdAXBJ\":\"John\",\"mNdZBe1rMY\":1000}" https://service.belladati.com/api/import/forms/123

When the form has been submitted successfully, the server replies with an HTTP status code of 200 and an empty body.

  • No labels