Page tree
Skip to end of metadata
Go to start of metadata

/api/dataSets/:id/replace

Deletes data based on a filter and then updates existing row or inserts new row in data set specified by ID.

Resource Information

Resource URL

https://service.belladati.com/api/dataSets/:id/replace

HTTP Method

POST

Consumesapplication/json

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

dataRows

One data row in JSON format with following definition:

NameDescription
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.

[{
  "L_COUNTRY""Great Britain",
  "M_REVENUE": "1234.5678"
}]

filter

Filter used to delete data.

Prefix (PT) can be used when join contains columns with the same names.

See the complete list of Filter operation types.

conditionType (optional) is used to define condition operator between conditions. Available values:

  • AND (default)
  • OR

Searching part of String: use '%' wildcard to search selected String in data set values. E.g. "value": "%al%"

{"drilldown":{"L_COUNTRY":{"op":"EQ","value":"USA"}}}


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\", Content-Type=\"application/json\"" -d "{dataRows:[\"L_COUNTRY\":\"Great Britain\",\"M_REVENUE\":\"1234.5678\"}],filter:{\"drilldown\":{\"L_COUNTRY\":{\"op\":\"EQ\",\"value\":\"USA\"}}}}" https://service.belladati.com/api/dataSets/123/replace

When data has been deleted and new rows added successfully, the response has the HTTP status code 200 and the content "OK".


  • No labels