Chilkat Online Tools

unicodeC / Datadog API Collection / Search for SLOs

Back to Collection Items

#include <C_CkHttpW.h>
#include <C_CkJsonObjectW.h>
#include <C_CkHttpResponseW.h>
#include <C_CkStringBuilderW.h>

void ChilkatSample(void)
    {
    HCkHttpW http;
    BOOL success;
    HCkJsonObjectW queryParams;
    HCkHttpResponseW resp;
    HCkStringBuilderW sbResponseBody;
    HCkJsonObjectW jResp;
    int respStatusCode;
    int count;
    const wchar_t *name;
    int Created_at;
    const wchar_t *v_Email;
    int Id;
    const wchar_t *Name;
    const wchar_t *Description;
    int Modified_at;
    const wchar_t *AttributesName;
    const wchar_t *Denominator;
    const wchar_t *Numerator;
    const wchar_t *Slo_type;
    const wchar_t *Calculation_error;
    int Error_budget_remaining;
    int Indexed_at;
    const wchar_t *Unit;
    int Value;
    int Sli;
    int Span_precision;
    const wchar_t *State;
    const wchar_t *dataId;
    const wchar_t *dataType;
    int j;
    int count_j;
    const wchar_t *strVal;
    int intVal;
    const wchar_t *error;
    int error_budget_remaining;
    int indexed_at;
    const wchar_t *raw_error_budget_remainingUnit;
    int raw_error_budget_remainingValue;
    int span_precision;
    const wchar_t *state;
    int status;
    int target;
    const wchar_t *timeframe;
    const wchar_t *target_display;
    int warning;
    const wchar_t *warning_display;
    const wchar_t *v_Type;
    const wchar_t *First;
    const wchar_t *Last;
    const wchar_t *v_Next;
    const wchar_t *Prev;
    const wchar_t *v_Self;
    int First_number;
    int Last_number;
    int Next_number;
    int v_Number;
    int Prev_number;
    int Size;
    int Total;
    const wchar_t *PaginationType;
    int i;
    int count_i;

    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    http = CkHttpW_Create();

    queryParams = CkJsonObjectW_Create();
    CkJsonObjectW_UpdateString(queryParams,L"query",L"tempor Ut sed velit");
    CkJsonObjectW_UpdateInt(queryParams,L"page[size]",-62147425);
    CkJsonObjectW_UpdateInt(queryParams,L"page[number]",-62147425);
    CkJsonObjectW_UpdateString(queryParams,L"include_facets",L"true");

    CkHttpW_SetRequestHeader(http,L"Accept",L"application/json");

    resp = CkHttpW_QuickRequestParams(http,L"GET",L"https://api.app.ddog-gov.com/api/v1/slo/search",queryParams);
    if (CkHttpW_getLastMethodSuccess(http) == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(queryParams);
        return;
    }

    sbResponseBody = CkStringBuilderW_Create();
    CkHttpResponseW_GetBodySb(resp,sbResponseBody);

    jResp = CkJsonObjectW_Create();
    CkJsonObjectW_LoadSb(jResp,sbResponseBody);
    CkJsonObjectW_putEmitCompact(jResp,FALSE);

    wprintf(L"Response Body:\n");
    wprintf(L"%s\n",CkJsonObjectW_emit(jResp));

    respStatusCode = CkHttpResponseW_getStatusCode(resp);
    wprintf(L"Response Status Code = %d\n",respStatusCode);
    if (respStatusCode >= 400) {
        wprintf(L"Response Header:\n");
        wprintf(L"%s\n",CkHttpResponseW_header(resp));
        wprintf(L"Failed.\n");
        CkHttpResponseW_Dispose(resp);
        CkHttpW_Dispose(http);
        CkJsonObjectW_Dispose(queryParams);
        CkStringBuilderW_Dispose(sbResponseBody);
        CkJsonObjectW_Dispose(jResp);
        return;
    }

    CkHttpResponseW_Dispose(resp);

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

    // {
    //   "data": {
    //     "attributes": {
    //       "facets": {
    //         "all_tags": [
    //           {
    //             "count": -8530751,
    //             "name": "est cillum id ex"
    //           },
    //           {
    //             "count": 20390494,
    //             "name": "adipisicing minim quis velit dolore"
    //           }
    //         ],
    //         "creator_name": [
    //           {
    //             "count": 77247452,
    //             "name": "cupidatat elit eu id aute"
    //           },
    //           {
    //             "count": -77371710,
    //             "name": "dolore"
    //           }
    //         ],
    //         "env_tags": [
    //           {
    //             "count": -42199690,
    //             "name": "dolor eiusmod"
    //           },
    //           {
    //             "count": -60615528,
    //             "name": "commodo mollit"
    //           }
    //         ],
    //         "service_tags": [
    //           {
    //             "count": 49217615,
    //             "name": "aute cupidatat"
    //           },
    //           {
    //             "count": 77659232,
    //             "name": "est Ut aute"
    //           }
    //         ],
    //         "slo_type": [
    //           {
    //             "count": 55153641,
    //             "name": 41482978.922150195
    //           },
    //           {
    //             "count": 11427450,
    //             "name": 85748817.01266047
    //           }
    //         ],
    //         "target": [
    //           {
    //             "count": 96778717,
    //             "name": -37511597.68983867
    //           },
    //           {
    //             "count": 15549994,
    //             "name": 30406993.57594505
    //           }
    //         ],
    //         "team_tags": [
    //           {
    //             "count": -61109884,
    //             "name": "laborum ex esse proident"
    //           },
    //           {
    //             "count": 68412080,
    //             "name": "nisi qui cillum exercitation"
    //           }
    //         ],
    //         "timeframe": [
    //           {
    //             "count": -21958451,
    //             "name": "fugiat"
    //           },
    //           {
    //             "count": 12824105,
    //             "name": "tempor adipisi"
    //           }
    //         ]
    //       },
    //       "slos": [
    //         {
    //           "data": {
    //             "attributes": {
    //               "all_tags": [
    //                 "env:prod",
    //                 "app:core"
    //               ],
    //               "created_at": 2857983,
    //               "creator": {
    //                 "email": "non Lorem",
    //                 "id": 39288042,
    //                 "name": "voluptate"
    //               },
    //               "description": "fugiat sit in quis",
    //               "env_tags": [
    //                 "irure tempor",
    //                 "laborum reprehenderi"
    //               ],
    //               "groups": [
    //                 "env:prod",
    //                 "role:mysql"
    //               ],
    //               "modified_at": -85796945,
    //               "monitor_ids": [
    //                 99205206,
    //                 23793820
    //               ],
    //               "name": "Custom Metric SLO",
    //               "overall_status": [
    //                 {
    //                   "error": "occaecat dolore",
    //                   "error_budget_remaining": 100,
    //                   "indexed_at": 1662496260,
    //                   "raw_error_budget_remaining": {
    //                     "unit": "requests",
    //                     "value": 60
    //                   },
    //                   "span_precision": 2,
    //                   "state": "ok",
    //                   "status": 100,
    //                   "target": 99,
    //                   "timeframe": "30d"
    //                 },
    //                 {
    //                   "error": "in officia",
    //                   "error_budget_remaining": 100,
    //                   "indexed_at": 1662496260,
    //                   "raw_error_budget_remaining": {
    //                     "unit": "requests",
    //                     "value": 60
    //                   },
    //                   "span_precision": 2,
    //                   "state": "ok",
    //                   "status": 100,
    //                   "target": 99,
    //                   "timeframe": "30d"
    //                 }
    //               ],
    //               "query": {
    //                 "denominator": "sum:my.custom.metric{*}.as_count()",
    //                 "metrics": [
    //                   "my.custom.metric",
    //                   "my.other.custom.metric"
    //                 ],
    //                 "numerator": "sum:my.custom.metric{type:good}.as_count()"
    //               },
    //               "service_tags": [
    //                 "aute amet dolor pariatur mollit",
    //                 "officia"
    //               ],
    //               "slo_type": "metric",
    //               "status": {
    //                 "calculation_error": "qui",
    //                 "error_budget_remaining": 100,
    //                 "indexed_at": 1662496260,
    //                 "raw_error_budget_remaining": {
    //                   "unit": "requests",
    //                   "value": 60
    //                 },
    //                 "sli": 100,
    //                 "span_precision": 2,
    //                 "state": "ok"
    //               },
    //               "team_tags": [
    //                 "quis veniam magna",
    //                 "ad"
    //               ],
    //               "thresholds": [
    //                 {
    //                   "target": 95,
    //                   "target_display": "95",
    //                   "timeframe": "7d"
    //                 },
    //                 {
    //                   "target": 95,
    //                   "target_display": "95",
    //                   "timeframe": "30d",
    //                   "warning": 97,
    //                   "warning_display": "97"
    //                 }
    //               ]
    //             },
    //             "id": "sed fugiat est cillum",
    //             "type": "mollit dolore"
    //           }
    //         },
    //         {
    //           "data": {
    //             "attributes": {
    //               "all_tags": [
    //                 "env:prod",
    //                 "app:core"
    //               ],
    //               "created_at": -97407922,
    //               "creator": {
    //                 "email": "in nulla",
    //                 "id": -4202515,
    //                 "name": "elit et consequat"
    //               },
    //               "description": "dolor sed cupidatat pariatur sint",
    //               "env_tags": [
    //                 "magna ex pariatur dolore sed",
    //                 "velit dolor aute in nostrud"
    //               ],
    //               "groups": [
    //                 "env:prod",
    //                 "role:mysql"
    //               ],
    //               "modified_at": -32142227,
    //               "monitor_ids": [
    //                 83809238,
    //                 -63596037
    //               ],
    //               "name": "Custom Metric SLO",
    //               "overall_status": [
    //                 {
    //                   "error": "reprehenderit cupidat",
    //                   "error_budget_remaining": 100,
    //                   "indexed_at": 1662496260,
    //                   "raw_error_budget_remaining": {
    //                     "unit": "requests",
    //                     "value": 60
    //                   },
    //                   "span_precision": 2,
    //                   "state": "ok",
    //                   "status": 100,
    //                   "target": 99,
    //                   "timeframe": "30d"
    //                 },
    //                 {
    //                   "error": "consequat",
    //                   "error_budget_remaining": 100,
    //                   "indexed_at": 1662496260,
    //                   "raw_error_budget_remaining": {
    //                     "unit": "requests",
    //                     "value": 60
    //                   },
    //                   "span_precision": 2,
    //                   "state": "ok",
    //                   "status": 100,
    //                   "target": 99,
    //                   "timeframe": "30d"
    //                 }
    //               ],
    //               "query": {
    //                 "denominator": "sum:my.custom.metric{*}.as_count()",
    //                 "metrics": [
    //                   "my.custom.metric",
    //                   "my.other.custom.metric"
    //                 ],
    //                 "numerator": "sum:my.custom.metric{type:good}.as_count()"
    //               },
    //               "service_tags": [
    //                 "magna velit",
    //                 "occaecat tempor proident ex ea"
    //               ],
    //               "slo_type": "metric",
    //               "status": {
    //                 "calculation_error": "in occaecat e",
    //                 "error_budget_remaining": 100,
    //                 "indexed_at": 1662496260,
    //                 "raw_error_budget_remaining": {
    //                   "unit": "requests",
    //                   "value": 60
    //                 },
    //                 "sli": 100,
    //                 "span_precision": 2,
    //                 "state": "ok"
    //               },
    //               "team_tags": [
    //                 "Ut nisi ipsum fugiat",
    //                 "exercitation proident consequat aute"
    //               ],
    //               "thresholds": [
    //                 {
    //                   "target": 95,
    //                   "target_display": "95",
    //                   "timeframe": "7d"
    //                 },
    //                 {
    //                   "target": 95,
    //                   "target_display": "95",
    //                   "timeframe": "30d",
    //                   "warning": 97,
    //                   "warning_display": "97"
    //                 }
    //               ]
    //             },
    //             "id": "et sit commodo",
    //             "type": "Lorem ut quis"
    //           }
    //         }
    //       ]
    //     },
    //     "type": ""
    //   },
    //   "links": {
    //     "first": "voluptate veniam aliqua ea enim",
    //     "last": "non cupidatat amet dolore et",
    //     "next": "reprehenderit ex anim Lorem",
    //     "prev": "aute ex",
    //     "self": "deserunt"
    //   },
    //   "meta": {
    //     "pagination": {
    //       "first_number": 71439942,
    //       "last_number": -13516974,
    //       "next_number": -42474877,
    //       "number": 60934593,
    //       "prev_number": -25990176,
    //       "size": -54076764,
    //       "total": 58951452,
    //       "type": "deserunt et voluptate"
    //     }
    //   }
    // }

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

    // Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.

    v_Type = CkJsonObjectW_stringOf(jResp,L"data.type");
    First = CkJsonObjectW_stringOf(jResp,L"links.first");
    Last = CkJsonObjectW_stringOf(jResp,L"links.last");
    v_Next = CkJsonObjectW_stringOf(jResp,L"links.next");
    Prev = CkJsonObjectW_stringOf(jResp,L"links.prev");
    v_Self = CkJsonObjectW_stringOf(jResp,L"links.self");
    First_number = CkJsonObjectW_IntOf(jResp,L"meta.pagination.first_number");
    Last_number = CkJsonObjectW_IntOf(jResp,L"meta.pagination.last_number");
    Next_number = CkJsonObjectW_IntOf(jResp,L"meta.pagination.next_number");
    v_Number = CkJsonObjectW_IntOf(jResp,L"meta.pagination.number");
    Prev_number = CkJsonObjectW_IntOf(jResp,L"meta.pagination.prev_number");
    Size = CkJsonObjectW_IntOf(jResp,L"meta.pagination.size");
    Total = CkJsonObjectW_IntOf(jResp,L"meta.pagination.total");
    PaginationType = CkJsonObjectW_stringOf(jResp,L"meta.pagination.type");
    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.facets.all_tags");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        count = CkJsonObjectW_IntOf(jResp,L"data.attributes.facets.all_tags[i].count");
        name = CkJsonObjectW_stringOf(jResp,L"data.attributes.facets.all_tags[i].name");
        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.facets.creator_name");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        count = CkJsonObjectW_IntOf(jResp,L"data.attributes.facets.creator_name[i].count");
        name = CkJsonObjectW_stringOf(jResp,L"data.attributes.facets.creator_name[i].name");
        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.facets.env_tags");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        count = CkJsonObjectW_IntOf(jResp,L"data.attributes.facets.env_tags[i].count");
        name = CkJsonObjectW_stringOf(jResp,L"data.attributes.facets.env_tags[i].name");
        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.facets.service_tags");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        count = CkJsonObjectW_IntOf(jResp,L"data.attributes.facets.service_tags[i].count");
        name = CkJsonObjectW_stringOf(jResp,L"data.attributes.facets.service_tags[i].name");
        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.facets.slo_type");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        count = CkJsonObjectW_IntOf(jResp,L"data.attributes.facets.slo_type[i].count");
        name = CkJsonObjectW_stringOf(jResp,L"data.attributes.facets.slo_type[i].name");
        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.facets.target");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        count = CkJsonObjectW_IntOf(jResp,L"data.attributes.facets.target[i].count");
        name = CkJsonObjectW_stringOf(jResp,L"data.attributes.facets.target[i].name");
        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.facets.team_tags");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        count = CkJsonObjectW_IntOf(jResp,L"data.attributes.facets.team_tags[i].count");
        name = CkJsonObjectW_stringOf(jResp,L"data.attributes.facets.team_tags[i].name");
        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.facets.timeframe");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        count = CkJsonObjectW_IntOf(jResp,L"data.attributes.facets.timeframe[i].count");
        name = CkJsonObjectW_stringOf(jResp,L"data.attributes.facets.timeframe[i].name");
        i = i + 1;
    }

    i = 0;
    count_i = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.slos");
    while (i < count_i) {
        CkJsonObjectW_putI(jResp,i);
        Created_at = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.created_at");
        v_Email = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.creator.email");
        Id = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.creator.id");
        Name = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.creator.name");
        Description = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.description");
        Modified_at = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.modified_at");
        AttributesName = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.name");
        Denominator = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.query.denominator");
        Numerator = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.query.numerator");
        Slo_type = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.slo_type");
        Calculation_error = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.status.calculation_error");
        Error_budget_remaining = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.status.error_budget_remaining");
        Indexed_at = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.status.indexed_at");
        Unit = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.status.raw_error_budget_remaining.unit");
        Value = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.status.raw_error_budget_remaining.value");
        Sli = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.status.sli");
        Span_precision = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.status.span_precision");
        State = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.status.state");
        dataId = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.id");
        dataType = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.type");
        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.slos[i].data.attributes.all_tags");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            strVal = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.all_tags[j]");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.slos[i].data.attributes.env_tags");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            strVal = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.env_tags[j]");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.slos[i].data.attributes.groups");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            strVal = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.groups[j]");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.slos[i].data.attributes.monitor_ids");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            intVal = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.monitor_ids[j]");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.slos[i].data.attributes.overall_status");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            error = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.overall_status[j].error");
            error_budget_remaining = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.overall_status[j].error_budget_remaining");
            indexed_at = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.overall_status[j].indexed_at");
            raw_error_budget_remainingUnit = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.overall_status[j].raw_error_budget_remaining.unit");
            raw_error_budget_remainingValue = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.overall_status[j].raw_error_budget_remaining.value");
            span_precision = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.overall_status[j].span_precision");
            state = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.overall_status[j].state");
            status = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.overall_status[j].status");
            target = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.overall_status[j].target");
            timeframe = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.overall_status[j].timeframe");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.slos[i].data.attributes.query.metrics");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            strVal = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.query.metrics[j]");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.slos[i].data.attributes.service_tags");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            strVal = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.service_tags[j]");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.slos[i].data.attributes.team_tags");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            strVal = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.team_tags[j]");
            j = j + 1;
        }

        j = 0;
        count_j = CkJsonObjectW_SizeOfArray(jResp,L"data.attributes.slos[i].data.attributes.thresholds");
        while (j < count_j) {
            CkJsonObjectW_putJ(jResp,j);
            target = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.thresholds[j].target");
            target_display = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.thresholds[j].target_display");
            timeframe = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.thresholds[j].timeframe");
            warning = CkJsonObjectW_IntOf(jResp,L"data.attributes.slos[i].data.attributes.thresholds[j].warning");
            warning_display = CkJsonObjectW_stringOf(jResp,L"data.attributes.slos[i].data.attributes.thresholds[j].warning_display");
            j = j + 1;
        }

        i = i + 1;
    }



    CkHttpW_Dispose(http);
    CkJsonObjectW_Dispose(queryParams);
    CkStringBuilderW_Dispose(sbResponseBody);
    CkJsonObjectW_Dispose(jResp);

    }

Curl Command

curl -G -d "query=tempor%20Ut%20sed%20velit"
	-d "page[size]=-62147425"
	-d "page[number]=-62147425"
	-d "include_facets=true"
	-H "Accept: application/json"
https://api.app.ddog-gov.com/api/v1/slo/search

Postman Collection Item JSON

{
  "name": "Search for SLOs",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/api/v1/slo/search?query=tempor Ut sed velit&page[size]=-62147425&page[number]=-62147425&include_facets=true",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v1",
        "slo",
        "search"
      ],
      "query": [
        {
          "key": "query",
          "value": "tempor Ut sed velit",
          "description": "The query string to filter results based on SLO names.\nSome examples of queries include `service:<service-name>`\nand `<slo-name>`."
        },
        {
          "key": "page[size]",
          "value": "-62147425",
          "description": "The number of files to return in the response `[default=10]`."
        },
        {
          "key": "page[number]",
          "value": "-62147425",
          "description": "The identifier of the first page to return. This parameter is used for the pagination feature `[default=0]`."
        },
        {
          "key": "include_facets",
          "value": "true",
          "description": "Whether or not to return facet information in the response `[default=false]`."
        }
      ]
    },
    "description": "Get a list of service level objective objects for your organization."
  },
  "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/slo/search?query=tempor Ut sed velit&page[size]=-62147425&page[number]=-62147425&include_facets=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            "search"
          ],
          "query": [
            {
              "key": "query",
              "value": "tempor Ut sed velit",
              "description": "The query string to filter results based on SLO names.\nSome examples of queries include `service:<service-name>`\nand `<slo-name>`."
            },
            {
              "key": "page[size]",
              "value": "-62147425",
              "description": "The number of files to return in the response `[default=10]`."
            },
            {
              "key": "page[number]",
              "value": "-62147425",
              "description": "The identifier of the first page to return. This parameter is used for the pagination feature `[default=0]`."
            },
            {
              "key": "include_facets",
              "value": "true",
              "description": "Whether or not to return facet information in the response `[default=false]`."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"data\": {\n    \"attributes\": {\n      \"facets\": {\n        \"all_tags\": [\n          {\n            \"count\": -8530751,\n            \"name\": \"est cillum id ex\"\n          },\n          {\n            \"count\": 20390494,\n            \"name\": \"adipisicing minim quis velit dolore\"\n          }\n        ],\n        \"creator_name\": [\n          {\n            \"count\": 77247452,\n            \"name\": \"cupidatat elit eu id aute\"\n          },\n          {\n            \"count\": -77371710,\n            \"name\": \"dolore\"\n          }\n        ],\n        \"env_tags\": [\n          {\n            \"count\": -42199690,\n            \"name\": \"dolor eiusmod\"\n          },\n          {\n            \"count\": -60615528,\n            \"name\": \"commodo mollit\"\n          }\n        ],\n        \"service_tags\": [\n          {\n            \"count\": 49217615,\n            \"name\": \"aute cupidatat\"\n          },\n          {\n            \"count\": 77659232,\n            \"name\": \"est Ut aute\"\n          }\n        ],\n        \"slo_type\": [\n          {\n            \"count\": 55153641,\n            \"name\": 41482978.922150195\n          },\n          {\n            \"count\": 11427450,\n            \"name\": 85748817.01266047\n          }\n        ],\n        \"target\": [\n          {\n            \"count\": 96778717,\n            \"name\": -37511597.68983867\n          },\n          {\n            \"count\": 15549994,\n            \"name\": 30406993.57594505\n          }\n        ],\n        \"team_tags\": [\n          {\n            \"count\": -61109884,\n            \"name\": \"laborum ex esse proident\"\n          },\n          {\n            \"count\": 68412080,\n            \"name\": \"nisi qui cillum exercitation\"\n          }\n        ],\n        \"timeframe\": [\n          {\n            \"count\": -21958451,\n            \"name\": \"fugiat\"\n          },\n          {\n            \"count\": 12824105,\n            \"name\": \"tempor adipisi\"\n          }\n        ]\n      },\n      \"slos\": [\n        {\n          \"data\": {\n            \"attributes\": {\n              \"all_tags\": [\n                \"env:prod\",\n                \"app:core\"\n              ],\n              \"created_at\": 2857983,\n              \"creator\": {\n                \"email\": \"non Lorem\",\n                \"id\": 39288042,\n                \"name\": \"voluptate\"\n              },\n              \"description\": \"fugiat sit in quis\",\n              \"env_tags\": [\n                \"irure tempor\",\n                \"laborum reprehenderi\"\n              ],\n              \"groups\": [\n                \"env:prod\",\n                \"role:mysql\"\n              ],\n              \"modified_at\": -85796945,\n              \"monitor_ids\": [\n                99205206,\n                23793820\n              ],\n              \"name\": \"Custom Metric SLO\",\n              \"overall_status\": [\n                {\n                  \"error\": \"occaecat dolore\",\n                  \"error_budget_remaining\": 100,\n                  \"indexed_at\": 1662496260,\n                  \"raw_error_budget_remaining\": {\n                    \"unit\": \"requests\",\n                    \"value\": 60\n                  },\n                  \"span_precision\": 2,\n                  \"state\": \"ok\",\n                  \"status\": 100,\n                  \"target\": 99,\n                  \"timeframe\": \"30d\"\n                },\n                {\n                  \"error\": \"in officia\",\n                  \"error_budget_remaining\": 100,\n                  \"indexed_at\": 1662496260,\n                  \"raw_error_budget_remaining\": {\n                    \"unit\": \"requests\",\n                    \"value\": 60\n                  },\n                  \"span_precision\": 2,\n                  \"state\": \"ok\",\n                  \"status\": 100,\n                  \"target\": 99,\n                  \"timeframe\": \"30d\"\n                }\n              ],\n              \"query\": {\n                \"denominator\": \"sum:my.custom.metric{*}.as_count()\",\n                \"metrics\": [\n                  \"my.custom.metric\",\n                  \"my.other.custom.metric\"\n                ],\n                \"numerator\": \"sum:my.custom.metric{type:good}.as_count()\"\n              },\n              \"service_tags\": [\n                \"aute amet dolor pariatur mollit\",\n                \"officia\"\n              ],\n              \"slo_type\": \"metric\",\n              \"status\": {\n                \"calculation_error\": \"qui\",\n                \"error_budget_remaining\": 100,\n                \"indexed_at\": 1662496260,\n                \"raw_error_budget_remaining\": {\n                  \"unit\": \"requests\",\n                  \"value\": 60\n                },\n                \"sli\": 100,\n                \"span_precision\": 2,\n                \"state\": \"ok\"\n              },\n              \"team_tags\": [\n                \"quis veniam magna\",\n                \"ad\"\n              ],\n              \"thresholds\": [\n                {\n                  \"target\": 95,\n                  \"target_display\": \"95\",\n                  \"timeframe\": \"7d\"\n                },\n                {\n                  \"target\": 95,\n                  \"target_display\": \"95\",\n                  \"timeframe\": \"30d\",\n                  \"warning\": 97,\n                  \"warning_display\": \"97\"\n                }\n              ]\n            },\n            \"id\": \"sed fugiat est cillum\",\n            \"type\": \"mollit dolore\"\n          }\n        },\n        {\n          \"data\": {\n            \"attributes\": {\n              \"all_tags\": [\n                \"env:prod\",\n                \"app:core\"\n              ],\n              \"created_at\": -97407922,\n              \"creator\": {\n                \"email\": \"in nulla\",\n                \"id\": -4202515,\n                \"name\": \"elit et consequat\"\n              },\n              \"description\": \"dolor sed cupidatat pariatur sint\",\n              \"env_tags\": [\n                \"magna ex pariatur dolore sed\",\n                \"velit dolor aute in nostrud\"\n              ],\n              \"groups\": [\n                \"env:prod\",\n                \"role:mysql\"\n              ],\n              \"modified_at\": -32142227,\n              \"monitor_ids\": [\n                83809238,\n                -63596037\n              ],\n              \"name\": \"Custom Metric SLO\",\n              \"overall_status\": [\n                {\n                  \"error\": \"reprehenderit cupidat\",\n                  \"error_budget_remaining\": 100,\n                  \"indexed_at\": 1662496260,\n                  \"raw_error_budget_remaining\": {\n                    \"unit\": \"requests\",\n                    \"value\": 60\n                  },\n                  \"span_precision\": 2,\n                  \"state\": \"ok\",\n                  \"status\": 100,\n                  \"target\": 99,\n                  \"timeframe\": \"30d\"\n                },\n                {\n                  \"error\": \"consequat\",\n                  \"error_budget_remaining\": 100,\n                  \"indexed_at\": 1662496260,\n                  \"raw_error_budget_remaining\": {\n                    \"unit\": \"requests\",\n                    \"value\": 60\n                  },\n                  \"span_precision\": 2,\n                  \"state\": \"ok\",\n                  \"status\": 100,\n                  \"target\": 99,\n                  \"timeframe\": \"30d\"\n                }\n              ],\n              \"query\": {\n                \"denominator\": \"sum:my.custom.metric{*}.as_count()\",\n                \"metrics\": [\n                  \"my.custom.metric\",\n                  \"my.other.custom.metric\"\n                ],\n                \"numerator\": \"sum:my.custom.metric{type:good}.as_count()\"\n              },\n              \"service_tags\": [\n                \"magna velit\",\n                \"occaecat tempor proident ex ea\"\n              ],\n              \"slo_type\": \"metric\",\n              \"status\": {\n                \"calculation_error\": \"in occaecat e\",\n                \"error_budget_remaining\": 100,\n                \"indexed_at\": 1662496260,\n                \"raw_error_budget_remaining\": {\n                  \"unit\": \"requests\",\n                  \"value\": 60\n                },\n                \"sli\": 100,\n                \"span_precision\": 2,\n                \"state\": \"ok\"\n              },\n              \"team_tags\": [\n                \"Ut nisi ipsum fugiat\",\n                \"exercitation proident consequat aute\"\n              ],\n              \"thresholds\": [\n                {\n                  \"target\": 95,\n                  \"target_display\": \"95\",\n                  \"timeframe\": \"7d\"\n                },\n                {\n                  \"target\": 95,\n                  \"target_display\": \"95\",\n                  \"timeframe\": \"30d\",\n                  \"warning\": 97,\n                  \"warning_display\": \"97\"\n                }\n              ]\n            },\n            \"id\": \"et sit commodo\",\n            \"type\": \"Lorem ut quis\"\n          }\n        }\n      ]\n    },\n    \"type\": \"\"\n  },\n  \"links\": {\n    \"first\": \"voluptate veniam aliqua ea enim\",\n    \"last\": \"non cupidatat amet dolore et\",\n    \"next\": \"reprehenderit ex anim Lorem\",\n    \"prev\": \"aute ex\",\n    \"self\": \"deserunt\"\n  },\n  \"meta\": {\n    \"pagination\": {\n      \"first_number\": 71439942,\n      \"last_number\": -13516974,\n      \"next_number\": -42474877,\n      \"number\": 60934593,\n      \"prev_number\": -25990176,\n      \"size\": -54076764,\n      \"total\": 58951452,\n      \"type\": \"deserunt et voluptate\"\n    }\n  }\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/slo/search?query=tempor Ut sed velit&page[size]=-62147425&page[number]=-62147425&include_facets=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            "search"
          ],
          "query": [
            {
              "key": "query",
              "value": "tempor Ut sed velit",
              "description": "The query string to filter results based on SLO names.\nSome examples of queries include `service:<service-name>`\nand `<slo-name>`."
            },
            {
              "key": "page[size]",
              "value": "-62147425",
              "description": "The number of files to return in the response `[default=10]`."
            },
            {
              "key": "page[number]",
              "value": "-62147425",
              "description": "The identifier of the first page to return. This parameter is used for the pagination feature `[default=0]`."
            },
            {
              "key": "include_facets",
              "value": "true",
              "description": "Whether or not to return facet information in the response `[default=false]`."
            }
          ]
        }
      },
      "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/slo/search?query=tempor Ut sed velit&page[size]=-62147425&page[number]=-62147425&include_facets=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            "search"
          ],
          "query": [
            {
              "key": "query",
              "value": "tempor Ut sed velit",
              "description": "The query string to filter results based on SLO names.\nSome examples of queries include `service:<service-name>`\nand `<slo-name>`."
            },
            {
              "key": "page[size]",
              "value": "-62147425",
              "description": "The number of files to return in the response `[default=10]`."
            },
            {
              "key": "page[number]",
              "value": "-62147425",
              "description": "The identifier of the first page to return. This parameter is used for the pagination feature `[default=0]`."
            },
            {
              "key": "include_facets",
              "value": "true",
              "description": "Whether or not to return facet information in the response `[default=false]`."
            }
          ]
        }
      },
      "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/slo/search?query=tempor Ut sed velit&page[size]=-62147425&page[number]=-62147425&include_facets=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            "search"
          ],
          "query": [
            {
              "key": "query",
              "value": "tempor Ut sed velit",
              "description": "The query string to filter results based on SLO names.\nSome examples of queries include `service:<service-name>`\nand `<slo-name>`."
            },
            {
              "key": "page[size]",
              "value": "-62147425",
              "description": "The number of files to return in the response `[default=10]`."
            },
            {
              "key": "page[number]",
              "value": "-62147425",
              "description": "The identifier of the first page to return. This parameter is used for the pagination feature `[default=0]`."
            },
            {
              "key": "include_facets",
              "value": "true",
              "description": "Whether or not to return facet information in the response `[default=false]`."
            }
          ]
        }
      },
      "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}"
    }
  ]
}