Chilkat Online Tools

Foxpro / Datadog API Collection / Edit an API test

Back to Collection Items

LOCAL loHttp
LOCAL lnSuccess
LOCAL loJson
LOCAL loSbRequestBody
LOCAL loResp
LOCAL loSbResponseBody
LOCAL loJResp
LOCAL lnRespStatusCode
LOCAL lcOperator
LOCAL lnTarget
LOCAL lcStrVal
LOCAL lnDay
LOCAL lcFrom
LOCAL lcV_to
LOCAL lcName
LOCAL lcMethod
LOCAL lcV_Url
LOCAL lnAccept_self_signed
LOCAL lnAllow_insecure
LOCAL lnCheckCertificateRevocation
LOCAL lcExecutionRule
LOCAL lnDisableCors
LOCAL lnDisableCsp
LOCAL lnFollow_redirects
LOCAL lcHttpVersion
LOCAL lnIgnoreServerCertificateError
LOCAL lnInitialNavigationTimeout
LOCAL lnMin_failure_duration
LOCAL lnMin_location_failed
LOCAL lcMonitor_name
LOCAL lnRenotify_interval
LOCAL lnMonitor_priority
LOCAL lnNoScreenshot
LOCAL lnCount
LOCAL lcInterval
LOCAL lcApplicationId
LOCAL lnClientTokenId
LOCAL lnIsEnabled
LOCAL lcTimezone
LOCAL lnTick_every
LOCAL lcV_type
LOCAL lcMessage
LOCAL lnMonitor_id
LOCAL lcPublic_id
LOCAL lcStatus
LOCAL lcSubtype
LOCAL i
LOCAL lnCount_i

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

loHttp = CreateObject('Chilkat_9_5_0.Http')

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

* The following JSON is sent in the request body.

* {
*   "name": "Example test name",
*   "config": {
*     "assertions": [
*       {
*         "operator": "lessThan",
*         "target": 1000,
*         "type": "responseTime"
*       }
*     ],
*     "request": {
*       "method": "GET",
*       "url": "https://example.com"
*     }
*   },
*   "locations": [
*     "aws:eu-west-3"
*   ],
*   "options": {
*     "accept_self_signed": true,
*     "allow_insecure": true,
*     "checkCertificateRevocation": true,
*     "ci": {
*       "executionRule": "non_blocking"
*     },
*     "device_ids": [
*       "laptop_large",
*       "laptop_large"
*     ],
*     "disableCors": false,
*     "disableCsp": false,
*     "follow_redirects": true,
*     "httpVersion": "http1",
*     "ignoreServerCertificateError": false,
*     "initialNavigationTimeout": 87780679,
*     "min_failure_duration": -32472759,
*     "min_location_failed": -5806955,
*     "monitor_name": "et deserunt ",
*     "monitor_options": {
*       "renotify_interval": 834
*     },
*     "monitor_priority": 3,
*     "noScreenshot": false,
*     "restricted_roles": [
*       "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
*     ],
*     "retry": {
*       "count": -50657150,
*       "interval": -91565669.0691471
*     },
*     "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": 384020
*   },
*   "type": "api",
*   "message": "Notification message",
*   "monitor_id": 12345678,
*   "public_id": "123-abc-456",
*   "status": "live",
*   "subtype": "http",
*   "tags": [
*     "env:production"
*   ]
* }

loJson = CreateObject('Chilkat_9_5_0.JsonObject')
loJson.UpdateString("name","Example test name")
loJson.UpdateString("config.assertions[0].operator","lessThan")
loJson.UpdateInt("config.assertions[0].target",1000)
loJson.UpdateString("config.assertions[0].type","responseTime")
loJson.UpdateString("config.request.method","GET")
loJson.UpdateString("config.request.url","https://example.com")
loJson.UpdateString("locations[0]","aws:eu-west-3")
loJson.UpdateBool("options.accept_self_signed",1)
loJson.UpdateBool("options.allow_insecure",1)
loJson.UpdateBool("options.checkCertificateRevocation",1)
loJson.UpdateString("options.ci.executionRule","non_blocking")
loJson.UpdateString("options.device_ids[0]","laptop_large")
loJson.UpdateString("options.device_ids[1]","laptop_large")
loJson.UpdateBool("options.disableCors",0)
loJson.UpdateBool("options.disableCsp",0)
loJson.UpdateBool("options.follow_redirects",1)
loJson.UpdateString("options.httpVersion","http1")
loJson.UpdateBool("options.ignoreServerCertificateError",0)
loJson.UpdateInt("options.initialNavigationTimeout",87780679)
loJson.UpdateInt("options.min_failure_duration",-32472759)
loJson.UpdateInt("options.min_location_failed",-5806955)
loJson.UpdateString("options.monitor_name","et deserunt ")
loJson.UpdateInt("options.monitor_options.renotify_interval",834)
loJson.UpdateInt("options.monitor_priority",3)
loJson.UpdateBool("options.noScreenshot",0)
loJson.UpdateString("options.restricted_roles[0]","xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
loJson.UpdateInt("options.retry.count",-50657150)
loJson.UpdateNumber("options.retry.interval","-91565669.0691471")
loJson.UpdateString("options.rumSettings.applicationId","xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
loJson.UpdateInt("options.rumSettings.clientTokenId",12345)
loJson.UpdateBool("options.rumSettings.isEnabled",1)
loJson.UpdateInt("options.scheduling.timeframes[0].day",1)
loJson.UpdateString("options.scheduling.timeframes[0].from","07:00")
loJson.UpdateString("options.scheduling.timeframes[0].to","16:00")
loJson.UpdateInt("options.scheduling.timeframes[1].day",3)
loJson.UpdateString("options.scheduling.timeframes[1].from","07:00")
loJson.UpdateString("options.scheduling.timeframes[1].to","16:00")
loJson.UpdateString("options.scheduling.timezone","America/New_York")
loJson.UpdateInt("options.tick_every",384020)
loJson.UpdateString("type","api")
loJson.UpdateString("message","Notification message")
loJson.UpdateInt("monitor_id",12345678)
loJson.UpdateString("public_id","123-abc-456")
loJson.UpdateString("status","live")
loJson.UpdateString("subtype","http")
loJson.UpdateString("tags[0]","env:production")

loHttp.SetRequestHeader("Content-Type","application/json")
loHttp.SetRequestHeader("Accept","application/json")

loSbRequestBody = CreateObject('Chilkat_9_5_0.StringBuilder')
loJson.EmitSb(loSbRequestBody)

loResp = loHttp.PTextSb("PUT","https://api.app.ddog-gov.com/api/v1/synthetics/tests/api/:public_id",loSbRequestBody,"utf-8","application/json",0,0)
IF (loHttp.LastMethodSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loJson
    RELEASE loSbRequestBody
    CANCEL
ENDIF

loSbResponseBody = CreateObject('Chilkat_9_5_0.StringBuilder')
loResp.GetBodySb(loSbResponseBody)

loJResp = CreateObject('Chilkat_9_5_0.JsonObject')
loJResp.LoadSb(loSbResponseBody)
loJResp.EmitCompact = 0

? "Response Body:"
? loJResp.Emit()

lnRespStatusCode = loResp.StatusCode
? "Response Status Code = " + STR(lnRespStatusCode)
IF (lnRespStatusCode >= 400) THEN
    ? "Response Header:"
    ? loResp.Header
    ? "Failed."
    RELEASE loResp
    RELEASE loHttp
    RELEASE loJson
    RELEASE loSbRequestBody
    RELEASE loSbResponseBody
    RELEASE loJResp
    CANCEL
ENDIF

RELEASE loResp

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

* {
*   "name": "Example test name",
*   "config": {
*     "assertions": [
*       {
*         "operator": "lessThan",
*         "target": 1000,
*         "type": "responseTime"
*       }
*     ],
*     "request": {
*       "method": "GET",
*       "url": "https://example.com"
*     }
*   },
*   "locations": [
*     "aws:eu-west-3"
*   ],
*   "options": {
*     "accept_self_signed": true,
*     "allow_insecure": true,
*     "checkCertificateRevocation": true,
*     "ci": {
*       "executionRule": "non_blocking"
*     },
*     "device_ids": [
*       "laptop_large",
*       "laptop_large"
*     ],
*     "disableCors": false,
*     "disableCsp": false,
*     "follow_redirects": true,
*     "httpVersion": "http1",
*     "ignoreServerCertificateError": false,
*     "initialNavigationTimeout": 87780679,
*     "min_failure_duration": -32472759,
*     "min_location_failed": -5806955,
*     "monitor_name": "et deserunt ",
*     "monitor_options": {
*       "renotify_interval": 834
*     },
*     "monitor_priority": 3,
*     "noScreenshot": false,
*     "restricted_roles": [
*       "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
*     ],
*     "retry": {
*       "count": -50657150,
*       "interval": -91565669.0691471
*     },
*     "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": 384020
*   },
*   "type": "api",
*   "message": "Notification message",
*   "monitor_id": 12345678,
*   "public_id": "123-abc-456",
*   "status": "live",
*   "subtype": "http",
*   "tags": [
*     "env:production"
*   ]
* }

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

lcName = loJResp.StringOf("name")
lcMethod = loJResp.StringOf("config.request.method")
lcV_Url = loJResp.StringOf("config.request.url")
lnAccept_self_signed = loJResp.BoolOf("options.accept_self_signed")
lnAllow_insecure = loJResp.BoolOf("options.allow_insecure")
lnCheckCertificateRevocation = loJResp.BoolOf("options.checkCertificateRevocation")
lcExecutionRule = loJResp.StringOf("options.ci.executionRule")
lnDisableCors = loJResp.BoolOf("options.disableCors")
lnDisableCsp = loJResp.BoolOf("options.disableCsp")
lnFollow_redirects = loJResp.BoolOf("options.follow_redirects")
lcHttpVersion = loJResp.StringOf("options.httpVersion")
lnIgnoreServerCertificateError = loJResp.BoolOf("options.ignoreServerCertificateError")
lnInitialNavigationTimeout = loJResp.IntOf("options.initialNavigationTimeout")
lnMin_failure_duration = loJResp.IntOf("options.min_failure_duration")
lnMin_location_failed = loJResp.IntOf("options.min_location_failed")
lcMonitor_name = loJResp.StringOf("options.monitor_name")
lnRenotify_interval = loJResp.IntOf("options.monitor_options.renotify_interval")
lnMonitor_priority = loJResp.IntOf("options.monitor_priority")
lnNoScreenshot = loJResp.BoolOf("options.noScreenshot")
lnCount = loJResp.IntOf("options.retry.count")
lcInterval = loJResp.StringOf("options.retry.interval")
lcApplicationId = loJResp.StringOf("options.rumSettings.applicationId")
lnClientTokenId = loJResp.IntOf("options.rumSettings.clientTokenId")
lnIsEnabled = loJResp.BoolOf("options.rumSettings.isEnabled")
lcTimezone = loJResp.StringOf("options.scheduling.timezone")
lnTick_every = loJResp.IntOf("options.tick_every")
lcV_type = loJResp.StringOf("type")
lcMessage = loJResp.StringOf("message")
lnMonitor_id = loJResp.IntOf("monitor_id")
lcPublic_id = loJResp.StringOf("public_id")
lcStatus = loJResp.StringOf("status")
lcSubtype = loJResp.StringOf("subtype")
i = 0
lnCount_i = loJResp.SizeOfArray("config.assertions")
DO WHILE i < lnCount_i
    loJResp.I = i
    lcOperator = loJResp.StringOf("config.assertions[i].operator")
    lnTarget = loJResp.IntOf("config.assertions[i].target")
    lcV_type = loJResp.StringOf("config.assertions[i].type")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJResp.SizeOfArray("locations")
DO WHILE i < lnCount_i
    loJResp.I = i
    lcStrVal = loJResp.StringOf("locations[i]")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJResp.SizeOfArray("options.device_ids")
DO WHILE i < lnCount_i
    loJResp.I = i
    lcStrVal = loJResp.StringOf("options.device_ids[i]")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJResp.SizeOfArray("options.restricted_roles")
DO WHILE i < lnCount_i
    loJResp.I = i
    lcStrVal = loJResp.StringOf("options.restricted_roles[i]")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJResp.SizeOfArray("options.scheduling.timeframes")
DO WHILE i < lnCount_i
    loJResp.I = i
    lnDay = loJResp.IntOf("options.scheduling.timeframes[i].day")
    lcFrom = loJResp.StringOf("options.scheduling.timeframes[i].from")
    lcV_to = loJResp.StringOf("options.scheduling.timeframes[i].to")
    i = i + 1
ENDDO
i = 0
lnCount_i = loJResp.SizeOfArray("tags")
DO WHILE i < lnCount_i
    loJResp.I = i
    lcStrVal = loJResp.StringOf("tags[i]")
    i = i + 1
ENDDO

RELEASE loHttp
RELEASE loJson
RELEASE loSbRequestBody
RELEASE loSbResponseBody
RELEASE loJResp

Curl Command

curl -X PUT
	-H "Content-Type: application/json"
	-H "Accept: application/json"
	-d '{
  "name": "Example test name",
  "config": {
    "assertions": [
      {
        "operator": "lessThan",
        "target": 1000,
        "type": "responseTime"
      }
    ],
    "request": {
      "method": "GET",
      "url": "https://example.com"
    }
  },
  "locations": [
    "aws:eu-west-3"
  ],
  "options": {
    "accept_self_signed": true,
    "allow_insecure": true,
    "checkCertificateRevocation": true,
    "ci": {
      "executionRule": "non_blocking"
    },
    "device_ids": [
      "laptop_large",
      "laptop_large"
    ],
    "disableCors": false,
    "disableCsp": false,
    "follow_redirects": true,
    "httpVersion": "http1",
    "ignoreServerCertificateError": false,
    "initialNavigationTimeout": 87780679,
    "min_failure_duration": -32472759,
    "min_location_failed": -5806955,
    "monitor_name": "et deserunt ",
    "monitor_options": {
      "renotify_interval": 834
    },
    "monitor_priority": 3,
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": -50657150,
      "interval": -91565669.0691471
    },
    "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": 384020
  },
  "type": "api",
  "message": "Notification message",
  "monitor_id": 12345678,
  "public_id": "123-abc-456",
  "status": "live",
  "subtype": "http",
  "tags": [
    "env:production"
  ]
}'
https://api.app.ddog-gov.com/api/v1/synthetics/tests/api/:public_id

Postman Collection Item JSON

{
  "name": "Edit an API test",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n  \"name\": \"Example test name\",\n  \"config\": {\n    \"assertions\": [\n      {\n        \"operator\": \"lessThan\",\n        \"target\": 1000,\n        \"type\": \"responseTime\"\n      }\n    ],\n    \"request\": {\n      \"method\": \"GET\",\n      \"url\": \"https://example.com\"\n    }\n  },\n  \"locations\": [\n    \"aws:eu-west-3\"\n  ],\n  \"options\": {\n    \"accept_self_signed\": true,\n    \"allow_insecure\": true,\n    \"checkCertificateRevocation\": true,\n    \"ci\": {\n      \"executionRule\": \"non_blocking\"\n    },\n    \"device_ids\": [\n      \"laptop_large\",\n      \"laptop_large\"\n    ],\n    \"disableCors\": false,\n    \"disableCsp\": false,\n    \"follow_redirects\": true,\n    \"httpVersion\": \"http1\",\n    \"ignoreServerCertificateError\": false,\n    \"initialNavigationTimeout\": 87780679,\n    \"min_failure_duration\": -32472759,\n    \"min_location_failed\": -5806955,\n    \"monitor_name\": \"et deserunt \",\n    \"monitor_options\": {\n      \"renotify_interval\": 834\n    },\n    \"monitor_priority\": 3,\n    \"noScreenshot\": false,\n    \"restricted_roles\": [\n      \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n    ],\n    \"retry\": {\n      \"count\": -50657150,\n      \"interval\": -91565669.0691471\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\": 384020\n  },\n  \"type\": \"api\",\n  \"message\": \"Notification message\",\n  \"monitor_id\": 12345678,\n  \"public_id\": \"123-abc-456\",\n  \"status\": \"live\",\n  \"subtype\": \"http\",\n  \"tags\": [\n    \"env:production\"\n  ]\n}",
      "options": {
        "raw": {
          "headerFamily": "json",
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{baseUrl}}/api/v1/synthetics/tests/api/:public_id",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v1",
        "synthetics",
        "tests",
        "api",
        ":public_id"
      ],
      "variable": [
        {
          "key": "public_id",
          "value": "tempor Ut sed velit"
        }
      ]
    },
    "description": "Edit the configuration of a Synthetic API test."
  },
  "response": [
    {
      "name": "OK",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Example test name\",\n  \"config\": {\n    \"assertions\": [\n      {\n        \"operator\": \"lessThan\",\n        \"target\": 1000,\n        \"type\": \"responseTime\"\n      }\n    ],\n    \"request\": {\n      \"method\": \"GET\",\n      \"url\": \"https://example.com\"\n    }\n  },\n  \"locations\": [\n    \"aws:eu-west-3\"\n  ],\n  \"options\": {\n    \"accept_self_signed\": true,\n    \"allow_insecure\": true,\n    \"checkCertificateRevocation\": true,\n    \"ci\": {\n      \"executionRule\": \"non_blocking\"\n    },\n    \"device_ids\": [\n      \"laptop_large\",\n      \"laptop_large\"\n    ],\n    \"disableCors\": false,\n    \"disableCsp\": false,\n    \"follow_redirects\": true,\n    \"httpVersion\": \"http1\",\n    \"ignoreServerCertificateError\": false,\n    \"initialNavigationTimeout\": 87780679,\n    \"min_failure_duration\": -32472759,\n    \"min_location_failed\": -5806955,\n    \"monitor_name\": \"et deserunt \",\n    \"monitor_options\": {\n      \"renotify_interval\": 834\n    },\n    \"monitor_priority\": 3,\n    \"noScreenshot\": false,\n    \"restricted_roles\": [\n      \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n    ],\n    \"retry\": {\n      \"count\": -50657150,\n      \"interval\": -91565669.0691471\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\": 384020\n  },\n  \"type\": \"api\",\n  \"message\": \"Notification message\",\n  \"monitor_id\": 12345678,\n  \"public_id\": \"123-abc-456\",\n  \"status\": \"live\",\n  \"subtype\": \"http\",\n  \"tags\": [\n    \"env:production\"\n  ]\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/synthetics/tests/api/:public_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "synthetics",
            "tests",
            "api",
            ":public_id"
          ],
          "variable": [
            {
              "key": "public_id"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"name\": \"Example test name\",\n  \"config\": {\n    \"assertions\": [\n      {\n        \"operator\": \"lessThan\",\n        \"target\": 1000,\n        \"type\": \"responseTime\"\n      }\n    ],\n    \"request\": {\n      \"method\": \"GET\",\n      \"url\": \"https://example.com\"\n    }\n  },\n  \"locations\": [\n    \"aws:eu-west-3\"\n  ],\n  \"options\": {\n    \"accept_self_signed\": true,\n    \"allow_insecure\": true,\n    \"checkCertificateRevocation\": true,\n    \"ci\": {\n      \"executionRule\": \"non_blocking\"\n    },\n    \"device_ids\": [\n      \"laptop_large\",\n      \"laptop_large\"\n    ],\n    \"disableCors\": false,\n    \"disableCsp\": false,\n    \"follow_redirects\": true,\n    \"httpVersion\": \"http1\",\n    \"ignoreServerCertificateError\": false,\n    \"initialNavigationTimeout\": 87780679,\n    \"min_failure_duration\": -32472759,\n    \"min_location_failed\": -5806955,\n    \"monitor_name\": \"et deserunt \",\n    \"monitor_options\": {\n      \"renotify_interval\": 834\n    },\n    \"monitor_priority\": 3,\n    \"noScreenshot\": false,\n    \"restricted_roles\": [\n      \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n    ],\n    \"retry\": {\n      \"count\": -50657150,\n      \"interval\": -91565669.0691471\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\": 384020\n  },\n  \"type\": \"api\",\n  \"message\": \"Notification message\",\n  \"monitor_id\": 12345678,\n  \"public_id\": \"123-abc-456\",\n  \"status\": \"live\",\n  \"subtype\": \"http\",\n  \"tags\": [\n    \"env:production\"\n  ]\n}"
    },
    {
      "name": "- JSON format is wrong\n- Updating sub-type is forbidden",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Example test name\",\n  \"config\": {\n    \"assertions\": [\n      {\n        \"operator\": \"lessThan\",\n        \"target\": 1000,\n        \"type\": \"responseTime\"\n      }\n    ],\n    \"request\": {\n      \"method\": \"GET\",\n      \"url\": \"https://example.com\"\n    }\n  },\n  \"locations\": [\n    \"aws:eu-west-3\"\n  ],\n  \"options\": {\n    \"accept_self_signed\": true,\n    \"allow_insecure\": true,\n    \"checkCertificateRevocation\": true,\n    \"ci\": {\n      \"executionRule\": \"non_blocking\"\n    },\n    \"device_ids\": [\n      \"laptop_large\",\n      \"laptop_large\"\n    ],\n    \"disableCors\": false,\n    \"disableCsp\": false,\n    \"follow_redirects\": true,\n    \"httpVersion\": \"http1\",\n    \"ignoreServerCertificateError\": false,\n    \"initialNavigationTimeout\": 87780679,\n    \"min_failure_duration\": -32472759,\n    \"min_location_failed\": -5806955,\n    \"monitor_name\": \"et deserunt \",\n    \"monitor_options\": {\n      \"renotify_interval\": 834\n    },\n    \"monitor_priority\": 3,\n    \"noScreenshot\": false,\n    \"restricted_roles\": [\n      \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n    ],\n    \"retry\": {\n      \"count\": -50657150,\n      \"interval\": -91565669.0691471\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\": 384020\n  },\n  \"type\": \"api\",\n  \"message\": \"Notification message\",\n  \"monitor_id\": 12345678,\n  \"public_id\": \"123-abc-456\",\n  \"status\": \"live\",\n  \"subtype\": \"http\",\n  \"tags\": [\n    \"env:production\"\n  ]\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/synthetics/tests/api/:public_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "synthetics",
            "tests",
            "api",
            ":public_id"
          ],
          "variable": [
            {
              "key": "public_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": "PUT",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Example test name\",\n  \"config\": {\n    \"assertions\": [\n      {\n        \"operator\": \"lessThan\",\n        \"target\": 1000,\n        \"type\": \"responseTime\"\n      }\n    ],\n    \"request\": {\n      \"method\": \"GET\",\n      \"url\": \"https://example.com\"\n    }\n  },\n  \"locations\": [\n    \"aws:eu-west-3\"\n  ],\n  \"options\": {\n    \"accept_self_signed\": true,\n    \"allow_insecure\": true,\n    \"checkCertificateRevocation\": true,\n    \"ci\": {\n      \"executionRule\": \"non_blocking\"\n    },\n    \"device_ids\": [\n      \"laptop_large\",\n      \"laptop_large\"\n    ],\n    \"disableCors\": false,\n    \"disableCsp\": false,\n    \"follow_redirects\": true,\n    \"httpVersion\": \"http1\",\n    \"ignoreServerCertificateError\": false,\n    \"initialNavigationTimeout\": 87780679,\n    \"min_failure_duration\": -32472759,\n    \"min_location_failed\": -5806955,\n    \"monitor_name\": \"et deserunt \",\n    \"monitor_options\": {\n      \"renotify_interval\": 834\n    },\n    \"monitor_priority\": 3,\n    \"noScreenshot\": false,\n    \"restricted_roles\": [\n      \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n    ],\n    \"retry\": {\n      \"count\": -50657150,\n      \"interval\": -91565669.0691471\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\": 384020\n  },\n  \"type\": \"api\",\n  \"message\": \"Notification message\",\n  \"monitor_id\": 12345678,\n  \"public_id\": \"123-abc-456\",\n  \"status\": \"live\",\n  \"subtype\": \"http\",\n  \"tags\": [\n    \"env:production\"\n  ]\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/synthetics/tests/api/:public_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "synthetics",
            "tests",
            "api",
            ":public_id"
          ],
          "variable": [
            {
              "key": "public_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 is not owned by the user\n- Test can't be found",
      "originalRequest": {
        "method": "PUT",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Example test name\",\n  \"config\": {\n    \"assertions\": [\n      {\n        \"operator\": \"lessThan\",\n        \"target\": 1000,\n        \"type\": \"responseTime\"\n      }\n    ],\n    \"request\": {\n      \"method\": \"GET\",\n      \"url\": \"https://example.com\"\n    }\n  },\n  \"locations\": [\n    \"aws:eu-west-3\"\n  ],\n  \"options\": {\n    \"accept_self_signed\": true,\n    \"allow_insecure\": true,\n    \"checkCertificateRevocation\": true,\n    \"ci\": {\n      \"executionRule\": \"non_blocking\"\n    },\n    \"device_ids\": [\n      \"laptop_large\",\n      \"laptop_large\"\n    ],\n    \"disableCors\": false,\n    \"disableCsp\": false,\n    \"follow_redirects\": true,\n    \"httpVersion\": \"http1\",\n    \"ignoreServerCertificateError\": false,\n    \"initialNavigationTimeout\": 87780679,\n    \"min_failure_duration\": -32472759,\n    \"min_location_failed\": -5806955,\n    \"monitor_name\": \"et deserunt \",\n    \"monitor_options\": {\n      \"renotify_interval\": 834\n    },\n    \"monitor_priority\": 3,\n    \"noScreenshot\": false,\n    \"restricted_roles\": [\n      \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n    ],\n    \"retry\": {\n      \"count\": -50657150,\n      \"interval\": -91565669.0691471\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\": 384020\n  },\n  \"type\": \"api\",\n  \"message\": \"Notification message\",\n  \"monitor_id\": 12345678,\n  \"public_id\": \"123-abc-456\",\n  \"status\": \"live\",\n  \"subtype\": \"http\",\n  \"tags\": [\n    \"env:production\"\n  ]\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/synthetics/tests/api/:public_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "synthetics",
            "tests",
            "api",
            ":public_id"
          ],
          "variable": [
            {
              "key": "public_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": "PUT",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "description": "Added as a part of security scheme: apikey",
            "key": "DD-API-KEY",
            "value": "<API Key>"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"name\": \"Example test name\",\n  \"config\": {\n    \"assertions\": [\n      {\n        \"operator\": \"lessThan\",\n        \"target\": 1000,\n        \"type\": \"responseTime\"\n      }\n    ],\n    \"request\": {\n      \"method\": \"GET\",\n      \"url\": \"https://example.com\"\n    }\n  },\n  \"locations\": [\n    \"aws:eu-west-3\"\n  ],\n  \"options\": {\n    \"accept_self_signed\": true,\n    \"allow_insecure\": true,\n    \"checkCertificateRevocation\": true,\n    \"ci\": {\n      \"executionRule\": \"non_blocking\"\n    },\n    \"device_ids\": [\n      \"laptop_large\",\n      \"laptop_large\"\n    ],\n    \"disableCors\": false,\n    \"disableCsp\": false,\n    \"follow_redirects\": true,\n    \"httpVersion\": \"http1\",\n    \"ignoreServerCertificateError\": false,\n    \"initialNavigationTimeout\": 87780679,\n    \"min_failure_duration\": -32472759,\n    \"min_location_failed\": -5806955,\n    \"monitor_name\": \"et deserunt \",\n    \"monitor_options\": {\n      \"renotify_interval\": 834\n    },\n    \"monitor_priority\": 3,\n    \"noScreenshot\": false,\n    \"restricted_roles\": [\n      \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n    ],\n    \"retry\": {\n      \"count\": -50657150,\n      \"interval\": -91565669.0691471\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\": 384020\n  },\n  \"type\": \"api\",\n  \"message\": \"Notification message\",\n  \"monitor_id\": 12345678,\n  \"public_id\": \"123-abc-456\",\n  \"status\": \"live\",\n  \"subtype\": \"http\",\n  \"tags\": [\n    \"env:production\"\n  ]\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/synthetics/tests/api/:public_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "synthetics",
            "tests",
            "api",
            ":public_id"
          ],
          "variable": [
            {
              "key": "public_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}"
    }
  ]
}