Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

/api/import/forms/:id

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

Tip

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.

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

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:

Code Block
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.

Sv translation
languageja

/api/import/forms/:id

指定されたIDを持つフォームを使用してBellaDatiへデータを投稿します(ここではフォームを作成し、収集モジュールデータ方法を読む)

Tip

このエンドポイントは、単一のデータ・レコード(レコードバイレコード)を収集するように設計されています。一括インポートのために代わりにPOST JSONデータエンドポイントを使用します。

リソース情報

リクエストパラメータ

パラメーター

詳細

id

記入するためのフォームのID。/api/import/formsにレスポンスにIDを見つけることができます。

123

data

JSON形式で適用するためフォームのコンテンツ。フィールドごとに、キーが指定された値として保存するフォーム要素のIDです。

データを保存する前に/api/import/forms GET REST API requestを呼び出すことで要素のID(例要素のIDでJohn値はrN5hVdAXBJ)を取得する必要があります


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



Tip

アプリケーションが非常に頻繁に小さなデータを送信している場合。using /api/import/:id/api/import/forms/:id使用する必要があります。

典型的なビジネス場合は、秒ごとにデータを送信するIoTセンサーです。また、アプリケーションに各REST API呼び出しの間に少なくとも3秒のバッファを与えることをお勧めします

サンプルリクエスト/レスポンス

curl使用

Code Block
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

フォームが正常に送信された場合、サーバは200のHTTPステータスコードと空の本文で応答します。