/api/import/forms/:id

Posts data to BellaDati using the form with the specified ID (read how to create form 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. The format of date or time value depends on your domain/user settings.

{
  "rN5hVdAXBJ" : "John",
  "wo35CMzcGV" : "Doe",
  "N9zpsXG4WI" : "2015-01-22",
  "mw0qjAfe66" : "15:33:44.123",
  "WSyh9tSkut" : true,
  "mNdZBe1rMY" : 1000
}

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\",\"wo35CMzcGV\":\"Doe\",\"N9zpsXG4WI\":\"2015-01-22\",\"mw0qjAfe66\":\"15:33:44.123\",\"WSyh9tSkut\":true,\"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