Chilkat Online Tools

DataFlex / Datadog API Collection / Edit an API test

Back to Collection Items

Use ChilkatAx-9.5.0-win32.pkg

Procedure Test
    Handle hoHttp
    Boolean iSuccess
    Handle hoJson
    Variant vSbRequestBody
    Handle hoSbRequestBody
    Variant vResp
    Handle hoResp
    Variant vSbResponseBody
    Handle hoSbResponseBody
    Handle hoJResp
    Integer iRespStatusCode
    String sOperator
    Integer iTarget
    String sStrVal
    Integer iDay
    String sFrom
    String sV_to
    String sName
    String sMethod
    String sV_Url
    Boolean iAccept_self_signed
    Boolean iAllow_insecure
    Boolean iCheckCertificateRevocation
    String sExecutionRule
    Boolean iDisableCors
    Boolean iDisableCsp
    Boolean iFollow_redirects
    String sHttpVersion
    Boolean iIgnoreServerCertificateError
    Integer iInitialNavigationTimeout
    Integer iMin_failure_duration
    Integer iMin_location_failed
    String sMonitor_name
    Integer iRenotify_interval
    Integer iMonitor_priority
    Boolean iNoScreenshot
    Integer iCount
    String sInterval
    String sApplicationId
    Integer iClientTokenId
    Boolean iIsEnabled
    String sTimezone
    Integer iTick_every
    String sV_type
    String sMessage
    Integer iMonitor_id
    String sPublic_id
    String sStatus
    String sSubtype
    Integer i
    Integer iCount_i
    String sTemp1
    Boolean bTemp1

    // 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

    // 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"
    //   ]
    // }

    Get Create (RefClass(cComChilkatJsonObject)) To hoJson
    If (Not(IsComObjectCreated(hoJson))) Begin
        Send CreateComObject of hoJson
    End
    Get ComUpdateString Of hoJson "name" "Example test name" To iSuccess
    Get ComUpdateString Of hoJson "config.assertions[0].operator" "lessThan" To iSuccess
    Get ComUpdateInt Of hoJson "config.assertions[0].target" 1000 To iSuccess
    Get ComUpdateString Of hoJson "config.assertions[0].type" "responseTime" To iSuccess
    Get ComUpdateString Of hoJson "config.request.method" "GET" To iSuccess
    Get ComUpdateString Of hoJson "config.request.url" "https://example.com" To iSuccess
    Get ComUpdateString Of hoJson "locations[0]" "aws:eu-west-3" To iSuccess
    Get ComUpdateBool Of hoJson "options.accept_self_signed" True To iSuccess
    Get ComUpdateBool Of hoJson "options.allow_insecure" True To iSuccess
    Get ComUpdateBool Of hoJson "options.checkCertificateRevocation" True To iSuccess
    Get ComUpdateString Of hoJson "options.ci.executionRule" "non_blocking" To iSuccess
    Get ComUpdateString Of hoJson "options.device_ids[0]" "laptop_large" To iSuccess
    Get ComUpdateString Of hoJson "options.device_ids[1]" "laptop_large" To iSuccess
    Get ComUpdateBool Of hoJson "options.disableCors" False To iSuccess
    Get ComUpdateBool Of hoJson "options.disableCsp" False To iSuccess
    Get ComUpdateBool Of hoJson "options.follow_redirects" True To iSuccess
    Get ComUpdateString Of hoJson "options.httpVersion" "http1" To iSuccess
    Get ComUpdateBool Of hoJson "options.ignoreServerCertificateError" False To iSuccess
    Get ComUpdateInt Of hoJson "options.initialNavigationTimeout" 87780679 To iSuccess
    Get ComUpdateInt Of hoJson "options.min_failure_duration" -32472759 To iSuccess
    Get ComUpdateInt Of hoJson "options.min_location_failed" -5806955 To iSuccess
    Get ComUpdateString Of hoJson "options.monitor_name" "et deserunt " To iSuccess
    Get ComUpdateInt Of hoJson "options.monitor_options.renotify_interval" 834 To iSuccess
    Get ComUpdateInt Of hoJson "options.monitor_priority" 3 To iSuccess
    Get ComUpdateBool Of hoJson "options.noScreenshot" False To iSuccess
    Get ComUpdateString Of hoJson "options.restricted_roles[0]" "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" To iSuccess
    Get ComUpdateInt Of hoJson "options.retry.count" -50657150 To iSuccess
    Get ComUpdateNumber Of hoJson "options.retry.interval" "-91565669.0691471" To iSuccess
    Get ComUpdateString Of hoJson "options.rumSettings.applicationId" "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" To iSuccess
    Get ComUpdateInt Of hoJson "options.rumSettings.clientTokenId" 12345 To iSuccess
    Get ComUpdateBool Of hoJson "options.rumSettings.isEnabled" True To iSuccess
    Get ComUpdateInt Of hoJson "options.scheduling.timeframes[0].day" 1 To iSuccess
    Get ComUpdateString Of hoJson "options.scheduling.timeframes[0].from" "07:00" To iSuccess
    Get ComUpdateString Of hoJson "options.scheduling.timeframes[0].to" "16:00" To iSuccess
    Get ComUpdateInt Of hoJson "options.scheduling.timeframes[1].day" 3 To iSuccess
    Get ComUpdateString Of hoJson "options.scheduling.timeframes[1].from" "07:00" To iSuccess
    Get ComUpdateString Of hoJson "options.scheduling.timeframes[1].to" "16:00" To iSuccess
    Get ComUpdateString Of hoJson "options.scheduling.timezone" "America/New_York" To iSuccess
    Get ComUpdateInt Of hoJson "options.tick_every" 384020 To iSuccess
    Get ComUpdateString Of hoJson "type" "api" To iSuccess
    Get ComUpdateString Of hoJson "message" "Notification message" To iSuccess
    Get ComUpdateInt Of hoJson "monitor_id" 12345678 To iSuccess
    Get ComUpdateString Of hoJson "public_id" "123-abc-456" To iSuccess
    Get ComUpdateString Of hoJson "status" "live" To iSuccess
    Get ComUpdateString Of hoJson "subtype" "http" To iSuccess
    Get ComUpdateString Of hoJson "tags[0]" "env:production" To iSuccess

    Send ComSetRequestHeader To hoHttp "Content-Type" "application/json"
    Send ComSetRequestHeader To hoHttp "Accept" "application/json"

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSbRequestBody
    If (Not(IsComObjectCreated(hoSbRequestBody))) Begin
        Send CreateComObject of hoSbRequestBody
    End
    Get pvComObject of hoSbRequestBody to vSbRequestBody
    Get ComEmitSb Of hoJson vSbRequestBody To iSuccess

    Get pvComObject of hoSbRequestBody to vSbRequestBody
    Get ComPTextSb Of hoHttp "PUT" "https://api.app.ddog-gov.com/api/v1/synthetics/tests/api/:public_id" vSbRequestBody "utf-8" "application/json" False False To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 = False) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
    If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
        Send CreateComObject of hoSbResponseBody
    End
    Get pvComObject of hoSbResponseBody to vSbResponseBody
    Get ComGetBodySb Of hoResp vSbResponseBody To iSuccess

    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 ComStatusCode Of hoResp To iRespStatusCode
    Showln "Response Status Code = " iRespStatusCode
    If (iRespStatusCode >= 400) Begin
        Showln "Response Header:"
        Get ComHeader Of hoResp To sTemp1
        Showln sTemp1
        Showln "Failed."
        Send Destroy of hoResp
        Procedure_Return
    End

    Send Destroy of hoResp

    // 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

    Get ComStringOf Of hoJResp "name" To sName
    Get ComStringOf Of hoJResp "config.request.method" To sMethod
    Get ComStringOf Of hoJResp "config.request.url" To sV_Url
    Get ComBoolOf Of hoJResp "options.accept_self_signed" To iAccept_self_signed
    Get ComBoolOf Of hoJResp "options.allow_insecure" To iAllow_insecure
    Get ComBoolOf Of hoJResp "options.checkCertificateRevocation" To iCheckCertificateRevocation
    Get ComStringOf Of hoJResp "options.ci.executionRule" To sExecutionRule
    Get ComBoolOf Of hoJResp "options.disableCors" To iDisableCors
    Get ComBoolOf Of hoJResp "options.disableCsp" To iDisableCsp
    Get ComBoolOf Of hoJResp "options.follow_redirects" To iFollow_redirects
    Get ComStringOf Of hoJResp "options.httpVersion" To sHttpVersion
    Get ComBoolOf Of hoJResp "options.ignoreServerCertificateError" To iIgnoreServerCertificateError
    Get ComIntOf Of hoJResp "options.initialNavigationTimeout" To iInitialNavigationTimeout
    Get ComIntOf Of hoJResp "options.min_failure_duration" To iMin_failure_duration
    Get ComIntOf Of hoJResp "options.min_location_failed" To iMin_location_failed
    Get ComStringOf Of hoJResp "options.monitor_name" To sMonitor_name
    Get ComIntOf Of hoJResp "options.monitor_options.renotify_interval" To iRenotify_interval
    Get ComIntOf Of hoJResp "options.monitor_priority" To iMonitor_priority
    Get ComBoolOf Of hoJResp "options.noScreenshot" To iNoScreenshot
    Get ComIntOf Of hoJResp "options.retry.count" To iCount
    Get ComStringOf Of hoJResp "options.retry.interval" To sInterval
    Get ComStringOf Of hoJResp "options.rumSettings.applicationId" To sApplicationId
    Get ComIntOf Of hoJResp "options.rumSettings.clientTokenId" To iClientTokenId
    Get ComBoolOf Of hoJResp "options.rumSettings.isEnabled" To iIsEnabled
    Get ComStringOf Of hoJResp "options.scheduling.timezone" To sTimezone
    Get ComIntOf Of hoJResp "options.tick_every" To iTick_every
    Get ComStringOf Of hoJResp "type" To sV_type
    Get ComStringOf Of hoJResp "message" To sMessage
    Get ComIntOf Of hoJResp "monitor_id" To iMonitor_id
    Get ComStringOf Of hoJResp "public_id" To sPublic_id
    Get ComStringOf Of hoJResp "status" To sStatus
    Get ComStringOf Of hoJResp "subtype" To sSubtype
    Move 0 To i
    Get ComSizeOfArray Of hoJResp "config.assertions" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Get ComStringOf Of hoJResp "config.assertions[i].operator" To sOperator
        Get ComIntOf Of hoJResp "config.assertions[i].target" To iTarget
        Get ComStringOf Of hoJResp "config.assertions[i].type" To sV_type
        Move (i + 1) To i
    Loop

    Move 0 To i
    Get ComSizeOfArray Of hoJResp "locations" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Get ComStringOf Of hoJResp "locations[i]" To sStrVal
        Move (i + 1) To i
    Loop

    Move 0 To i
    Get ComSizeOfArray Of hoJResp "options.device_ids" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Get ComStringOf Of hoJResp "options.device_ids[i]" To sStrVal
        Move (i + 1) To i
    Loop

    Move 0 To i
    Get ComSizeOfArray Of hoJResp "options.restricted_roles" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Get ComStringOf Of hoJResp "options.restricted_roles[i]" To sStrVal
        Move (i + 1) To i
    Loop

    Move 0 To i
    Get ComSizeOfArray Of hoJResp "options.scheduling.timeframes" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Get ComIntOf Of hoJResp "options.scheduling.timeframes[i].day" To iDay
        Get ComStringOf Of hoJResp "options.scheduling.timeframes[i].from" To sFrom
        Get ComStringOf Of hoJResp "options.scheduling.timeframes[i].to" To sV_to
        Move (i + 1) To i
    Loop

    Move 0 To i
    Get ComSizeOfArray Of hoJResp "tags" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJResp To i
        Get ComStringOf Of hoJResp "tags[i]" To sStrVal
        Move (i + 1) To i
    Loop



End_Procedure

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}"
    }
  ]
}