Chilkat Online Tools

Swift3 / Datadog API Collection / Edit a browser test

Back to Collection Items

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

    let http = CkoHttp()!
    var success: Bool

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

    // The following JSON is sent in the request body.

    // {
    //   "config": {
    //     "request": {
    //       "allow_insecure": false,
    //       "basicAuth": {
    //         "password": "PaSSw0RD!",
    //         "username": "my_username",
    //         "type": "web"
    //       },
    //       "body": "dolore",
    //       "bodyType": "text/plain",
    //       "callType": "unary",
    //       "certificate": {
    //         "cert": {
    //           "content": "dolor mollit id eu",
    //           "filename": "enim ",
    //           "updatedAt": "ad labore d"
    //         },
    //         "key": {
    //           "content": "anim ut consequat eiusmod",
    //           "filename": "non consectetur voluptate",
    //           "updatedAt": "proi"
    //         }
    //       },
    //       "compressedJsonDescriptor": "velit cillum",
    //       "dnsServer": "sint irure sit commodo",
    //       "dnsServerPort": 63263,
    //       "follow_redirects": true,
    //       "headers": {
    //         "nulla_735": "esse enim velit",
    //         "nulla_b_": "laboris ut"
    //       },
    //       "host": "aliquip nostrud",
    //       "message": "Lorem laboris",
    //       "metadata": {
    //         "eub0d": "sint",
    //         "exercitation1": "ut Duis"
    //       },
    //       "method": "dolo",
    //       "noSavingResponseBody": false,
    //       "numberOfPackets": 1,
    //       "persistCookies": true,
    //       "port": 82704033,
    //       "proxy": {
    //         "url": "https://example.com",
    //         "headers": {
    //           "ipsum83a": "ea laborum",
    //           "irure_8": "dolor eiusmod aliqua ",
    //           "esse67f": "veniam qui in"
    //         }
    //       },
    //       "query": {},
    //       "servername": "Duis sed minim quis",
    //       "service": "Greeter",
    //       "shouldTrackHops": false,
    //       "timeout": 48414705.45711616,
    //       "url": "https://example.com"
    //     },
    //     "configVariables": [
    //       {
    //         "description": "Example for the variable.",
    //         "type": "string"
    //       },
    //       {
    //         "description": "Example for the variable.",
    //         "type": "string"
    //       }
    //     ],
    //     "setCookie": "anim",
    //     "variables": [
    //       {
    //         "description": "Example for the variable.",
    //         "type": "string"
    //       },
    //       {
    //         "description": "Example for the variable.",
    //         "type": "string"
    //       }
    //     ]
    //   },
    //   "locations": [
    //     "aws:eu-west-3"
    //   ],
    //   "name": "Example test name",
    //   "options": {
    //     "accept_self_signed": true,
    //     "allow_insecure": false,
    //     "checkCertificateRevocation": false,
    //     "ci": {
    //       "executionRule": "skipped"
    //     },
    //     "device_ids": [
    //       "laptop_large",
    //       "laptop_large"
    //     ],
    //     "disableCors": true,
    //     "disableCsp": false,
    //     "follow_redirects": true,
    //     "httpVersion": "http2",
    //     "ignoreServerCertificateError": false,
    //     "initialNavigationTimeout": -93160400,
    //     "min_failure_duration": 9338007,
    //     "min_location_failed": -22553383,
    //     "monitor_name": "nostrud dolor ullamco",
    //     "monitor_options": {
    //       "renotify_interval": 261
    //     },
    //     "monitor_priority": 3,
    //     "noScreenshot": false,
    //     "restricted_roles": [
    //       "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    //     ],
    //     "retry": {
    //       "count": 67368482,
    //       "interval": 59042710.53770983
    //     },
    //     "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": 427884
    //   },
    //   "type": "browser",
    //   "message": "",
    //   "monitor_id": -23388126,
    //   "public_id": "cupidatat ipsum",
    //   "status": "live",
    //   "steps": [
    //     {
    //       "allowFailure": false,
    //       "isCritical": true,
    //       "name": "proident dolore ex",
    //       "noScreenshot": true,
    //       "params": {},
    //       "timeout": 70509439,
    //       "type": "assertElementContent"
    //     },
    //     {
    //       "allowFailure": true,
    //       "isCritical": true,
    //       "name": "adipisicing volupt",
    //       "noScreenshot": false,
    //       "params": {},
    //       "timeout": -22942790,
    //       "type": "assertElementContent"
    //     }
    //   ],
    //   "tags": [
    //     "env:prod"
    //   ]
    // }

    let json = CkoJsonObject()!
    json.updateBool("config.request.allow_insecure", value: false)
    json.update("config.request.basicAuth.password", value: "PaSSw0RD!")
    json.update("config.request.basicAuth.username", value: "my_username")
    json.update("config.request.basicAuth.type", value: "web")
    json.update("config.request.body", value: "dolore")
    json.update("config.request.bodyType", value: "text/plain")
    json.update("config.request.callType", value: "unary")
    json.update("config.request.certificate.cert.content", value: "dolor mollit id eu")
    json.update("config.request.certificate.cert.filename", value: "enim ")
    json.update("config.request.certificate.cert.updatedAt", value: "ad labore d")
    json.update("config.request.certificate.key.content", value: "anim ut consequat eiusmod")
    json.update("config.request.certificate.key.filename", value: "non consectetur voluptate")
    json.update("config.request.certificate.key.updatedAt", value: "proi")
    json.update("config.request.compressedJsonDescriptor", value: "velit cillum")
    json.update("config.request.dnsServer", value: "sint irure sit commodo")
    json.updateInt("config.request.dnsServerPort", value: 63263)
    json.updateBool("config.request.follow_redirects", value: true)
    json.update("config.request.headers.nulla_735", value: "esse enim velit")
    json.update("config.request.headers.nulla_b_", value: "laboris ut")
    json.update("config.request.host", value: "aliquip nostrud")
    json.update("config.request.message", value: "Lorem laboris")
    json.update("config.request.metadata.eub0d", value: "sint")
    json.update("config.request.metadata.exercitation1", value: "ut Duis")
    json.update("config.request.method", value: "dolo")
    json.updateBool("config.request.noSavingResponseBody", value: false)
    json.updateInt("config.request.numberOfPackets", value: 1)
    json.updateBool("config.request.persistCookies", value: true)
    json.updateInt("config.request.port", value: 82704033)
    json.update("config.request.proxy.url", value: "https://example.com")
    json.update("config.request.proxy.headers.ipsum83a", value: "ea laborum")
    json.update("config.request.proxy.headers.irure_8", value: "dolor eiusmod aliqua ")
    json.update("config.request.proxy.headers.esse67f", value: "veniam qui in")
    json.updateNewObject("config.request.query")
    json.update("config.request.servername", value: "Duis sed minim quis")
    json.update("config.request.service", value: "Greeter")
    json.updateBool("config.request.shouldTrackHops", value: false)
    json.updateNumber("config.request.timeout", numericStr: "48414705.45711616")
    json.update("config.request.url", value: "https://example.com")
    json.update("config.configVariables[0].description", value: "Example for the variable.")
    json.update("config.configVariables[0].type", value: "string")
    json.update("config.configVariables[1].description", value: "Example for the variable.")
    json.update("config.configVariables[1].type", value: "string")
    json.update("config.setCookie", value: "anim")
    json.update("config.variables[0].description", value: "Example for the variable.")
    json.update("config.variables[0].type", value: "string")
    json.update("config.variables[1].description", value: "Example for the variable.")
    json.update("config.variables[1].type", value: "string")
    json.update("locations[0]", value: "aws:eu-west-3")
    json.update("name", value: "Example test name")
    json.updateBool("options.accept_self_signed", value: true)
    json.updateBool("options.allow_insecure", value: false)
    json.updateBool("options.checkCertificateRevocation", value: false)
    json.update("options.ci.executionRule", value: "skipped")
    json.update("options.device_ids[0]", value: "laptop_large")
    json.update("options.device_ids[1]", value: "laptop_large")
    json.updateBool("options.disableCors", value: true)
    json.updateBool("options.disableCsp", value: false)
    json.updateBool("options.follow_redirects", value: true)
    json.update("options.httpVersion", value: "http2")
    json.updateBool("options.ignoreServerCertificateError", value: false)
    json.updateInt("options.initialNavigationTimeout", value: -93160400)
    json.updateInt("options.min_failure_duration", value: 9338007)
    json.updateInt("options.min_location_failed", value: -22553383)
    json.update("options.monitor_name", value: "nostrud dolor ullamco")
    json.updateInt("options.monitor_options.renotify_interval", value: 261)
    json.updateInt("options.monitor_priority", value: 3)
    json.updateBool("options.noScreenshot", value: false)
    json.update("options.restricted_roles[0]", value: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
    json.updateInt("options.retry.count", value: 67368482)
    json.updateNumber("options.retry.interval", numericStr: "59042710.53770983")
    json.update("options.rumSettings.applicationId", value: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
    json.updateInt("options.rumSettings.clientTokenId", value: 12345)
    json.updateBool("options.rumSettings.isEnabled", value: true)
    json.updateInt("options.scheduling.timeframes[0].day", value: 1)
    json.update("options.scheduling.timeframes[0].from", value: "07:00")
    json.update("options.scheduling.timeframes[0].to", value: "16:00")
    json.updateInt("options.scheduling.timeframes[1].day", value: 3)
    json.update("options.scheduling.timeframes[1].from", value: "07:00")
    json.update("options.scheduling.timeframes[1].to", value: "16:00")
    json.update("options.scheduling.timezone", value: "America/New_York")
    json.updateInt("options.tick_every", value: 427884)
    json.update("type", value: "browser")
    json.update("message", value: "")
    json.updateInt("monitor_id", value: -23388126)
    json.update("public_id", value: "cupidatat ipsum")
    json.update("status", value: "live")
    json.updateBool("steps[0].allowFailure", value: false)
    json.updateBool("steps[0].isCritical", value: true)
    json.update("steps[0].name", value: "proident dolore ex")
    json.updateBool("steps[0].noScreenshot", value: true)
    json.updateNewObject("steps[0].params")
    json.updateInt("steps[0].timeout", value: 70509439)
    json.update("steps[0].type", value: "assertElementContent")
    json.updateBool("steps[1].allowFailure", value: true)
    json.updateBool("steps[1].isCritical", value: true)
    json.update("steps[1].name", value: "adipisicing volupt")
    json.updateBool("steps[1].noScreenshot", value: false)
    json.updateNewObject("steps[1].params")
    json.updateInt("steps[1].timeout", value: -22942790)
    json.update("steps[1].type", value: "assertElementContent")
    json.update("tags[0]", value: "env:prod")

    http.setRequestHeader("Content-Type", value: "application/json")
    http.setRequestHeader("Accept", value: "application/json")

    let sbRequestBody = CkoStringBuilder()!
    json.emitSb(sbRequestBody)

    var resp: CkoHttpResponse? = http.pTextSb("PUT", url: "https://api.app.ddog-gov.com/api/v1/synthetics/tests/browser/:public_id", textData: sbRequestBody, charset: "utf-8", contentType: "application/json", md5: false, gzip: false)
    if http.lastMethodSuccess == false {
        print("\(http.lastErrorText!)")
        return
    }

    let sbResponseBody = CkoStringBuilder()!
    resp!.getBodySb(sbResponseBody)

    let jResp = CkoJsonObject()!
    jResp.loadSb(sbResponseBody)
    jResp.emitCompact = false

    print("Response Body:")
    print("\(jResp.emit()!)")

    var respStatusCode: Int = resp!.statusCode.intValue
    print("Response Status Code = \(respStatusCode)")
    if respStatusCode >= 400 {
        print("Response Header:")
        print("\(resp!.header!)")
        print("Failed.")
        resp = nil
        return
    }

    resp = nil

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

    // {
    //   "config": {
    //     "request": {
    //       "allow_insecure": false,
    //       "basicAuth": {
    //         "password": "PaSSw0RD!",
    //         "username": "my_username",
    //         "type": "web"
    //       },
    //       "body": "dolore",
    //       "bodyType": "text/plain",
    //       "callType": "unary",
    //       "certificate": {
    //         "cert": {
    //           "content": "dolor mollit id eu",
    //           "filename": "enim ",
    //           "updatedAt": "ad labore d"
    //         },
    //         "key": {
    //           "content": "anim ut consequat eiusmod",
    //           "filename": "non consectetur voluptate",
    //           "updatedAt": "proi"
    //         }
    //       },
    //       "compressedJsonDescriptor": "velit cillum",
    //       "dnsServer": "sint irure sit commodo",
    //       "dnsServerPort": 63263,
    //       "follow_redirects": true,
    //       "headers": {
    //         "nulla_735": "esse enim velit",
    //         "nulla_b_": "laboris ut"
    //       },
    //       "host": "aliquip nostrud",
    //       "message": "Lorem laboris",
    //       "metadata": {
    //         "eub0d": "sint",
    //         "exercitation1": "ut Duis"
    //       },
    //       "method": "dolo",
    //       "noSavingResponseBody": false,
    //       "numberOfPackets": 1,
    //       "persistCookies": true,
    //       "port": 82704033,
    //       "proxy": {
    //         "url": "https://example.com",
    //         "headers": {
    //           "ipsum83a": "ea laborum",
    //           "irure_8": "dolor eiusmod aliqua ",
    //           "esse67f": "veniam qui in"
    //         }
    //       },
    //       "query": {},
    //       "servername": "Duis sed minim quis",
    //       "service": "Greeter",
    //       "shouldTrackHops": false,
    //       "timeout": 48414705.45711616,
    //       "url": "https://example.com"
    //     },
    //     "configVariables": [
    //       {
    //         "description": "Example for the variable.",
    //         "type": "string"
    //       },
    //       {
    //         "description": "Example for the variable.",
    //         "type": "string"
    //       }
    //     ],
    //     "setCookie": "anim",
    //     "variables": [
    //       {
    //         "description": "Example for the variable.",
    //         "type": "string"
    //       },
    //       {
    //         "description": "Example for the variable.",
    //         "type": "string"
    //       }
    //     ]
    //   },
    //   "locations": [
    //     "aws:eu-west-3"
    //   ],
    //   "name": "Example test name",
    //   "options": {
    //     "accept_self_signed": true,
    //     "allow_insecure": false,
    //     "checkCertificateRevocation": false,
    //     "ci": {
    //       "executionRule": "skipped"
    //     },
    //     "device_ids": [
    //       "laptop_large",
    //       "laptop_large"
    //     ],
    //     "disableCors": true,
    //     "disableCsp": false,
    //     "follow_redirects": true,
    //     "httpVersion": "http2",
    //     "ignoreServerCertificateError": false,
    //     "initialNavigationTimeout": -93160400,
    //     "min_failure_duration": 9338007,
    //     "min_location_failed": -22553383,
    //     "monitor_name": "nostrud dolor ullamco",
    //     "monitor_options": {
    //       "renotify_interval": 261
    //     },
    //     "monitor_priority": 3,
    //     "noScreenshot": false,
    //     "restricted_roles": [
    //       "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    //     ],
    //     "retry": {
    //       "count": 67368482,
    //       "interval": 59042710.53770983
    //     },
    //     "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": 427884
    //   },
    //   "type": "browser",
    //   "message": "",
    //   "monitor_id": -23388126,
    //   "public_id": "cupidatat ipsum",
    //   "status": "live",
    //   "steps": [
    //     {
    //       "allowFailure": false,
    //       "isCritical": true,
    //       "name": "proident dolore ex",
    //       "noScreenshot": true,
    //       "params": {},
    //       "timeout": 70509439,
    //       "type": "assertElementContent"
    //     },
    //     {
    //       "allowFailure": true,
    //       "isCritical": true,
    //       "name": "adipisicing volupt",
    //       "noScreenshot": false,
    //       "params": {},
    //       "timeout": -22942790,
    //       "type": "assertElementContent"
    //     }
    //   ],
    //   "tags": [
    //     "env:prod"
    //   ]
    // }

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

    var description: String?
    var strVal: String?
    var day: Int
    var from: String?
    var v_to: String?
    var allowFailure: Bool
    var isCritical: Bool
    var noScreenshot: Bool
    var timeout: Int

    var Allow_insecure: Bool = jResp.bool(of: "config.request.allow_insecure")
    var Password: String? = jResp.string(of: "config.request.basicAuth.password")
    var Username: String? = jResp.string(of: "config.request.basicAuth.username")
    var v_Type: String? = jResp.string(of: "config.request.basicAuth.type")
    var Body: String? = jResp.string(of: "config.request.body")
    var BodyType: String? = jResp.string(of: "config.request.bodyType")
    var CallType: String? = jResp.string(of: "config.request.callType")
    var Content: String? = jResp.string(of: "config.request.certificate.cert.content")
    var Filename: String? = jResp.string(of: "config.request.certificate.cert.filename")
    var UpdatedAt: String? = jResp.string(of: "config.request.certificate.cert.updatedAt")
    var KeyContent: String? = jResp.string(of: "config.request.certificate.key.content")
    var KeyFilename: String? = jResp.string(of: "config.request.certificate.key.filename")
    var KeyUpdatedAt: String? = jResp.string(of: "config.request.certificate.key.updatedAt")
    var CompressedJsonDescriptor: String? = jResp.string(of: "config.request.compressedJsonDescriptor")
    var DnsServer: String? = jResp.string(of: "config.request.dnsServer")
    var DnsServerPort: Int = jResp.int(of: "config.request.dnsServerPort").intValue
    var Follow_redirects: Bool = jResp.bool(of: "config.request.follow_redirects")
    var Nulla_735: String? = jResp.string(of: "config.request.headers.nulla_735")
    var Nulla_b_: String? = jResp.string(of: "config.request.headers.nulla_b_")
    var Host: String? = jResp.string(of: "config.request.host")
    var Message: String? = jResp.string(of: "config.request.message")
    var Eub0d: String? = jResp.string(of: "config.request.metadata.eub0d")
    var Exercitation1: String? = jResp.string(of: "config.request.metadata.exercitation1")
    var Method: String? = jResp.string(of: "config.request.method")
    var NoSavingResponseBody: Bool = jResp.bool(of: "config.request.noSavingResponseBody")
    var NumberOfPackets: Int = jResp.int(of: "config.request.numberOfPackets").intValue
    var PersistCookies: Bool = jResp.bool(of: "config.request.persistCookies")
    var Port: Int = jResp.int(of: "config.request.port").intValue
    var v_Url: String? = jResp.string(of: "config.request.proxy.url")
    var Ipsum83a: String? = jResp.string(of: "config.request.proxy.headers.ipsum83a")
    var Irure_8: String? = jResp.string(of: "config.request.proxy.headers.irure_8")
    var Esse67f: String? = jResp.string(of: "config.request.proxy.headers.esse67f")
    var Servername: String? = jResp.string(of: "config.request.servername")
    var Service: String? = jResp.string(of: "config.request.service")
    var ShouldTrackHops: Bool = jResp.bool(of: "config.request.shouldTrackHops")
    var Timeout: String? = jResp.string(of: "config.request.timeout")
    var RequestUrl: String? = jResp.string(of: "config.request.url")
    var SetCookie: String? = jResp.string(of: "config.setCookie")
    var name: String? = jResp.string(of: "name")
    var Accept_self_signed: Bool = jResp.bool(of: "options.accept_self_signed")
    var optionsAllow_insecure: Bool = jResp.bool(of: "options.allow_insecure")
    var CheckCertificateRevocation: Bool = jResp.bool(of: "options.checkCertificateRevocation")
    var ExecutionRule: String? = jResp.string(of: "options.ci.executionRule")
    var DisableCors: Bool = jResp.bool(of: "options.disableCors")
    var DisableCsp: Bool = jResp.bool(of: "options.disableCsp")
    var optionsFollow_redirects: Bool = jResp.bool(of: "options.follow_redirects")
    var HttpVersion: String? = jResp.string(of: "options.httpVersion")
    var IgnoreServerCertificateError: Bool = jResp.bool(of: "options.ignoreServerCertificateError")
    var InitialNavigationTimeout: Int = jResp.int(of: "options.initialNavigationTimeout").intValue
    var Min_failure_duration: Int = jResp.int(of: "options.min_failure_duration").intValue
    var Min_location_failed: Int = jResp.int(of: "options.min_location_failed").intValue
    var Monitor_name: String? = jResp.string(of: "options.monitor_name")
    var Renotify_interval: Int = jResp.int(of: "options.monitor_options.renotify_interval").intValue
    var Monitor_priority: Int = jResp.int(of: "options.monitor_priority").intValue
    var NoScreenshot: Bool = jResp.bool(of: "options.noScreenshot")
    var Count: Int = jResp.int(of: "options.retry.count").intValue
    var Interval: String? = jResp.string(of: "options.retry.interval")
    var ApplicationId: String? = jResp.string(of: "options.rumSettings.applicationId")
    var ClientTokenId: Int = jResp.int(of: "options.rumSettings.clientTokenId").intValue
    var IsEnabled: Bool = jResp.bool(of: "options.rumSettings.isEnabled")
    var Timezone: String? = jResp.string(of: "options.scheduling.timezone")
    var Tick_every: Int = jResp.int(of: "options.tick_every").intValue
    var v_type: String? = jResp.string(of: "type")
    var message: String? = jResp.string(of: "message")
    var monitor_id: Int = jResp.int(of: "monitor_id").intValue
    var public_id: String? = jResp.string(of: "public_id")
    var status: String? = jResp.string(of: "status")
    var i: Int = 0
    var count_i: Int = jResp.size(ofArray: "config.configVariables").intValue
    while i < count_i {
        jResp.i = i
        description = jResp.string(of: "config.configVariables[i].description")
        v_type = jResp.string(of: "config.configVariables[i].type")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "config.variables").intValue
    while i < count_i {
        jResp.i = i
        description = jResp.string(of: "config.variables[i].description")
        v_type = jResp.string(of: "config.variables[i].type")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "locations").intValue
    while i < count_i {
        jResp.i = i
        strVal = jResp.string(of: "locations[i]")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "options.device_ids").intValue
    while i < count_i {
        jResp.i = i
        strVal = jResp.string(of: "options.device_ids[i]")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "options.restricted_roles").intValue
    while i < count_i {
        jResp.i = i
        strVal = jResp.string(of: "options.restricted_roles[i]")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "options.scheduling.timeframes").intValue
    while i < count_i {
        jResp.i = i
        day = jResp.int(of: "options.scheduling.timeframes[i].day").intValue
        from = jResp.string(of: "options.scheduling.timeframes[i].from")
        v_to = jResp.string(of: "options.scheduling.timeframes[i].to")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "steps").intValue
    while i < count_i {
        jResp.i = i
        allowFailure = jResp.bool(of: "steps[i].allowFailure")
        isCritical = jResp.bool(of: "steps[i].isCritical")
        name = jResp.string(of: "steps[i].name")
        noScreenshot = jResp.bool(of: "steps[i].noScreenshot")
        timeout = jResp.int(of: "steps[i].timeout").intValue
        v_type = jResp.string(of: "steps[i].type")
        i = i + 1
    }

    i = 0
    count_i = jResp.size(ofArray: "tags").intValue
    while i < count_i {
        jResp.i = i
        strVal = jResp.string(of: "tags[i]")
        i = i + 1
    }


}

Curl Command

curl -X PUT
	-H "Content-Type: application/json"
	-H "Accept: application/json"
	-d '{
  "config": {
    "request": {
      "allow_insecure": false,
      "basicAuth": {
        "password": "PaSSw0RD!",
        "username": "my_username",
        "type": "web"
      },
      "body": "dolore",
      "bodyType": "text/plain",
      "callType": "unary",
      "certificate": {
        "cert": {
          "content": "dolor mollit id eu",
          "filename": "enim ",
          "updatedAt": "ad labore d"
        },
        "key": {
          "content": "anim ut consequat eiusmod",
          "filename": "non consectetur voluptate",
          "updatedAt": "proi"
        }
      },
      "compressedJsonDescriptor": "velit cillum",
      "dnsServer": "sint irure sit commodo",
      "dnsServerPort": 63263,
      "follow_redirects": true,
      "headers": {
        "nulla_735": "esse enim velit",
        "nulla_b_": "laboris ut"
      },
      "host": "aliquip nostrud",
      "message": "Lorem laboris",
      "metadata": {
        "eub0d": "sint",
        "exercitation1": "ut Duis"
      },
      "method": "dolo",
      "noSavingResponseBody": false,
      "numberOfPackets": 1,
      "persistCookies": true,
      "port": 82704033,
      "proxy": {
        "url": "https://example.com",
        "headers": {
          "ipsum83a": "ea laborum",
          "irure_8": "dolor eiusmod aliqua ",
          "esse67f": "veniam qui in"
        }
      },
      "query": {},
      "servername": "Duis sed minim quis",
      "service": "Greeter",
      "shouldTrackHops": false,
      "timeout": 48414705.45711616,
      "url": "https://example.com"
    },
    "configVariables": [
      {
        "description": "Example for the variable.",
        "type": "string"
      },
      {
        "description": "Example for the variable.",
        "type": "string"
      }
    ],
    "setCookie": "anim",
    "variables": [
      {
        "description": "Example for the variable.",
        "type": "string"
      },
      {
        "description": "Example for the variable.",
        "type": "string"
      }
    ]
  },
  "locations": [
    "aws:eu-west-3"
  ],
  "name": "Example test name",
  "options": {
    "accept_self_signed": true,
    "allow_insecure": false,
    "checkCertificateRevocation": false,
    "ci": {
      "executionRule": "skipped"
    },
    "device_ids": [
      "laptop_large",
      "laptop_large"
    ],
    "disableCors": true,
    "disableCsp": false,
    "follow_redirects": true,
    "httpVersion": "http2",
    "ignoreServerCertificateError": false,
    "initialNavigationTimeout": -93160400,
    "min_failure_duration": 9338007,
    "min_location_failed": -22553383,
    "monitor_name": "nostrud dolor ullamco",
    "monitor_options": {
      "renotify_interval": 261
    },
    "monitor_priority": 3,
    "noScreenshot": false,
    "restricted_roles": [
      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "retry": {
      "count": 67368482,
      "interval": 59042710.53770983
    },
    "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": 427884
  },
  "type": "browser",
  "message": "",
  "monitor_id": -23388126,
  "public_id": "cupidatat ipsum",
  "status": "live",
  "steps": [
    {
      "allowFailure": false,
      "isCritical": true,
      "name": "proident dolore ex",
      "noScreenshot": true,
      "params": {},
      "timeout": 70509439,
      "type": "assertElementContent"
    },
    {
      "allowFailure": true,
      "isCritical": true,
      "name": "adipisicing volupt",
      "noScreenshot": false,
      "params": {},
      "timeout": -22942790,
      "type": "assertElementContent"
    }
  ],
  "tags": [
    "env:prod"
  ]
}'
https://api.app.ddog-gov.com/api/v1/synthetics/tests/browser/:public_id

Postman Collection Item JSON

{
  "name": "Edit a browser test",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n  \"config\": {\n    \"request\": {\n      \"allow_insecure\": false,\n      \"basicAuth\": {\n        \"password\": \"PaSSw0RD!\",\n        \"username\": \"my_username\",\n        \"type\": \"web\"\n      },\n      \"body\": \"dolore\",\n      \"bodyType\": \"text/plain\",\n      \"callType\": \"unary\",\n      \"certificate\": {\n        \"cert\": {\n          \"content\": \"dolor mollit id eu\",\n          \"filename\": \"enim \",\n          \"updatedAt\": \"ad labore d\"\n        },\n        \"key\": {\n          \"content\": \"anim ut consequat eiusmod\",\n          \"filename\": \"non consectetur voluptate\",\n          \"updatedAt\": \"proi\"\n        }\n      },\n      \"compressedJsonDescriptor\": \"velit cillum\",\n      \"dnsServer\": \"sint irure sit commodo\",\n      \"dnsServerPort\": 63263,\n      \"follow_redirects\": true,\n      \"headers\": {\n        \"nulla_735\": \"esse enim velit\",\n        \"nulla_b_\": \"laboris ut\"\n      },\n      \"host\": \"aliquip nostrud\",\n      \"message\": \"Lorem laboris\",\n      \"metadata\": {\n        \"eub0d\": \"sint\",\n        \"exercitation1\": \"ut Duis\"\n      },\n      \"method\": \"dolo\",\n      \"noSavingResponseBody\": false,\n      \"numberOfPackets\": 1,\n      \"persistCookies\": true,\n      \"port\": 82704033,\n      \"proxy\": {\n        \"url\": \"https://example.com\",\n        \"headers\": {\n          \"ipsum83a\": \"ea laborum\",\n          \"irure_8\": \"dolor eiusmod aliqua \",\n          \"esse67f\": \"veniam qui in\"\n        }\n      },\n      \"query\": {},\n      \"servername\": \"Duis sed minim quis\",\n      \"service\": \"Greeter\",\n      \"shouldTrackHops\": false,\n      \"timeout\": 48414705.45711616,\n      \"url\": \"https://example.com\"\n    },\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    \"setCookie\": \"anim\",\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  \"locations\": [\n    \"aws:eu-west-3\"\n  ],\n  \"name\": \"Example test name\",\n  \"options\": {\n    \"accept_self_signed\": true,\n    \"allow_insecure\": false,\n    \"checkCertificateRevocation\": false,\n    \"ci\": {\n      \"executionRule\": \"skipped\"\n    },\n    \"device_ids\": [\n      \"laptop_large\",\n      \"laptop_large\"\n    ],\n    \"disableCors\": true,\n    \"disableCsp\": false,\n    \"follow_redirects\": true,\n    \"httpVersion\": \"http2\",\n    \"ignoreServerCertificateError\": false,\n    \"initialNavigationTimeout\": -93160400,\n    \"min_failure_duration\": 9338007,\n    \"min_location_failed\": -22553383,\n    \"monitor_name\": \"nostrud dolor ullamco\",\n    \"monitor_options\": {\n      \"renotify_interval\": 261\n    },\n    \"monitor_priority\": 3,\n    \"noScreenshot\": false,\n    \"restricted_roles\": [\n      \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n    ],\n    \"retry\": {\n      \"count\": 67368482,\n      \"interval\": 59042710.53770983\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\": 427884\n  },\n  \"type\": \"browser\",\n  \"message\": \"\",\n  \"monitor_id\": -23388126,\n  \"public_id\": \"cupidatat ipsum\",\n  \"status\": \"live\",\n  \"steps\": [\n    {\n      \"allowFailure\": false,\n      \"isCritical\": true,\n      \"name\": \"proident dolore ex\",\n      \"noScreenshot\": true,\n      \"params\": {},\n      \"timeout\": 70509439,\n      \"type\": \"assertElementContent\"\n    },\n    {\n      \"allowFailure\": true,\n      \"isCritical\": true,\n      \"name\": \"adipisicing volupt\",\n      \"noScreenshot\": false,\n      \"params\": {},\n      \"timeout\": -22942790,\n      \"type\": \"assertElementContent\"\n    }\n  ],\n  \"tags\": [\n    \"env:prod\"\n  ]\n}",
      "options": {
        "raw": {
          "headerFamily": "json",
          "language": "json"
        }
      }
    },
    "url": {
      "raw": "{{baseUrl}}/api/v1/synthetics/tests/browser/:public_id",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v1",
        "synthetics",
        "tests",
        "browser",
        ":public_id"
      ],
      "variable": [
        {
          "key": "public_id",
          "value": "tempor Ut sed velit"
        }
      ]
    },
    "description": "Edit the configuration of a Synthetic browser 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  \"config\": {\n    \"request\": {\n      \"allow_insecure\": false,\n      \"basicAuth\": {\n        \"password\": \"PaSSw0RD!\",\n        \"username\": \"my_username\",\n        \"type\": \"web\"\n      },\n      \"body\": \"dolore\",\n      \"bodyType\": \"text/plain\",\n      \"callType\": \"unary\",\n      \"certificate\": {\n        \"cert\": {\n          \"content\": \"dolor mollit id eu\",\n          \"filename\": \"enim \",\n          \"updatedAt\": \"ad labore d\"\n        },\n        \"key\": {\n          \"content\": \"anim ut consequat eiusmod\",\n          \"filename\": \"non consectetur voluptate\",\n          \"updatedAt\": \"proi\"\n        }\n      },\n      \"compressedJsonDescriptor\": \"velit cillum\",\n      \"dnsServer\": \"sint irure sit commodo\",\n      \"dnsServerPort\": 63263,\n      \"follow_redirects\": true,\n      \"headers\": {\n        \"nulla_735\": \"esse enim velit\",\n        \"nulla_b_\": \"laboris ut\"\n      },\n      \"host\": \"aliquip nostrud\",\n      \"message\": \"Lorem laboris\",\n      \"metadata\": {\n        \"eub0d\": \"sint\",\n        \"exercitation1\": \"ut Duis\"\n      },\n      \"method\": \"dolo\",\n      \"noSavingResponseBody\": false,\n      \"numberOfPackets\": 1,\n      \"persistCookies\": true,\n      \"port\": 82704033,\n      \"proxy\": {\n        \"url\": \"https://example.com\",\n        \"headers\": {\n          \"ipsum83a\": \"ea laborum\",\n          \"irure_8\": \"dolor eiusmod aliqua \",\n          \"esse67f\": \"veniam qui in\"\n        }\n      },\n      \"query\": {},\n      \"servername\": \"Duis sed minim quis\",\n      \"service\": \"Greeter\",\n      \"shouldTrackHops\": false,\n      \"timeout\": 48414705.45711616,\n      \"url\": \"https://example.com\"\n    },\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    \"setCookie\": \"anim\",\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  \"locations\": [\n    \"aws:eu-west-3\"\n  ],\n  \"name\": \"Example test name\",\n  \"options\": {\n    \"accept_self_signed\": true,\n    \"allow_insecure\": false,\n    \"checkCertificateRevocation\": false,\n    \"ci\": {\n      \"executionRule\": \"skipped\"\n    },\n    \"device_ids\": [\n      \"laptop_large\",\n      \"laptop_large\"\n    ],\n    \"disableCors\": true,\n    \"disableCsp\": false,\n    \"follow_redirects\": true,\n    \"httpVersion\": \"http2\",\n    \"ignoreServerCertificateError\": false,\n    \"initialNavigationTimeout\": -93160400,\n    \"min_failure_duration\": 9338007,\n    \"min_location_failed\": -22553383,\n    \"monitor_name\": \"nostrud dolor ullamco\",\n    \"monitor_options\": {\n      \"renotify_interval\": 261\n    },\n    \"monitor_priority\": 3,\n    \"noScreenshot\": false,\n    \"restricted_roles\": [\n      \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n    ],\n    \"retry\": {\n      \"count\": 67368482,\n      \"interval\": 59042710.53770983\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\": 427884\n  },\n  \"type\": \"browser\",\n  \"message\": \"\",\n  \"monitor_id\": -23388126,\n  \"public_id\": \"cupidatat ipsum\",\n  \"status\": \"live\",\n  \"steps\": [\n    {\n      \"allowFailure\": false,\n      \"isCritical\": true,\n      \"name\": \"proident dolore ex\",\n      \"noScreenshot\": true,\n      \"params\": {},\n      \"timeout\": 70509439,\n      \"type\": \"assertElementContent\"\n    },\n    {\n      \"allowFailure\": true,\n      \"isCritical\": true,\n      \"name\": \"adipisicing volupt\",\n      \"noScreenshot\": false,\n      \"params\": {},\n      \"timeout\": -22942790,\n      \"type\": \"assertElementContent\"\n    }\n  ],\n  \"tags\": [\n    \"env:prod\"\n  ]\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/synthetics/tests/browser/:public_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "synthetics",
            "tests",
            "browser",
            ":public_id"
          ],
          "variable": [
            {
              "key": "public_id"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"config\": {\n    \"request\": {\n      \"allow_insecure\": false,\n      \"basicAuth\": {\n        \"password\": \"PaSSw0RD!\",\n        \"username\": \"my_username\",\n        \"type\": \"web\"\n      },\n      \"body\": \"dolore\",\n      \"bodyType\": \"text/plain\",\n      \"callType\": \"unary\",\n      \"certificate\": {\n        \"cert\": {\n          \"content\": \"dolor mollit id eu\",\n          \"filename\": \"enim \",\n          \"updatedAt\": \"ad labore d\"\n        },\n        \"key\": {\n          \"content\": \"anim ut consequat eiusmod\",\n          \"filename\": \"non consectetur voluptate\",\n          \"updatedAt\": \"proi\"\n        }\n      },\n      \"compressedJsonDescriptor\": \"velit cillum\",\n      \"dnsServer\": \"sint irure sit commodo\",\n      \"dnsServerPort\": 63263,\n      \"follow_redirects\": true,\n      \"headers\": {\n        \"nulla_735\": \"esse enim velit\",\n        \"nulla_b_\": \"laboris ut\"\n      },\n      \"host\": \"aliquip nostrud\",\n      \"message\": \"Lorem laboris\",\n      \"metadata\": {\n        \"eub0d\": \"sint\",\n        \"exercitation1\": \"ut Duis\"\n      },\n      \"method\": \"dolo\",\n      \"noSavingResponseBody\": false,\n      \"numberOfPackets\": 1,\n      \"persistCookies\": true,\n      \"port\": 82704033,\n      \"proxy\": {\n        \"url\": \"https://example.com\",\n        \"headers\": {\n          \"ipsum83a\": \"ea laborum\",\n          \"irure_8\": \"dolor eiusmod aliqua \",\n          \"esse67f\": \"veniam qui in\"\n        }\n      },\n      \"query\": {},\n      \"servername\": \"Duis sed minim quis\",\n      \"service\": \"Greeter\",\n      \"shouldTrackHops\": false,\n      \"timeout\": 48414705.45711616,\n      \"url\": \"https://example.com\"\n    },\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    \"setCookie\": \"anim\",\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  \"locations\": [\n    \"aws:eu-west-3\"\n  ],\n  \"name\": \"Example test name\",\n  \"options\": {\n    \"accept_self_signed\": true,\n    \"allow_insecure\": false,\n    \"checkCertificateRevocation\": false,\n    \"ci\": {\n      \"executionRule\": \"skipped\"\n    },\n    \"device_ids\": [\n      \"laptop_large\",\n      \"laptop_large\"\n    ],\n    \"disableCors\": true,\n    \"disableCsp\": false,\n    \"follow_redirects\": true,\n    \"httpVersion\": \"http2\",\n    \"ignoreServerCertificateError\": false,\n    \"initialNavigationTimeout\": -93160400,\n    \"min_failure_duration\": 9338007,\n    \"min_location_failed\": -22553383,\n    \"monitor_name\": \"nostrud dolor ullamco\",\n    \"monitor_options\": {\n      \"renotify_interval\": 261\n    },\n    \"monitor_priority\": 3,\n    \"noScreenshot\": false,\n    \"restricted_roles\": [\n      \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n    ],\n    \"retry\": {\n      \"count\": 67368482,\n      \"interval\": 59042710.53770983\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\": 427884\n  },\n  \"type\": \"browser\",\n  \"message\": \"\",\n  \"monitor_id\": -23388126,\n  \"public_id\": \"cupidatat ipsum\",\n  \"status\": \"live\",\n  \"steps\": [\n    {\n      \"allowFailure\": false,\n      \"isCritical\": true,\n      \"name\": \"proident dolore ex\",\n      \"noScreenshot\": true,\n      \"params\": {},\n      \"timeout\": 70509439,\n      \"type\": \"assertElementContent\"\n    },\n    {\n      \"allowFailure\": true,\n      \"isCritical\": true,\n      \"name\": \"adipisicing volupt\",\n      \"noScreenshot\": false,\n      \"params\": {},\n      \"timeout\": -22942790,\n      \"type\": \"assertElementContent\"\n    }\n  ],\n  \"tags\": [\n    \"env:prod\"\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  \"config\": {\n    \"request\": {\n      \"allow_insecure\": false,\n      \"basicAuth\": {\n        \"password\": \"PaSSw0RD!\",\n        \"username\": \"my_username\",\n        \"type\": \"web\"\n      },\n      \"body\": \"dolore\",\n      \"bodyType\": \"text/plain\",\n      \"callType\": \"unary\",\n      \"certificate\": {\n        \"cert\": {\n          \"content\": \"dolor mollit id eu\",\n          \"filename\": \"enim \",\n          \"updatedAt\": \"ad labore d\"\n        },\n        \"key\": {\n          \"content\": \"anim ut consequat eiusmod\",\n          \"filename\": \"non consectetur voluptate\",\n          \"updatedAt\": \"proi\"\n        }\n      },\n      \"compressedJsonDescriptor\": \"velit cillum\",\n      \"dnsServer\": \"sint irure sit commodo\",\n      \"dnsServerPort\": 63263,\n      \"follow_redirects\": true,\n      \"headers\": {\n        \"nulla_735\": \"esse enim velit\",\n        \"nulla_b_\": \"laboris ut\"\n      },\n      \"host\": \"aliquip nostrud\",\n      \"message\": \"Lorem laboris\",\n      \"metadata\": {\n        \"eub0d\": \"sint\",\n        \"exercitation1\": \"ut Duis\"\n      },\n      \"method\": \"dolo\",\n      \"noSavingResponseBody\": false,\n      \"numberOfPackets\": 1,\n      \"persistCookies\": true,\n      \"port\": 82704033,\n      \"proxy\": {\n        \"url\": \"https://example.com\",\n        \"headers\": {\n          \"ipsum83a\": \"ea laborum\",\n          \"irure_8\": \"dolor eiusmod aliqua \",\n          \"esse67f\": \"veniam qui in\"\n        }\n      },\n      \"query\": {},\n      \"servername\": \"Duis sed minim quis\",\n      \"service\": \"Greeter\",\n      \"shouldTrackHops\": false,\n      \"timeout\": 48414705.45711616,\n      \"url\": \"https://example.com\"\n    },\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    \"setCookie\": \"anim\",\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  \"locations\": [\n    \"aws:eu-west-3\"\n  ],\n  \"name\": \"Example test name\",\n  \"options\": {\n    \"accept_self_signed\": true,\n    \"allow_insecure\": false,\n    \"checkCertificateRevocation\": false,\n    \"ci\": {\n      \"executionRule\": \"skipped\"\n    },\n    \"device_ids\": [\n      \"laptop_large\",\n      \"laptop_large\"\n    ],\n    \"disableCors\": true,\n    \"disableCsp\": false,\n    \"follow_redirects\": true,\n    \"httpVersion\": \"http2\",\n    \"ignoreServerCertificateError\": false,\n    \"initialNavigationTimeout\": -93160400,\n    \"min_failure_duration\": 9338007,\n    \"min_location_failed\": -22553383,\n    \"monitor_name\": \"nostrud dolor ullamco\",\n    \"monitor_options\": {\n      \"renotify_interval\": 261\n    },\n    \"monitor_priority\": 3,\n    \"noScreenshot\": false,\n    \"restricted_roles\": [\n      \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n    ],\n    \"retry\": {\n      \"count\": 67368482,\n      \"interval\": 59042710.53770983\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\": 427884\n  },\n  \"type\": \"browser\",\n  \"message\": \"\",\n  \"monitor_id\": -23388126,\n  \"public_id\": \"cupidatat ipsum\",\n  \"status\": \"live\",\n  \"steps\": [\n    {\n      \"allowFailure\": false,\n      \"isCritical\": true,\n      \"name\": \"proident dolore ex\",\n      \"noScreenshot\": true,\n      \"params\": {},\n      \"timeout\": 70509439,\n      \"type\": \"assertElementContent\"\n    },\n    {\n      \"allowFailure\": true,\n      \"isCritical\": true,\n      \"name\": \"adipisicing volupt\",\n      \"noScreenshot\": false,\n      \"params\": {},\n      \"timeout\": -22942790,\n      \"type\": \"assertElementContent\"\n    }\n  ],\n  \"tags\": [\n    \"env:prod\"\n  ]\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/synthetics/tests/browser/:public_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "synthetics",
            "tests",
            "browser",
            ":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  \"config\": {\n    \"request\": {\n      \"allow_insecure\": false,\n      \"basicAuth\": {\n        \"password\": \"PaSSw0RD!\",\n        \"username\": \"my_username\",\n        \"type\": \"web\"\n      },\n      \"body\": \"dolore\",\n      \"bodyType\": \"text/plain\",\n      \"callType\": \"unary\",\n      \"certificate\": {\n        \"cert\": {\n          \"content\": \"dolor mollit id eu\",\n          \"filename\": \"enim \",\n          \"updatedAt\": \"ad labore d\"\n        },\n        \"key\": {\n          \"content\": \"anim ut consequat eiusmod\",\n          \"filename\": \"non consectetur voluptate\",\n          \"updatedAt\": \"proi\"\n        }\n      },\n      \"compressedJsonDescriptor\": \"velit cillum\",\n      \"dnsServer\": \"sint irure sit commodo\",\n      \"dnsServerPort\": 63263,\n      \"follow_redirects\": true,\n      \"headers\": {\n        \"nulla_735\": \"esse enim velit\",\n        \"nulla_b_\": \"laboris ut\"\n      },\n      \"host\": \"aliquip nostrud\",\n      \"message\": \"Lorem laboris\",\n      \"metadata\": {\n        \"eub0d\": \"sint\",\n        \"exercitation1\": \"ut Duis\"\n      },\n      \"method\": \"dolo\",\n      \"noSavingResponseBody\": false,\n      \"numberOfPackets\": 1,\n      \"persistCookies\": true,\n      \"port\": 82704033,\n      \"proxy\": {\n        \"url\": \"https://example.com\",\n        \"headers\": {\n          \"ipsum83a\": \"ea laborum\",\n          \"irure_8\": \"dolor eiusmod aliqua \",\n          \"esse67f\": \"veniam qui in\"\n        }\n      },\n      \"query\": {},\n      \"servername\": \"Duis sed minim quis\",\n      \"service\": \"Greeter\",\n      \"shouldTrackHops\": false,\n      \"timeout\": 48414705.45711616,\n      \"url\": \"https://example.com\"\n    },\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    \"setCookie\": \"anim\",\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  \"locations\": [\n    \"aws:eu-west-3\"\n  ],\n  \"name\": \"Example test name\",\n  \"options\": {\n    \"accept_self_signed\": true,\n    \"allow_insecure\": false,\n    \"checkCertificateRevocation\": false,\n    \"ci\": {\n      \"executionRule\": \"skipped\"\n    },\n    \"device_ids\": [\n      \"laptop_large\",\n      \"laptop_large\"\n    ],\n    \"disableCors\": true,\n    \"disableCsp\": false,\n    \"follow_redirects\": true,\n    \"httpVersion\": \"http2\",\n    \"ignoreServerCertificateError\": false,\n    \"initialNavigationTimeout\": -93160400,\n    \"min_failure_duration\": 9338007,\n    \"min_location_failed\": -22553383,\n    \"monitor_name\": \"nostrud dolor ullamco\",\n    \"monitor_options\": {\n      \"renotify_interval\": 261\n    },\n    \"monitor_priority\": 3,\n    \"noScreenshot\": false,\n    \"restricted_roles\": [\n      \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n    ],\n    \"retry\": {\n      \"count\": 67368482,\n      \"interval\": 59042710.53770983\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\": 427884\n  },\n  \"type\": \"browser\",\n  \"message\": \"\",\n  \"monitor_id\": -23388126,\n  \"public_id\": \"cupidatat ipsum\",\n  \"status\": \"live\",\n  \"steps\": [\n    {\n      \"allowFailure\": false,\n      \"isCritical\": true,\n      \"name\": \"proident dolore ex\",\n      \"noScreenshot\": true,\n      \"params\": {},\n      \"timeout\": 70509439,\n      \"type\": \"assertElementContent\"\n    },\n    {\n      \"allowFailure\": true,\n      \"isCritical\": true,\n      \"name\": \"adipisicing volupt\",\n      \"noScreenshot\": false,\n      \"params\": {},\n      \"timeout\": -22942790,\n      \"type\": \"assertElementContent\"\n    }\n  ],\n  \"tags\": [\n    \"env:prod\"\n  ]\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/synthetics/tests/browser/:public_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "synthetics",
            "tests",
            "browser",
            ":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  \"config\": {\n    \"request\": {\n      \"allow_insecure\": false,\n      \"basicAuth\": {\n        \"password\": \"PaSSw0RD!\",\n        \"username\": \"my_username\",\n        \"type\": \"web\"\n      },\n      \"body\": \"dolore\",\n      \"bodyType\": \"text/plain\",\n      \"callType\": \"unary\",\n      \"certificate\": {\n        \"cert\": {\n          \"content\": \"dolor mollit id eu\",\n          \"filename\": \"enim \",\n          \"updatedAt\": \"ad labore d\"\n        },\n        \"key\": {\n          \"content\": \"anim ut consequat eiusmod\",\n          \"filename\": \"non consectetur voluptate\",\n          \"updatedAt\": \"proi\"\n        }\n      },\n      \"compressedJsonDescriptor\": \"velit cillum\",\n      \"dnsServer\": \"sint irure sit commodo\",\n      \"dnsServerPort\": 63263,\n      \"follow_redirects\": true,\n      \"headers\": {\n        \"nulla_735\": \"esse enim velit\",\n        \"nulla_b_\": \"laboris ut\"\n      },\n      \"host\": \"aliquip nostrud\",\n      \"message\": \"Lorem laboris\",\n      \"metadata\": {\n        \"eub0d\": \"sint\",\n        \"exercitation1\": \"ut Duis\"\n      },\n      \"method\": \"dolo\",\n      \"noSavingResponseBody\": false,\n      \"numberOfPackets\": 1,\n      \"persistCookies\": true,\n      \"port\": 82704033,\n      \"proxy\": {\n        \"url\": \"https://example.com\",\n        \"headers\": {\n          \"ipsum83a\": \"ea laborum\",\n          \"irure_8\": \"dolor eiusmod aliqua \",\n          \"esse67f\": \"veniam qui in\"\n        }\n      },\n      \"query\": {},\n      \"servername\": \"Duis sed minim quis\",\n      \"service\": \"Greeter\",\n      \"shouldTrackHops\": false,\n      \"timeout\": 48414705.45711616,\n      \"url\": \"https://example.com\"\n    },\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    \"setCookie\": \"anim\",\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  \"locations\": [\n    \"aws:eu-west-3\"\n  ],\n  \"name\": \"Example test name\",\n  \"options\": {\n    \"accept_self_signed\": true,\n    \"allow_insecure\": false,\n    \"checkCertificateRevocation\": false,\n    \"ci\": {\n      \"executionRule\": \"skipped\"\n    },\n    \"device_ids\": [\n      \"laptop_large\",\n      \"laptop_large\"\n    ],\n    \"disableCors\": true,\n    \"disableCsp\": false,\n    \"follow_redirects\": true,\n    \"httpVersion\": \"http2\",\n    \"ignoreServerCertificateError\": false,\n    \"initialNavigationTimeout\": -93160400,\n    \"min_failure_duration\": 9338007,\n    \"min_location_failed\": -22553383,\n    \"monitor_name\": \"nostrud dolor ullamco\",\n    \"monitor_options\": {\n      \"renotify_interval\": 261\n    },\n    \"monitor_priority\": 3,\n    \"noScreenshot\": false,\n    \"restricted_roles\": [\n      \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n    ],\n    \"retry\": {\n      \"count\": 67368482,\n      \"interval\": 59042710.53770983\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\": 427884\n  },\n  \"type\": \"browser\",\n  \"message\": \"\",\n  \"monitor_id\": -23388126,\n  \"public_id\": \"cupidatat ipsum\",\n  \"status\": \"live\",\n  \"steps\": [\n    {\n      \"allowFailure\": false,\n      \"isCritical\": true,\n      \"name\": \"proident dolore ex\",\n      \"noScreenshot\": true,\n      \"params\": {},\n      \"timeout\": 70509439,\n      \"type\": \"assertElementContent\"\n    },\n    {\n      \"allowFailure\": true,\n      \"isCritical\": true,\n      \"name\": \"adipisicing volupt\",\n      \"noScreenshot\": false,\n      \"params\": {},\n      \"timeout\": -22942790,\n      \"type\": \"assertElementContent\"\n    }\n  ],\n  \"tags\": [\n    \"env:prod\"\n  ]\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/synthetics/tests/browser/:public_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "synthetics",
            "tests",
            "browser",
            ":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  \"config\": {\n    \"request\": {\n      \"allow_insecure\": false,\n      \"basicAuth\": {\n        \"password\": \"PaSSw0RD!\",\n        \"username\": \"my_username\",\n        \"type\": \"web\"\n      },\n      \"body\": \"dolore\",\n      \"bodyType\": \"text/plain\",\n      \"callType\": \"unary\",\n      \"certificate\": {\n        \"cert\": {\n          \"content\": \"dolor mollit id eu\",\n          \"filename\": \"enim \",\n          \"updatedAt\": \"ad labore d\"\n        },\n        \"key\": {\n          \"content\": \"anim ut consequat eiusmod\",\n          \"filename\": \"non consectetur voluptate\",\n          \"updatedAt\": \"proi\"\n        }\n      },\n      \"compressedJsonDescriptor\": \"velit cillum\",\n      \"dnsServer\": \"sint irure sit commodo\",\n      \"dnsServerPort\": 63263,\n      \"follow_redirects\": true,\n      \"headers\": {\n        \"nulla_735\": \"esse enim velit\",\n        \"nulla_b_\": \"laboris ut\"\n      },\n      \"host\": \"aliquip nostrud\",\n      \"message\": \"Lorem laboris\",\n      \"metadata\": {\n        \"eub0d\": \"sint\",\n        \"exercitation1\": \"ut Duis\"\n      },\n      \"method\": \"dolo\",\n      \"noSavingResponseBody\": false,\n      \"numberOfPackets\": 1,\n      \"persistCookies\": true,\n      \"port\": 82704033,\n      \"proxy\": {\n        \"url\": \"https://example.com\",\n        \"headers\": {\n          \"ipsum83a\": \"ea laborum\",\n          \"irure_8\": \"dolor eiusmod aliqua \",\n          \"esse67f\": \"veniam qui in\"\n        }\n      },\n      \"query\": {},\n      \"servername\": \"Duis sed minim quis\",\n      \"service\": \"Greeter\",\n      \"shouldTrackHops\": false,\n      \"timeout\": 48414705.45711616,\n      \"url\": \"https://example.com\"\n    },\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    \"setCookie\": \"anim\",\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  \"locations\": [\n    \"aws:eu-west-3\"\n  ],\n  \"name\": \"Example test name\",\n  \"options\": {\n    \"accept_self_signed\": true,\n    \"allow_insecure\": false,\n    \"checkCertificateRevocation\": false,\n    \"ci\": {\n      \"executionRule\": \"skipped\"\n    },\n    \"device_ids\": [\n      \"laptop_large\",\n      \"laptop_large\"\n    ],\n    \"disableCors\": true,\n    \"disableCsp\": false,\n    \"follow_redirects\": true,\n    \"httpVersion\": \"http2\",\n    \"ignoreServerCertificateError\": false,\n    \"initialNavigationTimeout\": -93160400,\n    \"min_failure_duration\": 9338007,\n    \"min_location_failed\": -22553383,\n    \"monitor_name\": \"nostrud dolor ullamco\",\n    \"monitor_options\": {\n      \"renotify_interval\": 261\n    },\n    \"monitor_priority\": 3,\n    \"noScreenshot\": false,\n    \"restricted_roles\": [\n      \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\"\n    ],\n    \"retry\": {\n      \"count\": 67368482,\n      \"interval\": 59042710.53770983\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\": 427884\n  },\n  \"type\": \"browser\",\n  \"message\": \"\",\n  \"monitor_id\": -23388126,\n  \"public_id\": \"cupidatat ipsum\",\n  \"status\": \"live\",\n  \"steps\": [\n    {\n      \"allowFailure\": false,\n      \"isCritical\": true,\n      \"name\": \"proident dolore ex\",\n      \"noScreenshot\": true,\n      \"params\": {},\n      \"timeout\": 70509439,\n      \"type\": \"assertElementContent\"\n    },\n    {\n      \"allowFailure\": true,\n      \"isCritical\": true,\n      \"name\": \"adipisicing volupt\",\n      \"noScreenshot\": false,\n      \"params\": {},\n      \"timeout\": -22942790,\n      \"type\": \"assertElementContent\"\n    }\n  ],\n  \"tags\": [\n    \"env:prod\"\n  ]\n}",
          "options": {
            "raw": {
              "headerFamily": "json",
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{baseUrl}}/api/v1/synthetics/tests/browser/:public_id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v1",
            "synthetics",
            "tests",
            "browser",
            ":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}"
    }
  ]
}