unicodeC / Datadog API Collection / Get the list of all Synthetic tests
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;
BOOL Allow_insecure;
const wchar_t *Password;
const wchar_t *Username;
const wchar_t *v_Type;
const wchar_t *Body;
const wchar_t *BodyType;
const wchar_t *CallType;
const wchar_t *Content;
const wchar_t *Filename;
const wchar_t *UpdatedAt;
const wchar_t *KeyContent;
const wchar_t *KeyFilename;
const wchar_t *KeyUpdatedAt;
const wchar_t *CompressedJsonDescriptor;
const wchar_t *DnsServer;
int DnsServerPort;
BOOL Follow_redirects;
const wchar_t *Site_;
const wchar_t *Sit1;
const wchar_t *Host;
const wchar_t *Message;
const wchar_t *Pariaturd5f;
const wchar_t *Veniam2;
const wchar_t *Consectetura;
const wchar_t *Method;
BOOL NoSavingResponseBody;
int NumberOfPackets;
BOOL PersistCookies;
int Port;
const wchar_t *v_Url;
const wchar_t *In081;
const wchar_t *Servername;
const wchar_t *Service;
BOOL ShouldTrackHops;
const wchar_t *Timeout;
const wchar_t *RequestUrl;
const wchar_t *v_Email;
const wchar_t *Handle;
const wchar_t *Name;
const wchar_t *message;
int monitor_id;
const wchar_t *name;
BOOL Accept_self_signed;
BOOL optionsAllow_insecure;
BOOL CheckCertificateRevocation;
const wchar_t *ExecutionRule;
BOOL DisableCors;
BOOL DisableCsp;
BOOL optionsFollow_redirects;
const wchar_t *HttpVersion;
BOOL IgnoreServerCertificateError;
int InitialNavigationTimeout;
int Min_failure_duration;
int Min_location_failed;
const wchar_t *Monitor_name;
int Renotify_interval;
int Monitor_priority;
BOOL NoScreenshot;
int Count;
const wchar_t *Interval;
const wchar_t *ApplicationId;
int ClientTokenId;
BOOL IsEnabled;
const wchar_t *Timezone;
int Tick_every;
const wchar_t *public_id;
const wchar_t *status;
const wchar_t *subtype;
const wchar_t *v_type;
const wchar_t *Est_d9d;
const wchar_t *Cupidatat98f;
const wchar_t *Esse_ef4;
const wchar_t *Do_b06;
const wchar_t *Dolore_a5a;
const wchar_t *Irure_15;
const wchar_t *Tempor40;
int j;
int count_j;
const wchar_t *description;
const wchar_t *strVal;
int day;
const wchar_t *from;
const wchar_t *v_to;
BOOL allowFailure;
BOOL isCritical;
BOOL noScreenshot;
int timeout;
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"page_size",L"tempor Ut sed velit");
CkJsonObjectW_UpdateString(queryParams,L"page_number",L"tempor Ut sed velit");
CkHttpW_SetRequestHeader(http,L"Accept",L"application/json");
resp = CkHttpW_QuickRequestParams(http,L"GET",L"https://api.app.ddog-gov.com/api/v1/synthetics/tests",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)
// {
// "tests": [
// {
// "config": {
// "configVariables": [
// {
// "description": "Example for the variable.",
// "type": "string"
// },
// {
// "description": "Example for the variable.",
// "type": "string"
// }
// ],
// "request": {
// "allow_insecure": false,
// "basicAuth": {
// "password": "PaSSw0RD!",
// "username": "my_username",
// "type": "web"
// },
// "body": "nisi elit aute proident minim",
// "bodyType": "text/plain",
// "callType": "unary",
// "certificate": {
// "cert": {
// "content": "Lorem irure",
// "filename": "Excepteur occaecat",
// "updatedAt": "quis exercitation"
// },
// "key": {
// "content": "officia aliquip",
// "filename": "Lorem in sed",
// "updatedAt": "exercitation commodo"
// }
// },
// "compressedJsonDescriptor": "dolore ea reprehenderit ad",
// "dnsServer": "cupida",
// "dnsServerPort": 54877,
// "follow_redirects": true,
// "headers": {
// "site_": "adipisicing ea",
// "sit1": "in incididunt exercitation eu"
// },
// "host": "ipsum",
// "message": "in cupidatat",
// "metadata": {
// "pariaturd5f": "qui sed ullamco et",
// "veniam2": "in ut adipisicing voluptate velit",
// "consectetura": "laborum sed Lorem in"
// },
// "method": "commodo non",
// "noSavingResponseBody": false,
// "numberOfPackets": 6,
// "persistCookies": false,
// "port": 4381428,
// "proxy": {
// "url": "https://example.com",
// "headers": {
// "in081": "exercitation a"
// }
// },
// "query": {},
// "servername": "in",
// "service": "Greeter",
// "shouldTrackHops": false,
// "timeout": -9075364.229425669,
// "url": "https://example.com"
// },
// "variables": [
// {
// "description": "Example for the variable.",
// "type": "string"
// },
// {
// "description": "Example for the variable.",
// "type": "string"
// }
// ]
// },
// "creator": {
// "email": "eiusmod in",
// "handle": "commodo enim",
// "name": "magna do occaeca"
// },
// "locations": [
// "aws:eu-west-3"
// ],
// "message": "velit Lorem amet non",
// "monitor_id": -1212470,
// "name": "esse incididunt consectetur labore",
// "options": {
// "accept_self_signed": false,
// "allow_insecure": false,
// "checkCertificateRevocation": false,
// "ci": {
// "executionRule": "blocking"
// },
// "device_ids": [
// "laptop_large",
// "laptop_large"
// ],
// "disableCors": false,
// "disableCsp": false,
// "follow_redirects": false,
// "httpVersion": "http2",
// "ignoreServerCertificateError": true,
// "initialNavigationTimeout": -13991278,
// "min_failure_duration": -25741137,
// "min_location_failed": 16891533,
// "monitor_name": "veniam occaecat Lorem do",
// "monitor_options": {
// "renotify_interval": 206
// },
// "monitor_priority": 1,
// "noScreenshot": true,
// "restricted_roles": [
// "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
// ],
// "retry": {
// "count": 75644948,
// "interval": 62584402.461459786
// },
// "rumSettings": {
// "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
// "clientTokenId": 12345,
// "isEnabled": true
// },
// "scheduling": {
// "timeframes": [
// {
// "day": 1,
// "from": "07:00",
// "to": "16:00"
// },
// {
// "day": 3,
// "from": "07:00",
// "to": "16:00"
// }
// ],
// "timezone": "America/New_York"
// },
// "tick_every": 276495
// },
// "public_id": "incididunt consequat officia nisi",
// "status": "live",
// "steps": [
// {
// "allowFailure": false,
// "isCritical": false,
// "name": "qui",
// "noScreenshot": false,
// "params": {},
// "timeout": 50285708,
// "type": "assertElementContent"
// },
// {
// "allowFailure": true,
// "isCritical": false,
// "name": "esse minim ullamco occaecat",
// "noScreenshot": true,
// "params": {},
// "timeout": -14507495,
// "type": "assertElementContent"
// }
// ],
// "subtype": "http",
// "tags": [
// "exercitation Ut",
// "esse et sit"
// ],
// "type": "browser"
// },
// {
// "config": {
// "configVariables": [
// {
// "description": "Example for the variable.",
// "type": "string"
// },
// {
// "description": "Example for the variable.",
// "type": "string"
// }
// ],
// "request": {
// "allow_insecure": false,
// "basicAuth": {
// "password": "PaSSw0RD!",
// "username": "my_username",
// "type": "web"
// },
// "body": "voluptate minim",
// "bodyType": "text/plain",
// "callType": "unary",
// "certificate": {
// "cert": {
// "content": "qui Lorem non",
// "filename": "nostrud laboris culpa adipisicing",
// "updatedAt": "et esse cupidatat consectetur do"
// },
// "key": {
// "content": "cupidatat sunt",
// "filename": "pariatur nostru",
// "updatedAt": "Lorem dolor"
// }
// },
// "compressedJsonDescriptor": "aliquip laboris amet",
// "dnsServer": "magna",
// "dnsServerPort": 35750,
// "follow_redirects": false,
// "headers": {
// "est_d9d": "anim",
// "cupidatat98f": "esse"
// },
// "host": "ea esse",
// "message": "consequat ipsum ut Lorem",
// "metadata": {
// "esse_ef4": "commodo",
// "do_b06": "tempor adipisicing dolor",
// "dolore_a5a": "nostrud"
// },
// "method": "laboris",
// "noSavingResponseBody": true,
// "numberOfPackets": 9,
// "persistCookies": true,
// "port": -288377,
// "proxy": {
// "url": "https://example.com",
// "headers": {
// "irure_15": "in",
// "tempor40": "laboris veniam tempor qui nulla"
// }
// },
// "query": {},
// "servername": "ad laborum cupidatat",
// "service": "Greeter",
// "shouldTrackHops": true,
// "timeout": -4889397.044413894,
// "url": "https://example.com"
// },
// "variables": [
// {
// "description": "Example for the variable.",
// "type": "string"
// },
// {
// "description": "Example for the variable.",
// "type": "string"
// }
// ]
// },
// "creator": {
// "email": "in Duis nisi ex",
// "handle": "fugiat sint sed consequa",
// "name": "ipsum ut"
// },
// "locations": [
// "aws:eu-west-3"
// ],
// "message": "Excepteur ipsum exercitat",
// "monitor_id": 17707116,
// "name": "deserunt elit proident Lorem",
// "options": {
// "accept_self_signed": false,
// "allow_insecure": false,
// "checkCertificateRevocation": false,
// "ci": {
// "executionRule": "skipped"
// },
// "device_ids": [
// "laptop_large",
// "laptop_large"
// ],
// "disableCors": false,
// "disableCsp": false,
// "follow_redirects": false,
// "httpVersion": "http1",
// "ignoreServerCertificateError": false,
// "initialNavigationTimeout": 29100273,
// "min_failure_duration": 5817749,
// "min_location_failed": 84916784,
// "monitor_name": "velit quis",
// "monitor_options": {
// "renotify_interval": 427
// },
// "monitor_priority": 1,
// "noScreenshot": false,
// "restricted_roles": [
// "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
// ],
// "retry": {
// "count": 37028687,
// "interval": -23788886.712954804
// },
// "rumSettings": {
// "applicationId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
// "clientTokenId": 12345,
// "isEnabled": true
// },
// "scheduling": {
// "timeframes": [
// {
// "day": 1,
// "from": "07:00",
// "to": "16:00"
// },
// {
// "day": 3,
// "from": "07:00",
// "to": "16:00"
// }
// ],
// "timezone": "America/New_York"
// },
// "tick_every": 256938
// },
// "public_id": "Exc",
// "status": "live",
// "steps": [
// {
// "allowFailure": true,
// "isCritical": true,
// "name": "ipsum conse",
// "noScreenshot": false,
// "params": {},
// "timeout": -75416003,
// "type": "assertElementContent"
// },
// {
// "allowFailure": false,
// "isCritical": false,
// "name": "non do ex",
// "noScreenshot": false,
// "params": {},
// "timeout": -91980592,
// "type": "assertElementContent"
// }
// ],
// "subtype": "http",
// "tags": [
// "fugiat ex amet minim",
// "dolore occaecat ad dolor ex"
// ],
// "type": "api"
// }
// ]
// }
// 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.
i = 0;
count_i = CkJsonObjectW_SizeOfArray(jResp,L"tests");
while (i < count_i) {
CkJsonObjectW_putI(jResp,i);
Allow_insecure = CkJsonObjectW_BoolOf(jResp,L"tests[i].config.request.allow_insecure");
Password = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.basicAuth.password");
Username = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.basicAuth.username");
v_Type = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.basicAuth.type");
Body = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.body");
BodyType = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.bodyType");
CallType = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.callType");
Content = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.certificate.cert.content");
Filename = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.certificate.cert.filename");
UpdatedAt = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.certificate.cert.updatedAt");
KeyContent = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.certificate.key.content");
KeyFilename = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.certificate.key.filename");
KeyUpdatedAt = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.certificate.key.updatedAt");
CompressedJsonDescriptor = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.compressedJsonDescriptor");
DnsServer = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.dnsServer");
DnsServerPort = CkJsonObjectW_IntOf(jResp,L"tests[i].config.request.dnsServerPort");
Follow_redirects = CkJsonObjectW_BoolOf(jResp,L"tests[i].config.request.follow_redirects");
Site_ = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.headers.site_");
Sit1 = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.headers.sit1");
Host = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.host");
Message = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.message");
Pariaturd5f = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.metadata.pariaturd5f");
Veniam2 = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.metadata.veniam2");
Consectetura = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.metadata.consectetura");
Method = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.method");
NoSavingResponseBody = CkJsonObjectW_BoolOf(jResp,L"tests[i].config.request.noSavingResponseBody");
NumberOfPackets = CkJsonObjectW_IntOf(jResp,L"tests[i].config.request.numberOfPackets");
PersistCookies = CkJsonObjectW_BoolOf(jResp,L"tests[i].config.request.persistCookies");
Port = CkJsonObjectW_IntOf(jResp,L"tests[i].config.request.port");
v_Url = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.proxy.url");
In081 = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.proxy.headers.in081");
Servername = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.servername");
Service = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.service");
ShouldTrackHops = CkJsonObjectW_BoolOf(jResp,L"tests[i].config.request.shouldTrackHops");
Timeout = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.timeout");
RequestUrl = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.url");
v_Email = CkJsonObjectW_stringOf(jResp,L"tests[i].creator.email");
Handle = CkJsonObjectW_stringOf(jResp,L"tests[i].creator.handle");
Name = CkJsonObjectW_stringOf(jResp,L"tests[i].creator.name");
message = CkJsonObjectW_stringOf(jResp,L"tests[i].message");
monitor_id = CkJsonObjectW_IntOf(jResp,L"tests[i].monitor_id");
name = CkJsonObjectW_stringOf(jResp,L"tests[i].name");
Accept_self_signed = CkJsonObjectW_BoolOf(jResp,L"tests[i].options.accept_self_signed");
optionsAllow_insecure = CkJsonObjectW_BoolOf(jResp,L"tests[i].options.allow_insecure");
CheckCertificateRevocation = CkJsonObjectW_BoolOf(jResp,L"tests[i].options.checkCertificateRevocation");
ExecutionRule = CkJsonObjectW_stringOf(jResp,L"tests[i].options.ci.executionRule");
DisableCors = CkJsonObjectW_BoolOf(jResp,L"tests[i].options.disableCors");
DisableCsp = CkJsonObjectW_BoolOf(jResp,L"tests[i].options.disableCsp");
optionsFollow_redirects = CkJsonObjectW_BoolOf(jResp,L"tests[i].options.follow_redirects");
HttpVersion = CkJsonObjectW_stringOf(jResp,L"tests[i].options.httpVersion");
IgnoreServerCertificateError = CkJsonObjectW_BoolOf(jResp,L"tests[i].options.ignoreServerCertificateError");
InitialNavigationTimeout = CkJsonObjectW_IntOf(jResp,L"tests[i].options.initialNavigationTimeout");
Min_failure_duration = CkJsonObjectW_IntOf(jResp,L"tests[i].options.min_failure_duration");
Min_location_failed = CkJsonObjectW_IntOf(jResp,L"tests[i].options.min_location_failed");
Monitor_name = CkJsonObjectW_stringOf(jResp,L"tests[i].options.monitor_name");
Renotify_interval = CkJsonObjectW_IntOf(jResp,L"tests[i].options.monitor_options.renotify_interval");
Monitor_priority = CkJsonObjectW_IntOf(jResp,L"tests[i].options.monitor_priority");
NoScreenshot = CkJsonObjectW_BoolOf(jResp,L"tests[i].options.noScreenshot");
Count = CkJsonObjectW_IntOf(jResp,L"tests[i].options.retry.count");
Interval = CkJsonObjectW_stringOf(jResp,L"tests[i].options.retry.interval");
ApplicationId = CkJsonObjectW_stringOf(jResp,L"tests[i].options.rumSettings.applicationId");
ClientTokenId = CkJsonObjectW_IntOf(jResp,L"tests[i].options.rumSettings.clientTokenId");
IsEnabled = CkJsonObjectW_BoolOf(jResp,L"tests[i].options.rumSettings.isEnabled");
Timezone = CkJsonObjectW_stringOf(jResp,L"tests[i].options.scheduling.timezone");
Tick_every = CkJsonObjectW_IntOf(jResp,L"tests[i].options.tick_every");
public_id = CkJsonObjectW_stringOf(jResp,L"tests[i].public_id");
status = CkJsonObjectW_stringOf(jResp,L"tests[i].status");
subtype = CkJsonObjectW_stringOf(jResp,L"tests[i].subtype");
v_type = CkJsonObjectW_stringOf(jResp,L"tests[i].type");
Est_d9d = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.headers.est_d9d");
Cupidatat98f = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.headers.cupidatat98f");
Esse_ef4 = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.metadata.esse_ef4");
Do_b06 = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.metadata.do_b06");
Dolore_a5a = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.metadata.dolore_a5a");
Irure_15 = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.proxy.headers.irure_15");
Tempor40 = CkJsonObjectW_stringOf(jResp,L"tests[i].config.request.proxy.headers.tempor40");
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"tests[i].config.configVariables");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
description = CkJsonObjectW_stringOf(jResp,L"tests[i].config.configVariables[j].description");
v_type = CkJsonObjectW_stringOf(jResp,L"tests[i].config.configVariables[j].type");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"tests[i].config.variables");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
description = CkJsonObjectW_stringOf(jResp,L"tests[i].config.variables[j].description");
v_type = CkJsonObjectW_stringOf(jResp,L"tests[i].config.variables[j].type");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"tests[i].locations");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
strVal = CkJsonObjectW_stringOf(jResp,L"tests[i].locations[j]");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"tests[i].options.device_ids");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
strVal = CkJsonObjectW_stringOf(jResp,L"tests[i].options.device_ids[j]");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"tests[i].options.restricted_roles");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
strVal = CkJsonObjectW_stringOf(jResp,L"tests[i].options.restricted_roles[j]");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"tests[i].options.scheduling.timeframes");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
day = CkJsonObjectW_IntOf(jResp,L"tests[i].options.scheduling.timeframes[j].day");
from = CkJsonObjectW_stringOf(jResp,L"tests[i].options.scheduling.timeframes[j].from");
v_to = CkJsonObjectW_stringOf(jResp,L"tests[i].options.scheduling.timeframes[j].to");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"tests[i].steps");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
allowFailure = CkJsonObjectW_BoolOf(jResp,L"tests[i].steps[j].allowFailure");
isCritical = CkJsonObjectW_BoolOf(jResp,L"tests[i].steps[j].isCritical");
name = CkJsonObjectW_stringOf(jResp,L"tests[i].steps[j].name");
noScreenshot = CkJsonObjectW_BoolOf(jResp,L"tests[i].steps[j].noScreenshot");
timeout = CkJsonObjectW_IntOf(jResp,L"tests[i].steps[j].timeout");
v_type = CkJsonObjectW_stringOf(jResp,L"tests[i].steps[j].type");
j = j + 1;
}
j = 0;
count_j = CkJsonObjectW_SizeOfArray(jResp,L"tests[i].tags");
while (j < count_j) {
CkJsonObjectW_putJ(jResp,j);
strVal = CkJsonObjectW_stringOf(jResp,L"tests[i].tags[j]");
j = j + 1;
}
i = i + 1;
}
CkHttpW_Dispose(http);
CkJsonObjectW_Dispose(queryParams);
CkStringBuilderW_Dispose(sbResponseBody);
CkJsonObjectW_Dispose(jResp);
}
Curl Command
curl -G -d "page_size=tempor%20Ut%20sed%20velit"
-d "page_number=tempor%20Ut%20sed%20velit"
-H "Accept: application/json"
https://api.app.ddog-gov.com/api/v1/synthetics/tests
Postman Collection Item JSON
{
"name": "Get the list of all Synthetic tests",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/v1/synthetics/tests?page_size=tempor Ut sed velit&page_number=tempor Ut sed velit",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"synthetics",
"tests"
],
"query": [
{
"key": "page_size",
"value": "tempor Ut sed velit",
"description": "Used for pagination. The number of tests returned in the page."
},
{
"key": "page_number",
"value": "tempor Ut sed velit",
"description": "Used for pagination. Which page you want to retrieve. Starts at zero."
}
]
},
"description": "Get the list of all Synthetic tests."
},
"response": [
{
"name": "OK - Returns the list of all Synthetic tests.",
"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/synthetics/tests?page_size=tempor Ut sed velit&page_number=tempor Ut sed velit",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"synthetics",
"tests"
],
"query": [
{
"key": "page_size",
"value": "tempor Ut sed velit",
"description": "Used for pagination. The number of tests returned in the page."
},
{
"key": "page_number",
"value": "tempor Ut sed velit",
"description": "Used for pagination. Which page you want to retrieve. Starts at zero."
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"tests\": [\n {\n \"config\": {\n \"configVariables\": [\n {\n \"description\": \"Example for the variable.\",\n \"type\": \"string\"\n },\n {\n \"description\": \"Example for the variable.\",\n \"type\": \"string\"\n }\n ],\n \"request\": {\n \"allow_insecure\": false,\n \"basicAuth\": {\n \"password\": \"PaSSw0RD!\",\n \"username\": \"my_username\",\n \"type\": \"web\"\n },\n \"body\": \"nisi elit aute proident minim\",\n \"bodyType\": \"text/plain\",\n \"callType\": \"unary\",\n \"certificate\": {\n \"cert\": {\n \"content\": \"Lorem irure\",\n \"filename\": \"Excepteur occaecat\",\n \"updatedAt\": \"quis exercitation\"\n },\n \"key\": {\n \"content\": \"officia aliquip\",\n \"filename\": \"Lorem in sed\",\n \"updatedAt\": \"exercitation commodo\"\n }\n },\n \"compressedJsonDescriptor\": \"dolore ea reprehenderit ad\",\n \"dnsServer\": \"cupida\",\n \"dnsServerPort\": 54877,\n \"follow_redirects\": true,\n \"headers\": {\n \"site_\": \"adipisicing ea\",\n \"sit1\": \"in incididunt exercitation eu\"\n },\n \"host\": \"ipsum\",\n \"message\": \"in cupidatat\",\n \"metadata\": {\n \"pariaturd5f\": \"qui sed ullamco et\",\n \"veniam2\": \"in ut adipisicing voluptate velit\",\n \"consectetura\": \"laborum sed Lorem in\"\n },\n \"method\": \"commodo non\",\n \"noSavingResponseBody\": false,\n \"numberOfPackets\": 6,\n \"persistCookies\": false,\n \"port\": 4381428,\n \"proxy\": {\n \"url\": \"https://example.com\",\n \"headers\": {\n \"in081\": \"exercitation a\"\n }\n },\n \"query\": {},\n \"servername\": \"in\",\n \"service\": \"Greeter\",\n \"shouldTrackHops\": false,\n \"timeout\": -9075364.229425669,\n \"url\": \"https://example.com\"\n },\n \"variables\": [\n {\n \"description\": \"Example for the variable.\",\n \"type\": \"string\"\n },\n {\n \"description\": \"Example for the variable.\",\n \"type\": \"string\"\n }\n ]\n },\n \"creator\": {\n \"email\": \"eiusmod in\",\n \"handle\": \"commodo enim\",\n \"name\": \"magna do occaeca\"\n },\n \"locations\": [\n \"aws:eu-west-3\"\n ],\n \"message\": \"velit Lorem amet non\",\n \"monitor_id\": -1212470,\n \"name\": \"esse incididunt consectetur labore\",\n \"options\": {\n \"accept_self_signed\": false,\n \"allow_insecure\": false,\n \"checkCertificateRevocation\": false,\n \"ci\": {\n \"executionRule\": \"blocking\"\n },\n \"device_ids\": [\n \"laptop_large\",\n \"laptop_large\"\n ],\n \"disableCors\": false,\n \"disableCsp\": false,\n \"follow_redirects\": false,\n \"httpVersion\": \"http2\",\n \"ignoreServerCertificateError\": true,\n \"initialNavigationTimeout\": -13991278,\n \"min_failure_duration\": -25741137,\n \"min_location_failed\": 16891533,\n \"monitor_name\": \"veniam occaecat Lorem do\",\n \"monitor_options\": {\n \"renotify_interval\": 206\n },\n \"monitor_priority\": 1,\n \"noScreenshot\": true,\n \"restricted_roles\": [\n \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n ],\n \"retry\": {\n \"count\": 75644948,\n \"interval\": 62584402.461459786\n },\n \"rumSettings\": {\n \"applicationId\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n \"clientTokenId\": 12345,\n \"isEnabled\": true\n },\n \"scheduling\": {\n \"timeframes\": [\n {\n \"day\": 1,\n \"from\": \"07:00\",\n \"to\": \"16:00\"\n },\n {\n \"day\": 3,\n \"from\": \"07:00\",\n \"to\": \"16:00\"\n }\n ],\n \"timezone\": \"America/New_York\"\n },\n \"tick_every\": 276495\n },\n \"public_id\": \"incididunt consequat officia nisi\",\n \"status\": \"live\",\n \"steps\": [\n {\n \"allowFailure\": false,\n \"isCritical\": false,\n \"name\": \"qui\",\n \"noScreenshot\": false,\n \"params\": {},\n \"timeout\": 50285708,\n \"type\": \"assertElementContent\"\n },\n {\n \"allowFailure\": true,\n \"isCritical\": false,\n \"name\": \"esse minim ullamco occaecat\",\n \"noScreenshot\": true,\n \"params\": {},\n \"timeout\": -14507495,\n \"type\": \"assertElementContent\"\n }\n ],\n \"subtype\": \"http\",\n \"tags\": [\n \"exercitation Ut\",\n \"esse et sit\"\n ],\n \"type\": \"browser\"\n },\n {\n \"config\": {\n \"configVariables\": [\n {\n \"description\": \"Example for the variable.\",\n \"type\": \"string\"\n },\n {\n \"description\": \"Example for the variable.\",\n \"type\": \"string\"\n }\n ],\n \"request\": {\n \"allow_insecure\": false,\n \"basicAuth\": {\n \"password\": \"PaSSw0RD!\",\n \"username\": \"my_username\",\n \"type\": \"web\"\n },\n \"body\": \"voluptate minim\",\n \"bodyType\": \"text/plain\",\n \"callType\": \"unary\",\n \"certificate\": {\n \"cert\": {\n \"content\": \"qui Lorem non\",\n \"filename\": \"nostrud laboris culpa adipisicing\",\n \"updatedAt\": \"et esse cupidatat consectetur do\"\n },\n \"key\": {\n \"content\": \"cupidatat sunt\",\n \"filename\": \"pariatur nostru\",\n \"updatedAt\": \"Lorem dolor\"\n }\n },\n \"compressedJsonDescriptor\": \"aliquip laboris amet\",\n \"dnsServer\": \"magna\",\n \"dnsServerPort\": 35750,\n \"follow_redirects\": false,\n \"headers\": {\n \"est_d9d\": \"anim\",\n \"cupidatat98f\": \"esse\"\n },\n \"host\": \"ea esse\",\n \"message\": \"consequat ipsum ut Lorem\",\n \"metadata\": {\n \"esse_ef4\": \"commodo\",\n \"do_b06\": \"tempor adipisicing dolor\",\n \"dolore_a5a\": \"nostrud\"\n },\n \"method\": \"laboris\",\n \"noSavingResponseBody\": true,\n \"numberOfPackets\": 9,\n \"persistCookies\": true,\n \"port\": -288377,\n \"proxy\": {\n \"url\": \"https://example.com\",\n \"headers\": {\n \"irure_15\": \"in\",\n \"tempor40\": \"laboris veniam tempor qui nulla\"\n }\n },\n \"query\": {},\n \"servername\": \"ad laborum cupidatat\",\n \"service\": \"Greeter\",\n \"shouldTrackHops\": true,\n \"timeout\": -4889397.044413894,\n \"url\": \"https://example.com\"\n },\n \"variables\": [\n {\n \"description\": \"Example for the variable.\",\n \"type\": \"string\"\n },\n {\n \"description\": \"Example for the variable.\",\n \"type\": \"string\"\n }\n ]\n },\n \"creator\": {\n \"email\": \"in Duis nisi ex\",\n \"handle\": \"fugiat sint sed consequa\",\n \"name\": \"ipsum ut\"\n },\n \"locations\": [\n \"aws:eu-west-3\"\n ],\n \"message\": \"Excepteur ipsum exercitat\",\n \"monitor_id\": 17707116,\n \"name\": \"deserunt elit proident Lorem\",\n \"options\": {\n \"accept_self_signed\": false,\n \"allow_insecure\": false,\n \"checkCertificateRevocation\": false,\n \"ci\": {\n \"executionRule\": \"skipped\"\n },\n \"device_ids\": [\n \"laptop_large\",\n \"laptop_large\"\n ],\n \"disableCors\": false,\n \"disableCsp\": false,\n \"follow_redirects\": false,\n \"httpVersion\": \"http1\",\n \"ignoreServerCertificateError\": false,\n \"initialNavigationTimeout\": 29100273,\n \"min_failure_duration\": 5817749,\n \"min_location_failed\": 84916784,\n \"monitor_name\": \"velit quis\",\n \"monitor_options\": {\n \"renotify_interval\": 427\n },\n \"monitor_priority\": 1,\n \"noScreenshot\": false,\n \"restricted_roles\": [\n \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n ],\n \"retry\": {\n \"count\": 37028687,\n \"interval\": -23788886.712954804\n },\n \"rumSettings\": {\n \"applicationId\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\",\n \"clientTokenId\": 12345,\n \"isEnabled\": true\n },\n \"scheduling\": {\n \"timeframes\": [\n {\n \"day\": 1,\n \"from\": \"07:00\",\n \"to\": \"16:00\"\n },\n {\n \"day\": 3,\n \"from\": \"07:00\",\n \"to\": \"16:00\"\n }\n ],\n \"timezone\": \"America/New_York\"\n },\n \"tick_every\": 256938\n },\n \"public_id\": \"Exc\",\n \"status\": \"live\",\n \"steps\": [\n {\n \"allowFailure\": true,\n \"isCritical\": true,\n \"name\": \"ipsum conse\",\n \"noScreenshot\": false,\n \"params\": {},\n \"timeout\": -75416003,\n \"type\": \"assertElementContent\"\n },\n {\n \"allowFailure\": false,\n \"isCritical\": false,\n \"name\": \"non do ex\",\n \"noScreenshot\": false,\n \"params\": {},\n \"timeout\": -91980592,\n \"type\": \"assertElementContent\"\n }\n ],\n \"subtype\": \"http\",\n \"tags\": [\n \"fugiat ex amet minim\",\n \"dolore occaecat ad dolor ex\"\n ],\n \"type\": \"api\"\n }\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/synthetics/tests?page_size=tempor Ut sed velit&page_number=tempor Ut sed velit",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"synthetics",
"tests"
],
"query": [
{
"key": "page_size",
"value": "tempor Ut sed velit",
"description": "Used for pagination. The number of tests returned in the page."
},
{
"key": "page_number",
"value": "tempor Ut sed velit",
"description": "Used for pagination. Which page you want to retrieve. Starts at zero."
}
]
}
},
"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": "Synthetic Monitoring is not activated for the user.",
"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/synthetics/tests?page_size=tempor Ut sed velit&page_number=tempor Ut sed velit",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"synthetics",
"tests"
],
"query": [
{
"key": "page_size",
"value": "tempor Ut sed velit",
"description": "Used for pagination. The number of tests returned in the page."
},
{
"key": "page_number",
"value": "tempor Ut sed velit",
"description": "Used for pagination. Which page you want to retrieve. Starts at zero."
}
]
}
},
"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/synthetics/tests?page_size=tempor Ut sed velit&page_number=tempor Ut sed velit",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"synthetics",
"tests"
],
"query": [
{
"key": "page_size",
"value": "tempor Ut sed velit",
"description": "Used for pagination. The number of tests returned in the page."
},
{
"key": "page_number",
"value": "tempor Ut sed velit",
"description": "Used for pagination. Which page you want to retrieve. Starts at zero."
}
]
}
},
"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}"
}
]
}