Versions Compared

Key

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

/api/dataSets/:id/data

Updates existing row or inserts new row in data set.

Resource Information

Request Parameters

Parameters

Detail

Example
id
ID of the data set to modify data in. You can find the ID in the response to /api/dataSets.123

dataRow

One data row in JSON format with following definition:

NameDescription
id(Optional) UID of the data row. You can find the UID in the response to /api/dataSets/:id/data. If not present, new data row will be inserted, otherwise existing row with this UID will be updated.
L_*Attribute value. To keep original value while updating row, don't include attribute name in the request. To set empty value, provide either empty string or null as value.
M_*Indicator value. To keep original value while updating row, don't include indicator name in the request. To set empty value, provide either empty string or null as value.


{
  "id": "456",
  "L_COUNTRY""Great Britain",
  "M_REVENUE": "1234.5678"
}


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 "dataRow={\"id\":\"456\",\"L_COUNTRY\":\"Great Britain\",\"M_REVENUE\":\"1234.5678\"}" https://service.belladati.com/api/dataSets/123/data

When the row has been updated/added successfully, the response has the HTTP status code 200 and the content "OK".


When there is no attribute/indicator value to update or add, the response has the HTTP status code 200 and the content "Nothing to insert".

 


Sv translation
languageja

/api/dataSets/:id/data

Loads dataset data.

Resource Information

Request Parameters

Parameters

Detail

Example
id
ID of the data set to fetch. You can find the ID in the response to /api/dataSets.123

filter

(Optional) Filter used to load data.

{
   "drilldown": {
      "L_COUNTRY_OR_AREA": {
          "op": "EQ",
          "value": "Slovakia"
      },
      "L_TYPE": {
          "op": "IN",
          "values": [ "Type 1", "Type 2", "Type 3" ]
      },
      "L_DATE": {
          "op": "NOT_NULL"
      }
   }
}

offset

(Optional) Specifies the page offset if pagination is necessary.

2

size

(Optional) Specifies the number of entries on each page if pagination is necessary.

15

Response Structure

Code Block
languagejs
{
  "dataSet" : { ... },
  "data" : [ { "UID" : 123456, "L_ATTRIBUTE" : "value", "M_INDICATOR" : 11.99 }, { "UID" : 123457, "L_ATTRIBUTE" : "value2", "M_INDICATOR" : 22.08 } ]
}

JSON response contains 2 elements dataSet that contains detailed information about data set (see GET Data Set Detail) and data which contains array of data rows in following strcuture:

NameDescription
UIDUnique ID of data row.
L_*Attribute values contained in the data row.
M_*Indicator values contained in the data row.

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

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/dataSets/123/data

JSONフォーマットの応答:

Code Block
javascript
javascript
{
  "dataSet" : {
	"id" : 123,
  	"name" : "My test data set",
  	"localization" : {
    "de" : "Deutsch Name"
  },
  "description" : "This is a sample data set.",
  "owner" : "John Smith",
  "lastChange" : "Tue, 22 May 2012 17:16:31 GMT",
  "attributes" : [
    {
      "id" : "123.FO8j1HfdDz",
      "name" : "City",
      "code" : "L_CITY",
      "type" : "String"
    }
  ],
  "indicators" : [
    {
      "id" : "123.8RnLDOwZnY",
      "name" : "Count",
      "type" : "DATA_INDICATOR",
      "code" : "M_COUNT"
    },
    {
      "id" : "123.Jiq7Cuyai1",
      "name" : "Calculated indicator",
      "type" : "FORMULA_INDICATOR",
      "formula" : "M_COUNT * 1000"
    },
    {
      "id" : "123.MrrmQgYyyo",
      "name" : "Indicator group",
      "type" : "INDICATOR_GROUP"
    }
  ],
  "reports" : [
    {
      "id" : 7497,
      "name" : "My Report",
      "description" : "This is a sample report.",
      "owner" : "John Smith",
      "lastChange" : "Mon, 16 Apr 2012 10:17:26 GMT"
    }
  ]
  },
  "data" : [ 
	{ "UID" : 123456, "L_ATTRIBUTE" : "value", "M_INDICATOR" : 11.99 }, 
	{ "UID" : 123457, "L_ATTRIBUTE" : "value2", "M_INDICATOR" : 22.08 } 
  ]
}