Back to Collection Items
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoHttp
Boolean iSuccess
Variant vSbResponseBody
Handle hoSbResponseBody
Handle hoJResp
Integer iRespStatusCode
String sDescription
String sV_type
String sStrVal
Boolean iAllow_insecure
String sPassword
String sUsername
String sV_Type
String sBody
String sBodyType
String sCallType
String sContent
String sFilename
String sUpdatedAt
String sKeyContent
String sKeyFilename
String sKeyUpdatedAt
String sCompressedJsonDescriptor
String sDnsServer
Integer iDnsServerPort
Boolean iFollow_redirects
String sProident_69
String sHost
String sMessage
String sDolor_d
String sLabore_7c6
String sSed002
String sMethod
Boolean iNoSavingResponseBody
Integer iNumberOfPackets
Boolean iPersistCookies
Integer iPort
String sV_Url
String sEad
String sServername
String sService
Boolean iShouldTrackHops
String sTimeout
String sRequestUrl
String sCheck_time
Integer iCheck_version
String sProbe_dc
String sCipher
String sExponent
String sFingerprint
String sFingerprint256
String C
String sCN
String L
String O
String sOU
String sST
String sModulus
String sProtocol
String sSerialNumber
String sSubjectC
String sSubjectCN
String sSubjectL
String sSubjectO
String sSubjectOU
String sSubjectST
String sAltName
String sValidFrom
String sValidTo
String sEventType
String sCode
String sFailureMessage
Integer iHttpStatusCode
String sResponseBody
String sDescription
String sUt_270Description
Integer iResponseSize
String sV_Dns
String sDownload
String sFirstByte
String sHandshake
String sRedirect
String sSsl
String sTcp
String sTotal
String sWait
String sResult_id
Integer iStatus
Integer i
Integer iCount_i
String sTemp1
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
Send ComSetRequestHeader To hoHttp "Accept" "application/json"
Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
Send CreateComObject of hoSbResponseBody
End
Get pvComObject of hoSbResponseBody to vSbResponseBody
Get ComQuickGetSb Of hoHttp "https://api.app.ddog-gov.com/api/v1/synthetics/tests/:public_id/results/:result_id" vSbResponseBody To iSuccess
If (iSuccess = False) Begin
Get ComLastErrorText Of hoHttp To sTemp1
Showln sTemp1
Procedure_Return
End
Get Create (RefClass(cComChilkatJsonObject)) To hoJResp
If (Not(IsComObjectCreated(hoJResp))) Begin
Send CreateComObject of hoJResp
End
Get pvComObject of hoSbResponseBody to vSbResponseBody
Get ComLoadSb Of hoJResp vSbResponseBody To iSuccess
Set ComEmitCompact Of hoJResp To False
Showln "Response Body:"
Get ComEmit Of hoJResp To sTemp1
Showln sTemp1
Get ComLastStatus Of hoHttp To iRespStatusCode
Showln "Response Status Code = " iRespStatusCode
If (iRespStatusCode >= 400) Begin
Showln "Response Header:"
Get ComLastHeader Of hoHttp To sTemp1
Showln sTemp1
Showln "Failed."
Procedure_Return
End
// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)
// {
// "check": {
// "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": "proident",
// "bodyType": "text/plain",
// "callType": "unary",
// "certificate": {
// "cert": {
// "content": "reprehenderit labore Ut sed mollit",
// "filename": "Duis consectetur incididunt eiusmod",
// "updatedAt": "aliquip in"
// },
// "key": {
// "content": "consequat sint nulla aute aliquip",
// "filename": "non nisi",
// "updatedAt": "et"
// }
// },
// "compressedJsonDescriptor": "dolore",
// "dnsServer": "elit nostrud in adipisic",
// "dnsServerPort": 60578,
// "follow_redirects": false,
// "headers": {
// "proident_69": "quis dolor occaecat"
// },
// "host": "laborum laboris",
// "message": "aliqua ea laborum laboris",
// "metadata": {
// "dolor_d": "veniam nostrud anim nulla",
// "labore_7c6": "consequat eu",
// "sed002": "Excepteur eiusmod adipisicing"
// },
// "method": "et irure",
// "noSavingResponseBody": false,
// "numberOfPackets": 9,
// "persistCookies": false,
// "port": 99104800,
// "proxy": {
// "url": "https://example.com",
// "headers": {
// "ead": "i"
// }
// },
// "query": {},
// "servername": "cillum enim adipisicing",
// "service": "Greeter",
// "shouldTrackHops": true,
// "timeout": -43666416.92792323,
// "url": "https://example.com"
// },
// "variables": [
// {
// "description": "Example for the variable.",
// "type": "string"
// },
// {
// "description": "Example for the variable.",
// "type": "string"
// }
// ]
// }
// },
// "check_time": -61984290.348021574,
// "check_version": -35585398,
// "probe_dc": "Duis aute",
// "result": {
// "cert": {
// "cipher": "laborum dolore elit reprehenderit",
// "exponent": -97057115.16341409,
// "extKeyUsage": [
// "e",
// "non nulla"
// ],
// "fingerprint": "enim",
// "fingerprint256": "commodo Duis elit culpa",
// "issuer": {
// "C": "id",
// "CN": "dolor esse",
// "L": "Lorem magna",
// "O": "adipisicing ullamco",
// "OU": "nostrud labore",
// "ST": "proident consequat ut"
// },
// "modulus": "ut dolore cupidatat officia",
// "protocol": "cillum dolor commodo sit",
// "serialNumber": "velit",
// "subject": {
// "C": "aliquip ad voluptate",
// "CN": "irure",
// "L": "elit",
// "O": "in",
// "OU": "cillum dolor dolor aliquip nulla",
// "ST": "mollit velit et",
// "altName": "veniam eu mollit irure"
// },
// "validFrom": "1993-10-19T21:25:09.532Z",
// "validTo": "2015-01-05T06:21:16.689Z"
// },
// "eventType": "finished_with_error",
// "failure": {
// "code": "DECRYPTION",
// "message": "Error during DNS resolution (ENOTFOUND)."
// },
// "httpStatusCode": 81890255,
// "requestHeaders": {
// "Ut2": {},
// "ad_29": {}
// },
// "responseBody": "Excepteur laboris Ut dolor",
// "responseHeaders": {
// "ut19b": {
// "description": "Returned request header."
// },
// "Ut_270": {
// "description": "Returned request header."
// }
// },
// "responseSize": -51226186,
// "timings": {
// "dns": 31944439.48881416,
// "download": -87539924.41719314,
// "firstByte": -96589047.25818287,
// "handshake": 84645232.54590705,
// "redirect": -32741896.0310553,
// "ssl": -93300794.33204812,
// "tcp": 65643.03422442079,
// "total": 82914630.9958055,
// "wait": 29723058.510239527
// }
// },
// "result_id": "culpa adipisicing consectetur sit",
// "status": 1
// }
// Sample code for parsing the JSON response...
// Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code
Get ComBoolOf Of hoJResp "check.config.request.allow_insecure" To iAllow_insecure
Get ComStringOf Of hoJResp "check.config.request.basicAuth.password" To sPassword
Get ComStringOf Of hoJResp "check.config.request.basicAuth.username" To sUsername
Get ComStringOf Of hoJResp "check.config.request.basicAuth.type" To sV_Type
Get ComStringOf Of hoJResp "check.config.request.body" To sBody
Get ComStringOf Of hoJResp "check.config.request.bodyType" To sBodyType
Get ComStringOf Of hoJResp "check.config.request.callType" To sCallType
Get ComStringOf Of hoJResp "check.config.request.certificate.cert.content" To sContent
Get ComStringOf Of hoJResp "check.config.request.certificate.cert.filename" To sFilename
Get ComStringOf Of hoJResp "check.config.request.certificate.cert.updatedAt" To sUpdatedAt
Get ComStringOf Of hoJResp "check.config.request.certificate.key.content" To sKeyContent
Get ComStringOf Of hoJResp "check.config.request.certificate.key.filename" To sKeyFilename
Get ComStringOf Of hoJResp "check.config.request.certificate.key.updatedAt" To sKeyUpdatedAt
Get ComStringOf Of hoJResp "check.config.request.compressedJsonDescriptor" To sCompressedJsonDescriptor
Get ComStringOf Of hoJResp "check.config.request.dnsServer" To sDnsServer
Get ComIntOf Of hoJResp "check.config.request.dnsServerPort" To iDnsServerPort
Get ComBoolOf Of hoJResp "check.config.request.follow_redirects" To iFollow_redirects
Get ComStringOf Of hoJResp "check.config.request.headers.proident_69" To sProident_69
Get ComStringOf Of hoJResp "check.config.request.host" To sHost
Get ComStringOf Of hoJResp "check.config.request.message" To sMessage
Get ComStringOf Of hoJResp "check.config.request.metadata.dolor_d" To sDolor_d
Get ComStringOf Of hoJResp "check.config.request.metadata.labore_7c6" To sLabore_7c6
Get ComStringOf Of hoJResp "check.config.request.metadata.sed002" To sSed002
Get ComStringOf Of hoJResp "check.config.request.method" To sMethod
Get ComBoolOf Of hoJResp "check.config.request.noSavingResponseBody" To iNoSavingResponseBody
Get ComIntOf Of hoJResp "check.config.request.numberOfPackets" To iNumberOfPackets
Get ComBoolOf Of hoJResp "check.config.request.persistCookies" To iPersistCookies
Get ComIntOf Of hoJResp "check.config.request.port" To iPort
Get ComStringOf Of hoJResp "check.config.request.proxy.url" To sV_Url
Get ComStringOf Of hoJResp "check.config.request.proxy.headers.ead" To sEad
Get ComStringOf Of hoJResp "check.config.request.servername" To sServername
Get ComStringOf Of hoJResp "check.config.request.service" To sService
Get ComBoolOf Of hoJResp "check.config.request.shouldTrackHops" To iShouldTrackHops
Get ComStringOf Of hoJResp "check.config.request.timeout" To sTimeout
Get ComStringOf Of hoJResp "check.config.request.url" To sRequestUrl
Get ComStringOf Of hoJResp "check_time" To sCheck_time
Get ComIntOf Of hoJResp "check_version" To iCheck_version
Get ComStringOf Of hoJResp "probe_dc" To sProbe_dc
Get ComStringOf Of hoJResp "result.cert.cipher" To sCipher
Get ComStringOf Of hoJResp "result.cert.exponent" To sExponent
Get ComStringOf Of hoJResp "result.cert.fingerprint" To sFingerprint
Get ComStringOf Of hoJResp "result.cert.fingerprint256" To sFingerprint256
Get ComStringOf Of hoJResp "result.cert.issuer.C" To C
Get ComStringOf Of hoJResp "result.cert.issuer.CN" To sCN
Get ComStringOf Of hoJResp "result.cert.issuer.L" To L
Get ComStringOf Of hoJResp "result.cert.issuer.O" To O
Get ComStringOf Of hoJResp "result.cert.issuer.OU" To sOU
Get ComStringOf Of hoJResp "result.cert.issuer.ST" To sST
Get ComStringOf Of hoJResp "result.cert.modulus" To sModulus
Get ComStringOf Of hoJResp "result.cert.protocol" To sProtocol
Get ComStringOf Of hoJResp "result.cert.serialNumber" To sSerialNumber
Get ComStringOf Of hoJResp "result.cert.subject.C" To sSubjectC
Get ComStringOf Of hoJResp "result.cert.subject.CN" To sSubjectCN
Get ComStringOf Of hoJResp "result.cert.subject.L" To sSubjectL
Get ComStringOf Of hoJResp "result.cert.subject.O" To sSubjectO
Get ComStringOf Of hoJResp "result.cert.subject.OU" To sSubjectOU
Get ComStringOf Of hoJResp "result.cert.subject.ST" To sSubjectST
Get ComStringOf Of hoJResp "result.cert.subject.altName" To sAltName
Get ComStringOf Of hoJResp "result.cert.validFrom" To sValidFrom
Get ComStringOf Of hoJResp "result.cert.validTo" To sValidTo
Get ComStringOf Of hoJResp "result.eventType" To sEventType
Get ComStringOf Of hoJResp "result.failure.code" To sCode
Get ComStringOf Of hoJResp "result.failure.message" To sFailureMessage
Get ComIntOf Of hoJResp "result.httpStatusCode" To iHttpStatusCode
Get ComStringOf Of hoJResp "result.responseBody" To sResponseBody
Get ComStringOf Of hoJResp "result.responseHeaders.ut19b.description" To sDescription
Get ComStringOf Of hoJResp "result.responseHeaders.Ut_270.description" To sUt_270Description
Get ComIntOf Of hoJResp "result.responseSize" To iResponseSize
Get ComStringOf Of hoJResp "result.timings.dns" To sV_Dns
Get ComStringOf Of hoJResp "result.timings.download" To sDownload
Get ComStringOf Of hoJResp "result.timings.firstByte" To sFirstByte
Get ComStringOf Of hoJResp "result.timings.handshake" To sHandshake
Get ComStringOf Of hoJResp "result.timings.redirect" To sRedirect
Get ComStringOf Of hoJResp "result.timings.ssl" To sSsl
Get ComStringOf Of hoJResp "result.timings.tcp" To sTcp
Get ComStringOf Of hoJResp "result.timings.total" To sTotal
Get ComStringOf Of hoJResp "result.timings.wait" To sWait
Get ComStringOf Of hoJResp "result_id" To sResult_id
Get ComIntOf Of hoJResp "status" To iStatus
Move 0 To i
Get ComSizeOfArray Of hoJResp "check.config.configVariables" To iCount_i
While (i < iCount_i)
Set ComI Of hoJResp To i
Get ComStringOf Of hoJResp "check.config.configVariables[i].description" To sDescription
Get ComStringOf Of hoJResp "check.config.configVariables[i].type" To sV_type
Move (i + 1) To i
Loop
Move 0 To i
Get ComSizeOfArray Of hoJResp "check.config.variables" To iCount_i
While (i < iCount_i)
Set ComI Of hoJResp To i
Get ComStringOf Of hoJResp "check.config.variables[i].description" To sDescription
Get ComStringOf Of hoJResp "check.config.variables[i].type" To sV_type
Move (i + 1) To i
Loop
Move 0 To i
Get ComSizeOfArray Of hoJResp "result.cert.extKeyUsage" To iCount_i
While (i < iCount_i)
Set ComI Of hoJResp To i
Get ComStringOf Of hoJResp "result.cert.extKeyUsage[i]" To sStrVal
Move (i + 1) To i
Loop
End_Procedure
Curl Command
curl -X GET
-H "Accept: application/json"
https://api.app.ddog-gov.com/api/v1/synthetics/tests/:public_id/results/:result_id
Postman Collection Item JSON
{
"name": "Get an API test result",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/api/v1/synthetics/tests/:public_id/results/:result_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"synthetics",
"tests",
":public_id",
"results",
":result_id"
],
"variable": [
{
"key": "public_id",
"value": "tempor Ut sed velit"
},
{
"key": "result_id",
"value": "tempor Ut sed velit"
}
]
},
"description": "Get a specific full result from a given Synthetic API test."
},
"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/synthetics/tests/:public_id/results/:result_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"synthetics",
"tests",
":public_id",
"results",
":result_id"
],
"variable": [
{
"key": "public_id"
},
{
"key": "result_id"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"cookie": [
],
"body": "{\n \"check\": {\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\": \"proident\",\n \"bodyType\": \"text/plain\",\n \"callType\": \"unary\",\n \"certificate\": {\n \"cert\": {\n \"content\": \"reprehenderit labore Ut sed mollit\",\n \"filename\": \"Duis consectetur incididunt eiusmod\",\n \"updatedAt\": \"aliquip in\"\n },\n \"key\": {\n \"content\": \"consequat sint nulla aute aliquip\",\n \"filename\": \"non nisi\",\n \"updatedAt\": \"et\"\n }\n },\n \"compressedJsonDescriptor\": \"dolore\",\n \"dnsServer\": \"elit nostrud in adipisic\",\n \"dnsServerPort\": 60578,\n \"follow_redirects\": false,\n \"headers\": {\n \"proident_69\": \"quis dolor occaecat\"\n },\n \"host\": \"laborum laboris\",\n \"message\": \"aliqua ea laborum laboris\",\n \"metadata\": {\n \"dolor_d\": \"veniam nostrud anim nulla\",\n \"labore_7c6\": \"consequat eu\",\n \"sed002\": \"Excepteur eiusmod adipisicing\"\n },\n \"method\": \"et irure\",\n \"noSavingResponseBody\": false,\n \"numberOfPackets\": 9,\n \"persistCookies\": false,\n \"port\": 99104800,\n \"proxy\": {\n \"url\": \"https://example.com\",\n \"headers\": {\n \"ead\": \"i\"\n }\n },\n \"query\": {},\n \"servername\": \"cillum enim adipisicing\",\n \"service\": \"Greeter\",\n \"shouldTrackHops\": true,\n \"timeout\": -43666416.92792323,\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 },\n \"check_time\": -61984290.348021574,\n \"check_version\": -35585398,\n \"probe_dc\": \"Duis aute\",\n \"result\": {\n \"cert\": {\n \"cipher\": \"laborum dolore elit reprehenderit\",\n \"exponent\": -97057115.16341409,\n \"extKeyUsage\": [\n \"e\",\n \"non nulla\"\n ],\n \"fingerprint\": \"enim\",\n \"fingerprint256\": \"commodo Duis elit culpa\",\n \"issuer\": {\n \"C\": \"id\",\n \"CN\": \"dolor esse\",\n \"L\": \"Lorem magna\",\n \"O\": \"adipisicing ullamco\",\n \"OU\": \"nostrud labore\",\n \"ST\": \"proident consequat ut\"\n },\n \"modulus\": \"ut dolore cupidatat officia\",\n \"protocol\": \"cillum dolor commodo sit\",\n \"serialNumber\": \"velit\",\n \"subject\": {\n \"C\": \"aliquip ad voluptate\",\n \"CN\": \"irure\",\n \"L\": \"elit\",\n \"O\": \"in\",\n \"OU\": \"cillum dolor dolor aliquip nulla\",\n \"ST\": \"mollit velit et\",\n \"altName\": \"veniam eu mollit irure\"\n },\n \"validFrom\": \"1993-10-19T21:25:09.532Z\",\n \"validTo\": \"2015-01-05T06:21:16.689Z\"\n },\n \"eventType\": \"finished_with_error\",\n \"failure\": {\n \"code\": \"DECRYPTION\",\n \"message\": \"Error during DNS resolution (ENOTFOUND).\"\n },\n \"httpStatusCode\": 81890255,\n \"requestHeaders\": {\n \"Ut2\": {},\n \"ad_29\": {}\n },\n \"responseBody\": \"Excepteur laboris Ut dolor\",\n \"responseHeaders\": {\n \"ut19b\": {\n \"description\": \"Returned request header.\"\n },\n \"Ut_270\": {\n \"description\": \"Returned request header.\"\n }\n },\n \"responseSize\": -51226186,\n \"timings\": {\n \"dns\": 31944439.48881416,\n \"download\": -87539924.41719314,\n \"firstByte\": -96589047.25818287,\n \"handshake\": 84645232.54590705,\n \"redirect\": -32741896.0310553,\n \"ssl\": -93300794.33204812,\n \"tcp\": 65643.03422442079,\n \"total\": 82914630.9958055,\n \"wait\": 29723058.510239527\n }\n },\n \"result_id\": \"culpa adipisicing consectetur sit\",\n \"status\": 1\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/:public_id/results/:result_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"synthetics",
"tests",
":public_id",
"results",
":result_id"
],
"variable": [
{
"key": "public_id"
},
{
"key": "result_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": "- Synthetic Monitoring is not activated for the user\n- Test or result is not owned by 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/:public_id/results/:result_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"synthetics",
"tests",
":public_id",
"results",
":result_id"
],
"variable": [
{
"key": "public_id"
},
{
"key": "result_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/synthetics/tests/:public_id/results/:result_id",
"host": [
"{{baseUrl}}"
],
"path": [
"api",
"v1",
"synthetics",
"tests",
":public_id",
"results",
":result_id"
],
"variable": [
{
"key": "public_id"
},
{
"key": "result_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}"
}
]
}