Get data
Access data for a widget/dataset defined in Knowi. This supports cached query results and direct query. The query identifier or widget/dataset entityName is used to determine with data to pull. Only one is needed.
GET /api/1.0/datasets
Parameter | Type | Comments |
---|---|---|
entityName | String | Name of the dataset/widget to load data. Example: Regional Sales |
identifier | String | The query identifier to load data. Example: 78SDD2 To obtain:
|
c9SqlFilter | String | (Optional) SQL like Filter to manipulate the data returned. See #Cloud9QL documentation for supported functions. Example: select * where salesDate > $c9_today |
exportFormat | String | (Optional) Data format to return. Options are (json, csv). Defaults to json if blank. |
optimized | Boolean | (Optional) If True , outputs as 'json' compressed with GZIP. Defaults to False |
limit | integer | (Optional) Number of records to return |
runtimeTokens | Array of JSON | (Optional) Passing runtime tokens for direct queries e.g. `$c9_fieldName1=value1` . Should be urlencoded json of tokens. Example of json:
[{"parameterName":"$c9_hitsParam$", "parameterValue":3}, {...}]Urlencoded: %5B%7B%22parameterName%22%3A%22%24c9_hitsParam%24%22%2C%20%22parameterValue%22%3A3%7D%5D |
Response
HTTP Status | Response |
---|---|
200 OK | Output example:
[ {"name":"shop1","visitors":25}, {"name":"shop2","visitors":103} ] |
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
Example
curl -i 'https://www.knowi.com/api/1.0/datasets?entityName=sample&runtimeTokens=%5B%7B%22parameterName%22%3A%22%24c9_hitsParam%24%22%2C%20%22parameterValue%22%3A3%7D%5D' -H 'Authorization: Bearer BYuv76PlV116egWnN0RiidqBk7qFTFdc3FSpe7Fwc6D8ie'