Chilkat Online Tools

Unicode C++ / Cognite API v1 / Synthetic query

Back to Collection Items

void ChilkatSample(void)
    {
    json.UpdateString(L"items[0].expression",L"minim sunt");    json.UpdateInt(L"items[0].start",0);    json.UpdateString(L"items[0].end",L"now");    json.UpdateInt(L"items[0].limit",262);    json.UpdateString(L"items[1].expression",L"et ut fugiat");    json.UpdateInt(L"items[1].start",0);    json.UpdateString(L"items[1].end",L"now");    json.UpdateInt(L"items[1].limit",6657);
    }

Curl Command

curl -X POST
	-H "api-key: {{api-key}}"
	-H "content-type: application/json"
	-d '{
    "items": [
        {
            "expression": "minim sunt",
            "start": 0,
            "end": "now",
            "limit": 262
        },
        {
            "expression": "et ut fugiat",
            "start": 0,
            "end": "now",
            "limit": 6657
        }
    ]
}'
https://domain.com/api/v1/projects/{{project}}/timeseries/synthetic/query

Postman Collection Item JSON

{
  "id": "querySyntheticTimeseries",
  "name": "Synthetic query",
  "request": {
    "url": {
      "host": "{{baseUrl}}",
      "path": [
        "api",
        "v1",
        "projects",
        "{{project}}",
        "timeseries",
        "synthetic",
        "query"
      ],
      "query": [
      ],
      "variable": [
      ]
    },
    "method": "POST",
    "header": [
      {
        "key": "api-key",
        "value": "{{api-key}}",
        "description": "An admin can create API keys in the Cognite console."
      },
      {
        "key": "content-type",
        "value": "application/json"
      }
    ],
    "description": "Execute an on-the-fly synthetic query",
    "body": {
      "mode": "raw",
      "raw": "{\n    \"items\": [\n        {\n            \"expression\": \"minim sunt\",\n            \"start\": 0,\n            \"end\": \"now\",\n            \"limit\": 262\n        },\n        {\n            \"expression\": \"et ut fugiat\",\n            \"start\": 0,\n            \"end\": \"now\",\n            \"limit\": 6657\n        }\n    ]\n}"
    }
  }
}