Versions Compared

Key

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

/api/import/forms/:id

Loads data import form specified by ID.

Resource Information

Request Parameters

Parameters

Detail

Example

id

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

123

Response Structure

Code Block
javascript
javascript
{
      "id": 123,
      "name": "My Data Collecting Form",
      "recordTimestamp": false,
      "tags": [
        "my tag 123456",
        "my another tag"
      ],
      "elements": [
        {
          "id": "mNdZBe1rMY",
          "name": "Field",
          "type": "username"
        }
	  ]
}

Name

Description

id

Import form identifier.

name

Name of import form.

recordTimestampBoolean flag indicating if timestamp should be recorded.
tagsArray of string tags.
elements

Array of form elements - fields.

NameDescription
idElement identifier.
nameElement name - title displayed next to field.
type

Element type - please see list of supported values.

mapToDateColumnOnly if "type" has value "datefield". Flag if value should be mapped to date column.
items

Only if "type" has value "select". Array of options in select box.

NameDescription
nameOption value displayed in select box


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\"" https://service.belladati.com/api/import/forms/123

The JSON format response:

Code Block
javascript
javascript
  	{
      "id": 123,
      "name": "My Data Collecting Form",
      "recordTimestamp": false,
      "tags": [
        "my tag 123456",
        "my another tag"
      ],
      "elements": [
        {
          "id": "mNdZBe1rMY",
          "name": "Username",
          "type": "username"
        },
        {
          "id": "wo35CMzcGV",
          "name": "Country",
          "type": "textfield"
        },
        {,
          "id": "N9zpsXG4WI",
          "name": "Birth Date",
          "type": "datefield",
          "mapToDateColumn": true
        },
        {
          "id": "ZdXAW61ko5",
          "name": "Gender",
          "type": "select",
          "items": [
            {"name": "Male"},
            {"name": "Female"},
            {"name": "Other"}
          ]
        },
        {
          "name": "Are you smiling right now?",
          "id": "WSyh9tSkut",
          "type": "checkbox"
        },
        {
          "name": "Timestamp Value",
          "id": "mw0qjAfe66",
          "type": "timestamp"
        }
      ]
    }
Sv translation
languageja

/api/import/forms/:id

IDで指定さからインポートデータをロードする。

リソース情報

リクエストパラメータ

パラメーター

詳細

id

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

123

レスポンスの構造

Code Block
javascript
javascript
{
      "id": 123,
      "name": "My Data Collecting Form",
      "recordTimestamp": false,
      "elements": [
        {
          "id": "mNdZBe1rMY",
          "name": "Field",
          "type": "username"
        }
	  ]
}


説明

id

インポートフォーム識別子

name

インポートフォーム名

recordTimestampBoolean フラグはタイムスタンプが記録されるかどうかを示します
elements

フォーム要素の配列 - フィールド

説明
id要素識別子
name要素名 - タイトルはフィールドの横に表示されます
type

要素タイプ - サポートされている値のリストをご参照してください。

mapToDateColumntype」は値「日付フィールド」を持っている場合のみ。フラグは、値が日付カラムにマッピングする必要があります。
items

type」は値「select」を持っている場合のみ。選択ボックスのオプションの配列です。

説明
nameオプション値は、選択ボックスに表示されます



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

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\"" https://service.belladati.com/api/import/forms/123

JSON形式のレスポンス:

Code Block
javascript
javascript
  	{
      "id": 123,
      "name": "My Data Collecting Form",
      "recordTimestamp": false,
      "elements": [
        {
          "id": "mNdZBe1rMY",
          "name": "Username",
          "type": "username"
        },
        {
          "id": "wo35CMzcGV",
          "name": "Country",
          "type": "textfield"
        },
        {,
          "id": "N9zpsXG4WI",
          "name": "Birth Date",
          "type": "datefield",
          "mapToDateColumn": true
        },
        {
          "id": "ZdXAW61ko5",
          "name": "Gender",
          "type": "select",
          "items": [
            {"name": "Male"},
            {"name": "Female"},
            {"name": "Other"}
          ]
        },
        {
          "name": "Are you smiling right now?",
          "id": "WSyh9tSkut",
          "type": "checkbox"
        },
        {
          "name": "Timestamp Value",
          "id": "mw0qjAfe66",
          "type": "timestamp"
        }
      ]
    }