Chilkat Online Tools

SQL Server / Datadog API Collection / Query timeseries data across multiple products

Back to Collection Items

-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    DECLARE @iTmp0 int
    -- Important: Do not use nvarchar(max).  See the warning about using nvarchar(max).
    DECLARE @sTmp0 nvarchar(4000)
    -- This example assumes the Chilkat API to have been previously unlocked.
    -- See Global Unlock Sample for sample code.

    DECLARE @http int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Http', @http OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @success int

    -- Use this online tool to generate code from sample JSON: Generate Code to Create JSON

    -- The following JSON is sent in the request body.

    -- {
    --   "data": {
    --     "type": "timeseries_request",
    --     "attributes": {
    --       "to": "<long>",
    --       "from": "<long>",
    --       "queries": [
    --         {
    --           "data_source": "metrics",
    --           "query": "<string>",
    --           "name": "<string>"
    --         },
    --         {
    --           "data_source": "metrics",
    --           "query": "<string>",
    --           "name": "<string>"
    --         }
    --       ],
    --       "formulas": [
    --         {
    --           "formula": "<string>",
    --           "limit": {
    --             "count": "<integer>",
    --             "order": "desc"
    --           }
    --         },
    --         {
    --           "formula": "<string>",
    --           "limit": {
    --             "count": "<integer>",
    --             "order": "desc"
    --           }
    --         }
    --       ],
    --       "interval": "<long>"
    --     }
    --   }
    -- }

    DECLARE @json int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.JsonObject', @json OUT

    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.type', 'timeseries_request'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.attributes.to', '<long>'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.attributes.from', '<long>'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.attributes.queries[0].data_source', 'metrics'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.attributes.queries[0].query', '<string>'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.attributes.queries[0].name', '<string>'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.attributes.queries[1].data_source', 'metrics'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.attributes.queries[1].query', '<string>'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.attributes.queries[1].name', '<string>'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.attributes.formulas[0].formula', '<string>'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.attributes.formulas[0].limit.count', '<integer>'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.attributes.formulas[0].limit.order', 'desc'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.attributes.formulas[1].formula', '<string>'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.attributes.formulas[1].limit.count', '<integer>'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.attributes.formulas[1].limit.order', 'desc'
    EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'data.attributes.interval', '<long>'

    EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Content-Type', 'application/json'
    EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Accept', 'application/json'

    DECLARE @resp int
    EXEC sp_OAMethod @http, 'PostJson3', @resp OUT, 'https://api.app.ddog-gov.com/api/v2/query/timeseries', 'application/json', @json
    EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT
    IF @iTmp0 = 0
      BEGIN
        EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
        PRINT @sTmp0
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @json
        RETURN
      END

    DECLARE @sbResponseBody int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.StringBuilder', @sbResponseBody OUT

    EXEC sp_OAMethod @resp, 'GetBodySb', @success OUT, @sbResponseBody

    DECLARE @jResp int
    EXEC @hr = sp_OACreate 'Chilkat_9_5_0.JsonObject', @jResp OUT

    EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody
    EXEC sp_OASetProperty @jResp, 'EmitCompact', 0


    PRINT 'Response Body:'
    EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT
    PRINT @sTmp0

    DECLARE @respStatusCode int
    EXEC sp_OAGetProperty @resp, 'StatusCode', @respStatusCode OUT

    PRINT 'Response Status Code = ' + @respStatusCode
    IF @respStatusCode >= 400
      BEGIN

        PRINT 'Response Header:'
        EXEC sp_OAGetProperty @resp, 'Header', @sTmp0 OUT
        PRINT @sTmp0

        PRINT 'Failed.'
        EXEC @hr = sp_OADestroy @resp

        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @json
        EXEC @hr = sp_OADestroy @sbResponseBody
        EXEC @hr = sp_OADestroy @jResp
        RETURN
      END
    EXEC @hr = sp_OADestroy @resp

    -- Sample JSON response:
    -- (Sample code for parsing the JSON response is shown below)

    -- {
    --   "data": {
    --     "attributes": {
    --       "series": [
    --         {
    --           "group_tags": [
    --             "<string>",
    --             "<string>"
    --           ],
    --           "query_index": "<integer>",
    --           "unit": [
    --             {
    --               "family": "<string>",
    --               "name": "<string>",
    --               "plural": "<string>",
    --               "scale_factor": "<double>",
    --               "short_name": "<string>"
    --             },
    --             {
    --               "family": "<string>",
    --               "name": "<string>",
    --               "plural": "<string>",
    --               "scale_factor": "<double>",
    --               "short_name": "<string>"
    --             }
    --           ]
    --         },
    --         {
    --           "group_tags": [
    --             "<string>",
    --             "<string>"
    --           ],
    --           "query_index": "<integer>",
    --           "unit": [
    --             {
    --               "family": "<string>",
    --               "name": "<string>",
    --               "plural": "<string>",
    --               "scale_factor": "<double>",
    --               "short_name": "<string>"
    --             },
    --             {
    --               "family": "<string>",
    --               "name": "<string>",
    --               "plural": "<string>",
    --               "scale_factor": "<double>",
    --               "short_name": "<string>"
    --             }
    --           ]
    --         }
    --       ],
    --       "times": [
    --         "<long>",
    --         "<long>"
    --       ],
    --       "values": [
    --         [
    --           "<double>",
    --           "<double>"
    --         ],
    --         [
    --           "<double>",
    --           "<double>"
    --         ]
    --       ]
    --     },
    --     "type": "timeseries_response"
    --   },
    --   "errors": "<string>"
    -- }

    -- Sample code for parsing the JSON response...
    -- Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

    DECLARE @query_index nvarchar(4000)

    DECLARE @j int

    DECLARE @count_j int

    DECLARE @strVal nvarchar(4000)

    DECLARE @family nvarchar(4000)

    DECLARE @name nvarchar(4000)

    DECLARE @plural nvarchar(4000)

    DECLARE @scale_factor nvarchar(4000)

    DECLARE @short_name nvarchar(4000)

    DECLARE @v_Type nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @v_Type OUT, 'data.type'
    DECLARE @errors nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @errors OUT, 'errors'
    DECLARE @i int
    SELECT @i = 0
    DECLARE @count_i int
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'data.attributes.series'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @query_index OUT, 'data.attributes.series[i].query_index'
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'data.attributes.series[i].group_tags'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'data.attributes.series[i].group_tags[j]'
            SELECT @j = @j + 1
          END
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'data.attributes.series[i].unit'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            EXEC sp_OAMethod @jResp, 'StringOf', @family OUT, 'data.attributes.series[i].unit[j].family'
            EXEC sp_OAMethod @jResp, 'StringOf', @name OUT, 'data.attributes.series[i].unit[j].name'
            EXEC sp_OAMethod @jResp, 'StringOf', @plural OUT, 'data.attributes.series[i].unit[j].plural'
            EXEC sp_OAMethod @jResp, 'StringOf', @scale_factor OUT, 'data.attributes.series[i].unit[j].scale_factor'
            EXEC sp_OAMethod @jResp, 'StringOf', @short_name OUT, 'data.attributes.series[i].unit[j].short_name'
            SELECT @j = @j + 1
          END
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'data.attributes.times'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'data.attributes.times[i]'
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'data.attributes.values'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        SELECT @j = 0
        EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_j OUT, 'data.attributes.values[i]'
        WHILE @j < @count_j
          BEGIN
            EXEC sp_OASetProperty @jResp, 'J', @j
            EXEC sp_OAMethod @jResp, 'StringOf', @strVal OUT, 'data.attributes.values[i][j]'
            SELECT @j = @j + 1
          END
        SELECT @i = @i + 1
      END

    EXEC @hr = sp_OADestroy @http
    EXEC @hr = sp_OADestroy @json
    EXEC @hr = sp_OADestroy @sbResponseBody
    EXEC @hr = sp_OADestroy @jResp


END
GO

Curl Command

curl -X POST
	-H "Content-Type: application/json"
	-H "Accept: application/json"
	-d '{
  "data": {
    "type": "timeseries_request",
    "attributes": {
      "to": "<long>",
      "from": "<long>",
      "queries": [
        {
          "data_source": "metrics",
          "query": "<string>",
          "name": "<string>"
        },
        {
          "data_source": "metrics",
          "query": "<string>",
          "name": "<string>"
        }
      ],
      "formulas": [
        {
          "formula": "<string>",
          "limit": {
            "count": "<integer>",
            "order": "desc"
          }
        },
        {
          "formula": "<string>",
          "limit": {
            "count": "<integer>",
            "order": "desc"
          }
        }
      ],
      "interval": "<long>"
    }
  }
}'
https://api.app.ddog-gov.com/api/v2/query/timeseries

Postman Collection Item JSON

{
  "name": "Query timeseries data across multiple products",
  "request": {
    "method": "POST",
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n  \"data\": {\n    \"type\": \"timeseries_request\",\n    \"attributes\": {\n      \"to\": \"<long>\",\n      \"from\": \"<long>\",\n      \"queries\": [\n        {\n          \"data_source\": \"metrics\",\n          \"query\": \"<string>\",\n          \"name\": \"<string>\"\n        },\n        {\n          \"data_source\": \"metrics\",\n          \"query\": \"<string>\",\n          \"name\": \"<string>\"\n        }\n      ],\n      \"formulas\": [\n        {\n          \"formula\": \"<string>\",\n          \"limit\": {\n            \"count\": \"<integer>\",\n            \"order\": \"desc\"\n          }\n        },\n        {\n          \"formula\": \"<string>\",\n          \"limit\": {\n            \"count\": \"<integer>\",\n            \"order\": \"desc\"\n          }\n        }\n      ],\n      \"interval\": \"<long>\"\n    }\n  }\n}",
      "options": {
        "raw": {
          "headerFamily": "json",
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{baseUrl}}/api/v2/query/timeseries",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v2",
        "query",
        "timeseries"
      ]
    },
    "description": "Query timeseries data across various data sources and\nprocess the data by applying formulas and functions."
  },
  "response": [
    {
      "name": "OK",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"data\": {\n    \"type\": \"timeseries_request\",\n    \"attributes\": {\n      \"to\": \"<long>\",\n      \"from\": \"<long>\",\n      \"queries\": [\n        {\n          \"data_source\": \"metrics\",\n          \"query\": \"<string>\",\n          \"name\": \"<string>\"\n        },\n        {\n          \"data_source\": \"metrics\",\n          \"query\": \"<string>\",\n          \"name\": \"<string>\"\n        }\n      ],\n      \"formulas\": [\n        {\n          \"formula\": \"<string>\",\n          \"limit\": {\n            \"count\": \"<integer>\",\n            \"order\": \"desc\"\n          }\n        },\n        {\n          \"formula\": \"<string>\",\n          \"limit\": {\n            \"count\": \"<integer>\",\n            \"order\": \"desc\"\n          }\n        }\n      ],\n      \"interval\": \"<long>\"\n    }\n  }\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v2/query/timeseries",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "query",
            "timeseries"
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"data\": {\n    \"attributes\": {\n      \"series\": [\n        {\n          \"group_tags\": [\n            \"<string>\",\n            \"<string>\"\n          ],\n          \"query_index\": \"<integer>\",\n          \"unit\": [\n            {\n              \"family\": \"<string>\",\n              \"name\": \"<string>\",\n              \"plural\": \"<string>\",\n              \"scale_factor\": \"<double>\",\n              \"short_name\": \"<string>\"\n            },\n            {\n              \"family\": \"<string>\",\n              \"name\": \"<string>\",\n              \"plural\": \"<string>\",\n              \"scale_factor\": \"<double>\",\n              \"short_name\": \"<string>\"\n            }\n          ]\n        },\n        {\n          \"group_tags\": [\n            \"<string>\",\n            \"<string>\"\n          ],\n          \"query_index\": \"<integer>\",\n          \"unit\": [\n            {\n              \"family\": \"<string>\",\n              \"name\": \"<string>\",\n              \"plural\": \"<string>\",\n              \"scale_factor\": \"<double>\",\n              \"short_name\": \"<string>\"\n            },\n            {\n              \"family\": \"<string>\",\n              \"name\": \"<string>\",\n              \"plural\": \"<string>\",\n              \"scale_factor\": \"<double>\",\n              \"short_name\": \"<string>\"\n            }\n          ]\n        }\n      ],\n      \"times\": [\n        \"<long>\",\n        \"<long>\"\n      ],\n      \"values\": [\n        [\n          \"<double>\",\n          \"<double>\"\n        ],\n        [\n          \"<double>\",\n          \"<double>\"\n        ]\n      ]\n    },\n    \"type\": \"timeseries_response\"\n  },\n  \"errors\": \"<string>\"\n}"
    },
    {
      "name": "Bad Request",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"data\": {\n    \"type\": \"timeseries_request\",\n    \"attributes\": {\n      \"to\": \"<long>\",\n      \"from\": \"<long>\",\n      \"queries\": [\n        {\n          \"data_source\": \"metrics\",\n          \"query\": \"<string>\",\n          \"name\": \"<string>\"\n        },\n        {\n          \"data_source\": \"metrics\",\n          \"query\": \"<string>\",\n          \"name\": \"<string>\"\n        }\n      ],\n      \"formulas\": [\n        {\n          \"formula\": \"<string>\",\n          \"limit\": {\n            \"count\": \"<integer>\",\n            \"order\": \"desc\"\n          }\n        },\n        {\n          \"formula\": \"<string>\",\n          \"limit\": {\n            \"count\": \"<integer>\",\n            \"order\": \"desc\"\n          }\n        }\n      ],\n      \"interval\": \"<long>\"\n    }\n  }\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v2/query/timeseries",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "query",
            "timeseries"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"<string>\",\n    \"<string>\"\n  ]\n}"
    },
    {
      "name": "Unauthorized",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"data\": {\n    \"type\": \"timeseries_request\",\n    \"attributes\": {\n      \"to\": \"<long>\",\n      \"from\": \"<long>\",\n      \"queries\": [\n        {\n          \"data_source\": \"metrics\",\n          \"query\": \"<string>\",\n          \"name\": \"<string>\"\n        },\n        {\n          \"data_source\": \"metrics\",\n          \"query\": \"<string>\",\n          \"name\": \"<string>\"\n        }\n      ],\n      \"formulas\": [\n        {\n          \"formula\": \"<string>\",\n          \"limit\": {\n            \"count\": \"<integer>\",\n            \"order\": \"desc\"\n          }\n        },\n        {\n          \"formula\": \"<string>\",\n          \"limit\": {\n            \"count\": \"<integer>\",\n            \"order\": \"desc\"\n          }\n        }\n      ],\n      \"interval\": \"<long>\"\n    }\n  }\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v2/query/timeseries",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "query",
            "timeseries"
          ]
        }
      },
      "status": "Unauthorized",
      "code": 401,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"<string>\",\n    \"<string>\"\n  ]\n}"
    },
    {
      "name": "Forbidden",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"data\": {\n    \"type\": \"timeseries_request\",\n    \"attributes\": {\n      \"to\": \"<long>\",\n      \"from\": \"<long>\",\n      \"queries\": [\n        {\n          \"data_source\": \"metrics\",\n          \"query\": \"<string>\",\n          \"name\": \"<string>\"\n        },\n        {\n          \"data_source\": \"metrics\",\n          \"query\": \"<string>\",\n          \"name\": \"<string>\"\n        }\n      ],\n      \"formulas\": [\n        {\n          \"formula\": \"<string>\",\n          \"limit\": {\n            \"count\": \"<integer>\",\n            \"order\": \"desc\"\n          }\n        },\n        {\n          \"formula\": \"<string>\",\n          \"limit\": {\n            \"count\": \"<integer>\",\n            \"order\": \"desc\"\n          }\n        }\n      ],\n      \"interval\": \"<long>\"\n    }\n  }\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v2/query/timeseries",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "query",
            "timeseries"
          ]
        }
      },
      "status": "Forbidden",
      "code": 403,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"<string>\",\n    \"<string>\"\n  ]\n}"
    },
    {
      "name": "Too many requests",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"data\": {\n    \"type\": \"timeseries_request\",\n    \"attributes\": {\n      \"to\": \"<long>\",\n      \"from\": \"<long>\",\n      \"queries\": [\n        {\n          \"data_source\": \"metrics\",\n          \"query\": \"<string>\",\n          \"name\": \"<string>\"\n        },\n        {\n          \"data_source\": \"metrics\",\n          \"query\": \"<string>\",\n          \"name\": \"<string>\"\n        }\n      ],\n      \"formulas\": [\n        {\n          \"formula\": \"<string>\",\n          \"limit\": {\n            \"count\": \"<integer>\",\n            \"order\": \"desc\"\n          }\n        },\n        {\n          \"formula\": \"<string>\",\n          \"limit\": {\n            \"count\": \"<integer>\",\n            \"order\": \"desc\"\n          }\n        }\n      ],\n      \"interval\": \"<long>\"\n    }\n  }\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v2/query/timeseries",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "query",
            "timeseries"
          ]
        }
      },
      "status": "Too Many Requests",
      "code": 429,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"errors\": [\n    \"<string>\",\n    \"<string>\"\n  ]\n}"
    }
  ]
}