Chilkat Online Tools

Delphi (DLL) / Datadog API Collection / Query timeseries points

Back to Collection Items

var

begin
CkJsonObject_UpdateInt(queryParams,'from',-62147425);CkJsonObject_UpdateInt(queryParams,'to',-62147425);CkJsonObject_UpdateString(queryParams,'query','tempor Ut sed velit');CkHttpResponse_GetBodySb(resp,sbResponseBody);CkJsonObject_LoadSb(jResp,sbResponseBody);CkJsonObject_putEmitCompact(jResp,False);CkJsonObject_putI(jResp,i);strVal := CkJsonObject__stringOf(jResp,'group_by[i]');i := i + 1;i := 0;count_i := CkJsonObject_SizeOfArray(jResp,'series');CkJsonObject_putI(jResp,i);aggr := CkJsonObject__stringOf(jResp,'series[i].aggr');display_name := CkJsonObject__stringOf(jResp,'series[i].display_name');v_end := CkJsonObject_IntOf(jResp,'series[i].end');expression := CkJsonObject__stringOf(jResp,'series[i].expression');interval := CkJsonObject_IntOf(jResp,'series[i].interval');length := CkJsonObject_IntOf(jResp,'series[i].length');metric := CkJsonObject__stringOf(jResp,'series[i].metric');query_index := CkJsonObject_IntOf(jResp,'series[i].query_index');scope := CkJsonObject__stringOf(jResp,'series[i].scope');start := CkJsonObject_IntOf(jResp,'series[i].start');j := 0;count_j := CkJsonObject_SizeOfArray(jResp,'series[i].pointlist');CkJsonObject_putJ(jResp,j);k := 0;count_k := CkJsonObject_SizeOfArray(jResp,'series[i].pointlist[j]');CkJsonObject_putK(jResp,k);intVal := CkJsonObject_IntOf(jResp,'series[i].pointlist[j][k]');k := k + 1;j := j + 1;j := 0;count_j := CkJsonObject_SizeOfArray(jResp,'series[i].tag_set');CkJsonObject_putJ(jResp,j);strVal := CkJsonObject__stringOf(jResp,'series[i].tag_set[j]');j := j + 1;j := 0;count_j := CkJsonObject_SizeOfArray(jResp,'series[i].unit');CkJsonObject_putJ(jResp,j);family := CkJsonObject__stringOf(jResp,'series[i].unit[j].family');name := CkJsonObject__stringOf(jResp,'series[i].unit[j].name');plural := CkJsonObject__stringOf(jResp,'series[i].unit[j].plural');scale_factor := CkJsonObject_IntOf(jResp,'series[i].unit[j].scale_factor');short_name := CkJsonObject__stringOf(jResp,'series[i].unit[j].short_name');j := j + 1;i := i + 1;


Curl Command

curl -G -d "from=-62147425"
	-d "to=-62147425"
	-d "query=tempor%20Ut%20sed%20velit"
	-H "Accept: application/json"
https://api.app.ddog-gov.com/api/v1/query

Postman Collection Item JSON

{
  "name": "Query timeseries points",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/api/v1/query?from=-62147425&to=-62147425&query=tempor Ut sed velit",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v1",
        "query"
      ],
      "query": [
        {
          "key": "from",
          "value": "-62147425",
          "description": "(Required) Start of the queried time period, seconds since the Unix epoch."
        },
        {
          "key": "to",
          "value": "-62147425",
          "description": "(Required) End of the queried time period, seconds since the Unix epoch."
        },
        {
          "key": "query",
          "value": "tempor Ut sed velit",
          "description": "(Required) Query string."
        }
      ]
    },
    "description": "Query timeseries points."
  },
  "response": [
    {
      "name": "OK",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v1/query?from=-62147425&to=-62147425&query=tempor Ut sed velit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "query"
          ],
          "query": [
            {
              "key": "from",
              "value": "-62147425",
              "description": "(Required) Start of the queried time period, seconds since the Unix epoch."
            },
            {
              "key": "to",
              "value": "-62147425",
              "description": "(Required) End of the queried time period, seconds since the Unix epoch."
            },
            {
              "key": "query",
              "value": "tempor Ut sed velit",
              "description": "(Required) Query string."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"error\": \"officia dolor dolor enim Ut\",\n  \"from_date\": 74851718,\n  \"group_by\": [\n    \"Ut sint veniam voluptate id\",\n    \"laborum dolore fugiat quis\"\n  ],\n  \"message\": \"commodo Duis dolore\",\n  \"query\": \"irure nulla\",\n  \"res_type\": \"time_series\",\n  \"series\": [\n    {\n      \"aggr\": \"avg\",\n      \"display_name\": \"system.cpu.idle\",\n      \"end\": 40693612,\n      \"expression\": \"system.cpu.idle{host:foo,env:test}\",\n      \"interval\": 40405386,\n      \"length\": -62156772,\n      \"metric\": \"system.cpu.idle\",\n      \"pointlist\": [\n        [\n          1681683300000,\n          77.62145685254418\n        ]\n      ],\n      \"query_index\": -41586801,\n      \"scope\": \"host:foo,env:test\",\n      \"start\": -45245073,\n      \"tag_set\": [\n        \"aute incididunt enim\",\n        \"dolore mollit amet esse\"\n      ],\n      \"unit\": [\n        {\n          \"family\": \"time\",\n          \"name\": \"minute\",\n          \"plural\": \"minutes\",\n          \"scale_factor\": 60,\n          \"short_name\": \"min\"\n        },\n        {\n          \"family\": \"time\",\n          \"name\": \"minute\",\n          \"plural\": \"minutes\",\n          \"scale_factor\": 60,\n          \"short_name\": \"min\"\n        }\n      ]\n    },\n    {\n      \"aggr\": \"avg\",\n      \"display_name\": \"system.cpu.idle\",\n      \"end\": -49813044,\n      \"expression\": \"system.cpu.idle{host:foo,env:test}\",\n      \"interval\": -86046844,\n      \"length\": 71311767,\n      \"metric\": \"system.cpu.idle\",\n      \"pointlist\": [\n        [\n          1681683300000,\n          77.62145685254418\n        ]\n      ],\n      \"query_index\": -70553970,\n      \"scope\": \"host:foo,env:test\",\n      \"start\": 3842833,\n      \"tag_set\": [\n        \"sit enim consectetur\",\n        \"Duis\"\n      ],\n      \"unit\": [\n        {\n          \"family\": \"time\",\n          \"name\": \"minute\",\n          \"plural\": \"minutes\",\n          \"scale_factor\": 60,\n          \"short_name\": \"min\"\n        },\n        {\n          \"family\": \"time\",\n          \"name\": \"minute\",\n          \"plural\": \"minutes\",\n          \"scale_factor\": 60,\n          \"short_name\": \"min\"\n        }\n      ]\n    }\n  ],\n  \"status\": \"ok\",\n  \"to_date\": 39411541\n}"
    },
    {
      "name": "Bad Request",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v1/query?from=-62147425&to=-62147425&query=tempor Ut sed velit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "query"
          ],
          "query": [
            {
              "key": "from",
              "value": "-62147425",
              "description": "(Required) Start of the queried time period, seconds since the Unix epoch."
            },
            {
              "key": "to",
              "value": "-62147425",
              "description": "(Required) End of the queried time period, seconds since the Unix epoch."
            },
            {
              "key": "query",
              "value": "tempor Ut sed velit",
              "description": "(Required) Query string."
            }
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"Bad Request\",\n    \"Bad Request\"\n  ]\n}"
    },
    {
      "name": "Forbidden",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v1/query?from=-62147425&to=-62147425&query=tempor Ut sed velit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "query"
          ],
          "query": [
            {
              "key": "from",
              "value": "-62147425",
              "description": "(Required) Start of the queried time period, seconds since the Unix epoch."
            },
            {
              "key": "to",
              "value": "-62147425",
              "description": "(Required) End of the queried time period, seconds since the Unix epoch."
            },
            {
              "key": "query",
              "value": "tempor Ut sed velit",
              "description": "(Required) Query string."
            }
          ]
        }
      },
      "status": "Forbidden",
      "code": 403,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"Bad Request\",\n    \"Bad Request\"\n  ]\n}"
    },
    {
      "name": "Too many requests",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v1/query?from=-62147425&to=-62147425&query=tempor Ut sed velit",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "query"
          ],
          "query": [
            {
              "key": "from",
              "value": "-62147425",
              "description": "(Required) Start of the queried time period, seconds since the Unix epoch."
            },
            {
              "key": "to",
              "value": "-62147425",
              "description": "(Required) End of the queried time period, seconds since the Unix epoch."
            },
            {
              "key": "query",
              "value": "tempor Ut sed velit",
              "description": "(Required) Query string."
            }
          ]
        }
      },
      "status": "Too Many Requests",
      "code": 429,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"Bad Request\",\n    \"Bad Request\"\n  ]\n}"
    }
  ]
}