Chilkat Online Tools

ERROR!

------------------- GenerateCode ----------------------
ImpliedContentType: 
---- begin chilkat script ----
// This example assumes the Chilkat API to have been previously unlocked.
// See {{-global_unlock:::Global Unlock Sample-}} for sample code.

new Http http;
ckbool success;

new JsonObject queryParams;
ignore = queryParams.UpdateInt("from_ts",-62147425);
ignore = queryParams.UpdateInt("to_ts",-62147425);
ignore = queryParams.UpdateString("target","49.34019051965387");
ignore = queryParams.UpdateString("apply_correction","true");

call http.SetRequestHeader("Accept","application/json");


HttpResponse resp = http.QuickRequestParams("GET","https://api.app.ddog-gov.com/api/v1/slo/:slo_id/history",queryParams);
if (http.LastMethodSuccess == ckfalse) {
    println http.LastErrorText;
    return;
}

new StringBuilder sbResponseBody;
ignore = resp.GetBodySb(sbResponseBody);

new JsonObject jResp;
call jResp.LoadSb(sbResponseBody);
jResp.EmitCompact = ckfalse;

println "Response Body:";
println jResp.Emit();

int respStatusCode = resp.StatusCode;
println "Response Status Code = ",respStatusCode;
if (respStatusCode >= 400) {
    println "Response Header:";
    println resp.Header;
    println "Failed.";
    delete resp;
    return;
}
delete resp;

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

// {
//   "data": {
//     "from_ts": 1615323990,
//     "group_by": [
//       "aliqua pariatur",
//       "labor"
//     ],
//     "groups": [
//       {
//         "error_budget_remaining": {
//           "7d": 100
//         },
//         "errors": [
//           {
//             "error_type": "",
//             "error_message": ""
//           },
//           {
//             "error_type": "",
//             "error_message": ""
//           }
//         ],
//         "group": "name",
//         "history": [
//           [
//             1579212382,
//             0
//           ]
//         ],
//         "monitor_modified": 1615867200,
//         "monitor_type": "string",
//         "name": "string",
//         "precision": 2,
//         "preview": true,
//         "sli_value": 99.99,
//         "span_precision": 2,
//         "uptime": 99.99
//       },
//       {
//         "error_budget_remaining": {
//           "7d": 100
//         },
//         "errors": [
//           {
//             "error_type": "",
//             "error_message": ""
//           },
//           {
//             "error_type": "",
//             "error_message": ""
//           }
//         ],
//         "group": "name",
//         "history": [
//           [
//             1579212382,
//             0
//           ]
//         ],
//         "monitor_modified": 1615867200,
//         "monitor_type": "string",
//         "name": "string",
//         "precision": 2,
//         "preview": true,
//         "sli_value": 99.99,
//         "span_precision": 2,
//         "uptime": 99.99
//       }
//     ],
//     "monitors": [
//       {
//         "error_budget_remaining": {
//           "7d": 100
//         },
//         "errors": [
//           {
//             "error_type": "",
//             "error_message": ""
//           },
//           {
//             "error_type": "",
//             "error_message": ""
//           }
//         ],
//         "group": "name",
//         "history": [
//           [
//             1579212382,
//             0
//           ]
//         ],
//         "monitor_modified": 1615867200,
//         "monitor_type": "string",
//         "name": "string",
//         "precision": 2,
//         "preview": true,
//         "sli_value": 99.99,
//         "span_precision": 2,
//         "uptime": 99.99
//       },
//       {
//         "error_budget_remaining": {
//           "7d": 100
//         },
//         "errors": [
//           {
//             "error_type": "",
//             "error_message": ""
//           },
//           {
//             "error_type": "",
//             "error_message": ""
//           }
//         ],
//         "group": "name",
//         "history": [
//           [
//             1579212382,
//             0
//           ]
//         ],
//         "monitor_modified": 1615867200,
//         "monitor_type": "string",
//         "name": "string",
//         "precision": 2,
//         "preview": true,
//         "sli_value": 99.99,
//         "span_precision": 2,
//         "uptime": 99.99
//       }
//     ],
//     "overall": {
//       "error_budget_remaining": {
//         "7d": 100
//       },
//       "errors": [
//         {
//           "error_type": "",
//           "error_message": ""
//         },
//         {
//           "error_type": "",
//           "error_message": ""
//         }
//       ],
//       "group": "name",
//       "history": [
//         [
//           1579212382,
//           0
//         ]
//       ],
//       "monitor_modified": 1615867200,
//       "monitor_type": "string",
//       "name": "string",
//       "precision": {
//         "30d": 1,
//         "7d": 2
//       },
//       "preview": true,
//       "sli_value": 99.99,
//       "span_precision": 2,
//       "uptime": 99.99
//     },
//     "series": {
//       "res_type": "",
//       "interval": 0,
//       "resp_version": 0,
//       "query": "",
//       "times": [
//       ],
//       "numerator": {
//         "count": 0,
//         "sum": 0,
//         "metadata": {}
//       },
//       "denominator": {
//         "count": 0,
//         "sum": 0,
//         "metadata": {}
//       },
//       "message": ""
//     },
//     "thresholds": {
//       "my_service": {
//         "target": 95,
//         "timeframe": "7d"
//       }
//     },
//     "to_ts": 1615928790,
//     "type": "metric",
//     "type_id": 0
//   },
//   "errors": [
//     {
//       "error": "ullamco pariatur"
//     },
//     {
//       "error": "aliquip anim do laborum commodo"
//     }
//   ]
// }

// Sample code for parsing the JSON response...
// Use this online tool to generate parsing code from sample JSON: {{.https://tools.chilkat.io/jsonParse|||Generate JSON Parsing Code.}}

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

int j;
int count_j;
string error_type;
string error_message;
int intVal;
string error;

From_ts = jResp.IntOf("data.from_ts");
v_7d = jResp.IntOf("data.overall.error_budget_remaining.7d");
Group = jResp.StringOf("data.overall.group");
Monitor_modified = jResp.IntOf("data.overall.monitor_modified");
Monitor_type = jResp.StringOf("data.overall.monitor_type");
Name = jResp.StringOf("data.overall.name");
v_30d = jResp.IntOf("data.overall.precision.30d");
Precision7d = jResp.IntOf("data.overall.precision.7d");
Preview = jResp.BoolOf("data.overall.preview");
Sli_value = jResp.StringOf("data.overall.sli_value");
Span_precision = jResp.IntOf("data.overall.span_precision");
Uptime = jResp.StringOf("data.overall.uptime");
Res_type = jResp.StringOf("data.series.res_type");
Interval = jResp.IntOf("data.series.interval");
Resp_version = jResp.IntOf("data.series.resp_version");
Query = jResp.StringOf("data.series.query");
Count = jResp.IntOf("data.series.numerator.count");
Sum = jResp.IntOf("data.series.numerator.sum");
DenominatorCount = jResp.IntOf("data.series.denominator.count");
DenominatorSum = jResp.IntOf("data.series.denominator.sum");
Message = jResp.StringOf("data.series.message");
Target = jResp.IntOf("data.thresholds.my_service.target");
Timeframe = jResp.StringOf("data.thresholds.my_service.timeframe");
To_ts = jResp.IntOf("data.to_ts");
v_Type = jResp.StringOf("data.type");
Type_id = jResp.IntOf("data.type_id");
int i = 0;
int count_i = jResp.SizeOfArray("data.group_by");
while i < count_i {
    jResp.I = i;
    strVal = jResp.StringOf("data.group_by[i]");
    i = i + 1;
}
i = 0;
count_i = jResp.SizeOfArray("data.groups");
while i < count_i {
    jResp.I = i;
    error_budget_remaining7d = jResp.IntOf("data.groups[i].error_budget_remaining.7d");
    group = jResp.StringOf("data.groups[i].group");
    monitor_modified = jResp.IntOf("data.groups[i].monitor_modified");
    monitor_type = jResp.StringOf("data.groups[i].monitor_type");
    name = jResp.StringOf("data.groups[i].name");
    precision = jResp.IntOf("data.groups[i].precision");
    preview = jResp.BoolOf("data.groups[i].preview");
    sli_value = jResp.StringOf("data.groups[i].sli_value");
    span_precision = jResp.IntOf("data.groups[i].span_precision");
    uptime = jResp.StringOf("data.groups[i].uptime");
    j = 0;
    count_j = jResp.SizeOfArray("data.groups[i].errors");
    while j < count_j {
        jResp.J = j;
        error_type = jResp.StringOf("data.groups[i].errors[j].error_type");
        error_message = jResp.StringOf("data.groups[i].errors[j].error_message");
        j = j + 1;
    }
    j = 0;
    count_j = jResp.SizeOfArray("data.groups[i].history");
    while j < count_j {
        jResp.J = j;
        k = 0;
        count_k = jResp.SizeOfArray("data.groups[i].history[j]");
        while k < count_k {
            jResp.K = k;
            intVal = jResp.IntOf("data.groups[i].history[j][k]");
            k = k + 1;
        }
        j = j + 1;
    }
    i = i + 1;
}
i = 0;
count_i = jResp.SizeOfArray("data.monitors");
while i < count_i {
    jResp.I = i;
    error_budget_remaining7d = jResp.IntOf("data.monitors[i].error_budget_remaining.7d");
    group = jResp.StringOf("data.monitors[i].group");
    monitor_modified = jResp.IntOf("data.monitors[i].monitor_modified");
    monitor_type = jResp.StringOf("data.monitors[i].monitor_type");
    name = jResp.StringOf("data.monitors[i].name");
    precision = jResp.IntOf("data.monitors[i].precision");
    preview = jResp.BoolOf("data.monitors[i].preview");
    sli_value = jResp.StringOf("data.monitors[i].sli_value");
    span_precision = jResp.IntOf("data.monitors[i].span_precision");
    uptime = jResp.StringOf("data.monitors[i].uptime");
    j = 0;
    count_j = jResp.SizeOfArray("data.monitors[i].errors");
    while j < count_j {
        jResp.J = j;
        error_type = jResp.StringOf("data.monitors[i].errors[j].error_type");
        error_message = jResp.StringOf("data.monitors[i].errors[j].error_message");
        j = j + 1;
    }
    j = 0;
    count_j = jResp.SizeOfArray("data.monitors[i].history");
    while j < count_j {
        jResp.J = j;
        k = 0;
        count_k = jResp.SizeOfArray("data.monitors[i].history[j]");
        while k < count_k {
            jResp.K = k;
            intVal = jResp.IntOf("data.monitors[i].history[j][k]");
            k = k + 1;
        }
        j = j + 1;
    }
    i = i + 1;
}
i = 0;
count_i = jResp.SizeOfArray("data.overall.errors");
while i < count_i {
    jResp.I = i;
    error_type = jResp.StringOf("data.overall.errors[i].error_type");
    error_message = jResp.StringOf("data.overall.errors[i].error_message");
    i = i + 1;
}
i = 0;
count_i = jResp.SizeOfArray("data.overall.history");
while i < count_i {
    jResp.I = i;
    j = 0;
    count_j = jResp.SizeOfArray("data.overall.history[i]");
    while j < count_j {
        jResp.J = j;
        intVal = jResp.IntOf("data.overall.history[i][j]");
        j = j + 1;
    }
    i = i + 1;
}
i = 0;
count_i = jResp.SizeOfArray("data.series.times");
while i < count_i {
    jResp.I = i;
    i = i + 1;
}
i = 0;
count_i = jResp.SizeOfArray("errors");
while i < count_i {
    jResp.I = i;
    error = jResp.StringOf("errors[i].error");
    i = i + 1;
}



---- end chilkat script ----

Objective-C / Datadog API Collection / Get an SLO's history

Back to Collection Items

#import <CkoHttp.h>
#import <CkoJsonObject.h>
#import <CkoHttpResponse.h>
#import <CkoStringBuilder.h>
#import <NSString.h>

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

CkoHttp *http = [[CkoHttp alloc] init];
BOOL success;

CkoJsonObject *queryParams = [[CkoJsonObject alloc] init];
[queryParams UpdateInt: @"from_ts" value: [NSNumber numberWithInt: -62147425]];
[queryParams UpdateInt: @"to_ts" value: [NSNumber numberWithInt: -62147425]];
[queryParams UpdateString: @"target" value: @"49.34019051965387"];
[queryParams UpdateString: @"apply_correction" value: @"true"];

[http SetRequestHeader: @"Accept" value: @"application/json"];

CkoHttpResponse *resp = [http QuickRequestParams: @"GET" url: @"https://api.app.ddog-gov.com/api/v1/slo/:slo_id/history" json: queryParams];
if (http.LastMethodSuccess == NO) {
    NSLog(@"%@",http.LastErrorText);
    return;
}

CkoStringBuilder *sbResponseBody = [[CkoStringBuilder alloc] init];
[resp GetBodySb: sbResponseBody];

CkoJsonObject *jResp = [[CkoJsonObject alloc] init];
[jResp LoadSb: sbResponseBody];
jResp.EmitCompact = NO;

NSLog(@"%@",@"Response Body:");
NSLog(@"%@",[jResp Emit]);

int respStatusCode = [resp.StatusCode intValue];
NSLog(@"%@%d",@"Response Status Code = ",respStatusCode);
if (respStatusCode >= 400) {
    NSLog(@"%@",@"Response Header:");
    NSLog(@"%@",resp.Header);
    NSLog(@"%@",@"Failed.");

    return;
}

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

// {
//   "data": {
//     "from_ts": 1615323990,
//     "group_by": [
//       "aliqua pariatur",
//       "labor"
//     ],
//     "groups": [
//       {
//         "error_budget_remaining": {
//           "7d": 100
//         },
//         "errors": [
//           {
//             "error_type": "",
//             "error_message": ""
//           },
//           {
//             "error_type": "",
//             "error_message": ""
//           }
//         ],
//         "group": "name",
//         "history": [
//           [
//             1579212382,
//             0
//           ]
//         ],
//         "monitor_modified": 1615867200,
//         "monitor_type": "string",
//         "name": "string",
//         "precision": 2,
//         "preview": true,
//         "sli_value": 99.99,
//         "span_precision": 2,
//         "uptime": 99.99
//       },
//       {
//         "error_budget_remaining": {
//           "7d": 100
//         },
//         "errors": [
//           {
//             "error_type": "",
//             "error_message": ""
//           },
//           {
//             "error_type": "",
//             "error_message": ""
//           }
//         ],
//         "group": "name",
//         "history": [
//           [
//             1579212382,
//             0
//           ]
//         ],
//         "monitor_modified": 1615867200,
//         "monitor_type": "string",
//         "name": "string",
//         "precision": 2,
//         "preview": true,
//         "sli_value": 99.99,
//         "span_precision": 2,
//         "uptime": 99.99
//       }
//     ],
//     "monitors": [
//       {
//         "error_budget_remaining": {
//           "7d": 100
//         },
//         "errors": [
//           {
//             "error_type": "",
//             "error_message": ""
//           },
//           {
//             "error_type": "",
//             "error_message": ""
//           }
//         ],
//         "group": "name",
//         "history": [
//           [
//             1579212382,
//             0
//           ]
//         ],
//         "monitor_modified": 1615867200,
//         "monitor_type": "string",
//         "name": "string",
//         "precision": 2,
//         "preview": true,
//         "sli_value": 99.99,
//         "span_precision": 2,
//         "uptime": 99.99
//       },
//       {
//         "error_budget_remaining": {
//           "7d": 100
//         },
//         "errors": [
//           {
//             "error_type": "",
//             "error_message": ""
//           },
//           {
//             "error_type": "",
//             "error_message": ""
//           }
//         ],
//         "group": "name",
//         "history": [
//           [
//             1579212382,
//             0
//           ]
//         ],
//         "monitor_modified": 1615867200,
//         "monitor_type": "string",
//         "name": "string",
//         "precision": 2,
//         "preview": true,
//         "sli_value": 99.99,
//         "span_precision": 2,
//         "uptime": 99.99
//       }
//     ],
//     "overall": {
//       "error_budget_remaining": {
//         "7d": 100
//       },
//       "errors": [
//         {
//           "error_type": "",
//           "error_message": ""
//         },
//         {
//           "error_type": "",
//           "error_message": ""
//         }
//       ],
//       "group": "name",
//       "history": [
//         [
//           1579212382,
//           0
//         ]
//       ],
//       "monitor_modified": 1615867200,
//       "monitor_type": "string",
//       "name": "string",
//       "precision": {
//         "30d": 1,
//         "7d": 2
//       },
//       "preview": true,
//       "sli_value": 99.99,
//       "span_precision": 2,
//       "uptime": 99.99
//     },
//     "series": {
//       "res_type": "",
//       "interval": 0,
//       "resp_version": 0,
//       "query": "",
//       "times": [
//       ],
//       "numerator": {
//         "count": 0,
//         "sum": 0,
//         "metadata": {}
//       },
//       "denominator": {
//         "count": 0,
//         "sum": 0,
//         "metadata": {}
//       },
//       "message": ""
//     },
//     "thresholds": {
//       "my_service": {
//         "target": 95,
//         "timeframe": "7d"
//       }
//     },
//     "to_ts": 1615928790,
//     "type": "metric",
//     "type_id": 0
//   },
//   "errors": [
//     {
//       "error": "ullamco pariatur"
//     },
//     {
//       "error": "aliquip anim do laborum commodo"
//     }
//   ]
// }

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

int j;
int count_j;
NSString *error_type = 0;
NSString *error_message = 0;
int intVal;
NSString *error = 0;

ERROR: Undefined variable(From_ts)

ERROR: Undefined variable(v_7d)

ERROR: Undefined variable(Group)

ERROR: Undefined variable(Monitor_modified)

ERROR: Undefined variable(Monitor_type)

ERROR: Undefined variable(Name)

ERROR: Undefined variable(v_30d)

ERROR: Undefined variable(Precision7d)

ERROR: Undefined variable(Preview)

ERROR: Undefined variable(Sli_value)

ERROR: Undefined variable(Span_precision)

ERROR: Undefined variable(Uptime)

ERROR: Undefined variable(Res_type)

ERROR: Undefined variable(Interval)

ERROR: Undefined variable(Resp_version)

ERROR: Undefined variable(Query)

ERROR: Undefined variable(Count)

ERROR: Undefined variable(Sum)

ERROR: Undefined variable(DenominatorCount)

ERROR: Undefined variable(DenominatorSum)

ERROR: Undefined variable(Message)

ERROR: Undefined variable(Target)

ERROR: Undefined variable(Timeframe)

ERROR: Undefined variable(To_ts)

ERROR: Undefined variable(v_Type)

ERROR: Undefined variable(Type_id)

int i = 0;
int count_i = [[jResp SizeOfArray: @"data.group_by"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: i];
ERROR: Undefined variable(strVal)

    i = i + 1;
}

i = 0;
count_i = [[jResp SizeOfArray: @"data.groups"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: i];
ERROR: Undefined variable(ERROR_budget_remaining7d)

ERROR: Undefined variable(group)

ERROR: Undefined variable(monitor_modified)

ERROR: Undefined variable(monitor_type)

ERROR: Undefined variable(name)

ERROR: Undefined variable(precision)

ERROR: Undefined variable(preview)

ERROR: Undefined variable(sli_value)

ERROR: Undefined variable(span_precision)

ERROR: Undefined variable(uptime)

    j = 0;
    count_j = [[jResp SizeOfArray: @"data.groups[i].errors"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: j];
        error_type = [jResp StringOf: @"data.groups[i].errors[j].error_type"];
        error_message = [jResp StringOf: @"data.groups[i].errors[j].error_message"];
        j = j + 1;
    }

    j = 0;
    count_j = [[jResp SizeOfArray: @"data.groups[i].history"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: j];
ERROR: Undefined variable(k)

ERROR: Undefined variable(count_k)

ERROR: Undefined variable(k)
ERROR: Undefined variable(count_k)
        while (ERROR: Undefined variable(k)
 < ERROR: Undefined variable(count_k)
) {
ERROR: Undefined variable(k)
ERROR: No et type for RHS expression.

            intVal = [[jResp IntOf: @"data.groups[i].history[j][k]"] intValue];
ERROR: Undefined variable(k)
ERROR: Missing et type attribute (b)
ERROR: Undefined variable(k)

        }

        j = j + 1;
    }

    i = i + 1;
}

i = 0;
count_i = [[jResp SizeOfArray: @"data.monitors"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: i];
ERROR: Undefined variable(ERROR_budget_remaining7d)

ERROR: Undefined variable(group)

ERROR: Undefined variable(monitor_modified)

ERROR: Undefined variable(monitor_type)

ERROR: Undefined variable(name)

ERROR: Undefined variable(precision)

ERROR: Undefined variable(preview)

ERROR: Undefined variable(sli_value)

ERROR: Undefined variable(span_precision)

ERROR: Undefined variable(uptime)

    j = 0;
    count_j = [[jResp SizeOfArray: @"data.monitors[i].errors"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: j];
        error_type = [jResp StringOf: @"data.monitors[i].errors[j].error_type"];
        error_message = [jResp StringOf: @"data.monitors[i].errors[j].error_message"];
        j = j + 1;
    }

    j = 0;
    count_j = [[jResp SizeOfArray: @"data.monitors[i].history"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: j];
ERROR: Undefined variable(k)

ERROR: Undefined variable(count_k)

ERROR: Undefined variable(k)
ERROR: Undefined variable(count_k)
        while (ERROR: Undefined variable(k)
 < ERROR: Undefined variable(count_k)
) {
ERROR: Undefined variable(k)
ERROR: No et type for RHS expression.

            intVal = [[jResp IntOf: @"data.monitors[i].history[j][k]"] intValue];
ERROR: Undefined variable(k)
ERROR: Missing et type attribute (b)
ERROR: Undefined variable(k)

        }

        j = j + 1;
    }

    i = i + 1;
}

i = 0;
count_i = [[jResp SizeOfArray: @"data.overall.errors"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: i];
    error_type = [jResp StringOf: @"data.overall.errors[i].error_type"];
    error_message = [jResp StringOf: @"data.overall.errors[i].error_message"];
    i = i + 1;
}

i = 0;
count_i = [[jResp SizeOfArray: @"data.overall.history"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: i];
    j = 0;
    count_j = [[jResp SizeOfArray: @"data.overall.history[i]"] intValue];
    while (j < count_j) {
        jResp.J = [NSNumber numberWithInt: j];
        intVal = [[jResp IntOf: @"data.overall.history[i][j]"] intValue];
        j = j + 1;
    }

    i = i + 1;
}

i = 0;
count_i = [[jResp SizeOfArray: @"data.series.times"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: i];
    i = i + 1;
}

i = 0;
count_i = [[jResp SizeOfArray: @"errors"] intValue];
while (i < count_i) {
    jResp.I = [NSNumber numberWithInt: i];
    error = [jResp StringOf: @"errors[i].error"];
    i = i + 1;
}

Curl Command

curl -G -d "from_ts=-62147425"
	-d "to_ts=-62147425"
	-d "target=49.34019051965387"
	-d "apply_correction=true"
	-H "Accept: application/json"
https://api.app.ddog-gov.com/api/v1/slo/:slo_id/history

Postman Collection Item JSON

{
  "name": "Get an SLO's history",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/api/v1/slo/:slo_id/history?from_ts=-62147425&to_ts=-62147425&target=49.34019051965387&apply_correction=true",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v1",
        "slo",
        ":slo_id",
        "history"
      ],
      "query": [
        {
          "key": "from_ts",
          "value": "-62147425",
          "description": "(Required) The `from` timestamp for the query window in epoch seconds."
        },
        {
          "key": "to_ts",
          "value": "-62147425",
          "description": "(Required) The `to` timestamp for the query window in epoch seconds."
        },
        {
          "key": "target",
          "value": "49.34019051965387",
          "description": "The SLO target. If `target` is passed in, the response will include the remaining error budget and a timeframe value of `custom`."
        },
        {
          "key": "apply_correction",
          "value": "true",
          "description": "Defaults to `true`. If any SLO corrections are applied and this parameter is set to `false`,\nthen the corrections will not be applied and the SLI values will not be affected."
        }
      ],
      "variable": [
        {
          "key": "slo_id",
          "value": "tempor Ut sed velit"
        }
      ]
    },
    "description": "Get a specific SLO’s history, regardless of its SLO type.\n\nThe detailed history data is structured according to the source data type.\nFor example, metric data is included for event SLOs that use\nthe metric source, and monitor SLO types include the monitor transition history.\n\n**Note:** There are different response formats for event based and time based SLOs.\nExamples of both are shown."
  },
  "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/:slo_id/history?from_ts=-62147425&to_ts=-62147425&target=49.34019051965387&apply_correction=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            ":slo_id",
            "history"
          ],
          "query": [
            {
              "key": "from_ts",
              "value": "-62147425",
              "description": "(Required) The `from` timestamp for the query window in epoch seconds."
            },
            {
              "key": "to_ts",
              "value": "-62147425",
              "description": "(Required) The `to` timestamp for the query window in epoch seconds."
            },
            {
              "key": "target",
              "value": "49.34019051965387",
              "description": "The SLO target. If `target` is passed in, the response will include the remaining error budget and a timeframe value of `custom`."
            },
            {
              "key": "apply_correction",
              "value": "true",
              "description": "Defaults to `true`. If any SLO corrections are applied and this parameter is set to `false`,\nthen the corrections will not be applied and the SLI values will not be affected."
            }
          ],
          "variable": [
            {
              "key": "slo_id"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"data\": {\n    \"from_ts\": 1615323990,\n    \"group_by\": [\n      \"aliqua pariatur\",\n      \"labor\"\n    ],\n    \"groups\": [\n      {\n        \"error_budget_remaining\": {\n          \"7d\": 100\n        },\n        \"errors\": [\n          {\n            \"error_type\": \"\",\n            \"error_message\": \"\"\n          },\n          {\n            \"error_type\": \"\",\n            \"error_message\": \"\"\n          }\n        ],\n        \"group\": \"name\",\n        \"history\": [\n          [\n            1579212382,\n            0\n          ]\n        ],\n        \"monitor_modified\": 1615867200,\n        \"monitor_type\": \"string\",\n        \"name\": \"string\",\n        \"precision\": 2,\n        \"preview\": true,\n        \"sli_value\": 99.99,\n        \"span_precision\": 2,\n        \"uptime\": 99.99\n      },\n      {\n        \"error_budget_remaining\": {\n          \"7d\": 100\n        },\n        \"errors\": [\n          {\n            \"error_type\": \"\",\n            \"error_message\": \"\"\n          },\n          {\n            \"error_type\": \"\",\n            \"error_message\": \"\"\n          }\n        ],\n        \"group\": \"name\",\n        \"history\": [\n          [\n            1579212382,\n            0\n          ]\n        ],\n        \"monitor_modified\": 1615867200,\n        \"monitor_type\": \"string\",\n        \"name\": \"string\",\n        \"precision\": 2,\n        \"preview\": true,\n        \"sli_value\": 99.99,\n        \"span_precision\": 2,\n        \"uptime\": 99.99\n      }\n    ],\n    \"monitors\": [\n      {\n        \"error_budget_remaining\": {\n          \"7d\": 100\n        },\n        \"errors\": [\n          {\n            \"error_type\": \"\",\n            \"error_message\": \"\"\n          },\n          {\n            \"error_type\": \"\",\n            \"error_message\": \"\"\n          }\n        ],\n        \"group\": \"name\",\n        \"history\": [\n          [\n            1579212382,\n            0\n          ]\n        ],\n        \"monitor_modified\": 1615867200,\n        \"monitor_type\": \"string\",\n        \"name\": \"string\",\n        \"precision\": 2,\n        \"preview\": true,\n        \"sli_value\": 99.99,\n        \"span_precision\": 2,\n        \"uptime\": 99.99\n      },\n      {\n        \"error_budget_remaining\": {\n          \"7d\": 100\n        },\n        \"errors\": [\n          {\n            \"error_type\": \"\",\n            \"error_message\": \"\"\n          },\n          {\n            \"error_type\": \"\",\n            \"error_message\": \"\"\n          }\n        ],\n        \"group\": \"name\",\n        \"history\": [\n          [\n            1579212382,\n            0\n          ]\n        ],\n        \"monitor_modified\": 1615867200,\n        \"monitor_type\": \"string\",\n        \"name\": \"string\",\n        \"precision\": 2,\n        \"preview\": true,\n        \"sli_value\": 99.99,\n        \"span_precision\": 2,\n        \"uptime\": 99.99\n      }\n    ],\n    \"overall\": {\n      \"error_budget_remaining\": {\n        \"7d\": 100\n      },\n      \"errors\": [\n        {\n          \"error_type\": \"\",\n          \"error_message\": \"\"\n        },\n        {\n          \"error_type\": \"\",\n          \"error_message\": \"\"\n        }\n      ],\n      \"group\": \"name\",\n      \"history\": [\n        [\n          1579212382,\n          0\n        ]\n      ],\n      \"monitor_modified\": 1615867200,\n      \"monitor_type\": \"string\",\n      \"name\": \"string\",\n      \"precision\": {\n        \"30d\": 1,\n        \"7d\": 2\n      },\n      \"preview\": true,\n      \"sli_value\": 99.99,\n      \"span_precision\": 2,\n      \"uptime\": 99.99\n    },\n    \"series\": {\n      \"res_type\": \"\",\n      \"interval\": 0,\n      \"resp_version\": 0,\n      \"query\": \"\",\n      \"times\": [],\n      \"numerator\": {\n        \"count\": 0,\n        \"sum\": 0,\n        \"metadata\": {}\n      },\n      \"denominator\": {\n        \"count\": 0,\n        \"sum\": 0,\n        \"metadata\": {}\n      },\n      \"message\": \"\"\n    },\n    \"thresholds\": {\n      \"my_service\": {\n        \"target\": 95,\n        \"timeframe\": \"7d\"\n      }\n    },\n    \"to_ts\": 1615928790,\n    \"type\": \"metric\",\n    \"type_id\": 0\n  },\n  \"errors\": [\n    {\n      \"error\": \"ullamco pariatur\"\n    },\n    {\n      \"error\": \"aliquip anim do laborum commodo\"\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/:slo_id/history?from_ts=-62147425&to_ts=-62147425&target=49.34019051965387&apply_correction=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            ":slo_id",
            "history"
          ],
          "query": [
            {
              "key": "from_ts",
              "value": "-62147425",
              "description": "(Required) The `from` timestamp for the query window in epoch seconds."
            },
            {
              "key": "to_ts",
              "value": "-62147425",
              "description": "(Required) The `to` timestamp for the query window in epoch seconds."
            },
            {
              "key": "target",
              "value": "49.34019051965387",
              "description": "The SLO target. If `target` is passed in, the response will include the remaining error budget and a timeframe value of `custom`."
            },
            {
              "key": "apply_correction",
              "value": "true",
              "description": "Defaults to `true`. If any SLO corrections are applied and this parameter is set to `false`,\nthen the corrections will not be applied and the SLI values will not be affected."
            }
          ],
          "variable": [
            {
              "key": "slo_id"
            }
          ]
        }
      },
      "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/:slo_id/history?from_ts=-62147425&to_ts=-62147425&target=49.34019051965387&apply_correction=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            ":slo_id",
            "history"
          ],
          "query": [
            {
              "key": "from_ts",
              "value": "-62147425",
              "description": "(Required) The `from` timestamp for the query window in epoch seconds."
            },
            {
              "key": "to_ts",
              "value": "-62147425",
              "description": "(Required) The `to` timestamp for the query window in epoch seconds."
            },
            {
              "key": "target",
              "value": "49.34019051965387",
              "description": "The SLO target. If `target` is passed in, the response will include the remaining error budget and a timeframe value of `custom`."
            },
            {
              "key": "apply_correction",
              "value": "true",
              "description": "Defaults to `true`. If any SLO corrections are applied and this parameter is set to `false`,\nthen the corrections will not be applied and the SLI values will not be affected."
            }
          ],
          "variable": [
            {
              "key": "slo_id"
            }
          ]
        }
      },
      "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": "Not Found",
      "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/:slo_id/history?from_ts=-62147425&to_ts=-62147425&target=49.34019051965387&apply_correction=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            ":slo_id",
            "history"
          ],
          "query": [
            {
              "key": "from_ts",
              "value": "-62147425",
              "description": "(Required) The `from` timestamp for the query window in epoch seconds."
            },
            {
              "key": "to_ts",
              "value": "-62147425",
              "description": "(Required) The `to` timestamp for the query window in epoch seconds."
            },
            {
              "key": "target",
              "value": "49.34019051965387",
              "description": "The SLO target. If `target` is passed in, the response will include the remaining error budget and a timeframe value of `custom`."
            },
            {
              "key": "apply_correction",
              "value": "true",
              "description": "Defaults to `true`. If any SLO corrections are applied and this parameter is set to `false`,\nthen the corrections will not be applied and the SLI values will not be affected."
            }
          ],
          "variable": [
            {
              "key": "slo_id"
            }
          ]
        }
      },
      "status": "Not Found",
      "code": 404,
      "_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/:slo_id/history?from_ts=-62147425&to_ts=-62147425&target=49.34019051965387&apply_correction=true",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "slo",
            ":slo_id",
            "history"
          ],
          "query": [
            {
              "key": "from_ts",
              "value": "-62147425",
              "description": "(Required) The `from` timestamp for the query window in epoch seconds."
            },
            {
              "key": "to_ts",
              "value": "-62147425",
              "description": "(Required) The `to` timestamp for the query window in epoch seconds."
            },
            {
              "key": "target",
              "value": "49.34019051965387",
              "description": "The SLO target. If `target` is passed in, the response will include the remaining error budget and a timeframe value of `custom`."
            },
            {
              "key": "apply_correction",
              "value": "true",
              "description": "Defaults to `true`. If any SLO corrections are applied and this parameter is set to `false`,\nthen the corrections will not be applied and the SLI values will not be affected."
            }
          ],
          "variable": [
            {
              "key": "slo_id"
            }
          ]
        }
      },
      "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}"
    }
  ]
}