Chilkat Online Tools

Ruby / Postman API / Create Monitor

Back to Collection Items

require 'chilkat'

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

http = Chilkat::CkHttp.new()

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

# The following JSON is sent in the request body.

# {
#   "monitor": {
#     "name": "This is a Monitor Name",
#     "schedule": {
#       "cron": "0 0 * * *",
#       "timezone": "Asia/Kolkata"
#     },
#     "collection": "5852-8d05dd85-222c-1452-553b-e76a531b71ed",
#     "environment": "5852-8a4c21ea-2a36-40d1-a82d-d717fac9d6ef"
#   }
# }

json = Chilkat::CkJsonObject.new()
json.UpdateString("monitor.name","This is a Monitor Name")
json.UpdateString("monitor.schedule.cron","0 0 * * *")
json.UpdateString("monitor.schedule.timezone","Asia/Kolkata")
json.UpdateString("monitor.collection","5852-8d05dd85-222c-1452-553b-e76a531b71ed")
json.UpdateString("monitor.environment","5852-8a4c21ea-2a36-40d1-a82d-d717fac9d6ef")

http.SetRequestHeader("Content-Type","application/json")
http.SetRequestHeader("X-API-Key","{{postman_api_key}}")

# resp is a CkHttpResponse
resp = http.PostJson3("https://api.getpostman.com/monitors","application/json",json)
if (http.get_LastMethodSuccess() == false)
    print http.lastErrorText() + "\n";
    exit
end

sbResponseBody = Chilkat::CkStringBuilder.new()
resp.GetBodySb(sbResponseBody)

jResp = Chilkat::CkJsonObject.new()
jResp.LoadSb(sbResponseBody)
jResp.put_EmitCompact(false)

print "Response Body:" + "\n";
print jResp.emit() + "\n";

respStatusCode = resp.get_StatusCode()
print "Response Status Code = " + respStatusCode.to_s() + "\n";
if (respStatusCode >= 400)
    print "Response Header:" + "\n";
    print resp.header() + "\n";
    print "Failed." + "\n";

    exit
end

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

# {
#   "monitor": {
#     "id": "1e6b6dfd-7ba4-4590-9ee1-5948102d7797",
#     "name": "Monitor Name",
#     "uid": "5852-1e6b6dfd-7ba4-4590-9ee1-5948102d7797"
#   }
# }

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

Id = jResp.stringOf("monitor.id")
Name = jResp.stringOf("monitor.name")
Uid = jResp.stringOf("monitor.uid")

Curl Command

curl -X POST
	-H "X-API-Key: {{postman_api_key}}"
	-H "Content-Type: application/json"
	-d '{
  "monitor": {
    "name": "This is a Monitor Name",
    "schedule": {
      "cron": "0 0 * * *",
      "timezone": "Asia/Kolkata"
    },
    "collection": "5852-8d05dd85-222c-1452-553b-e76a531b71ed",
    "environment": "5852-8a4c21ea-2a36-40d1-a82d-d717fac9d6ef"
  }
}'
https://api.getpostman.com/monitors

Postman Collection Item JSON

{
  "name": "Create Monitor",
  "request": {
    "method": "POST",
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n  \"monitor\": {\n    \"name\": \"This is a Monitor Name\",\n    \"schedule\": {\n      \"cron\": \"0 0 * * *\",\n      \"timezone\": \"Asia/Kolkata\"\n    },\n    \"collection\": \"5852-8d05dd85-222c-1452-553b-e76a531b71ed\",\n    \"environment\": \"5852-8a4c21ea-2a36-40d1-a82d-d717fac9d6ef\"\n  }\n}"
    },
    "url": {
      "raw": "https://api.getpostman.com/monitors",
      "protocol": "https",
      "host": [
        "api",
        "getpostman",
        "com"
      ],
      "path": [
        "monitors"
      ]
    },
    "description": "This endpoint allows you to create a monitor.\n\nSome sample `cron` values are:\n\n| Frequency                  | Cron Pattern   |\n|-----------------------|----------------|\n| Every 5 minutes       | `*/5 * * * *`  |\n| Every 30 minutes     | `*/30 * * * *` |\n| Every Hour         | `0 */1 * * *`  |\n| Every 6 Hours      | `0 */6 * * *`  |\n| Every day at 5pm    | `0 17 * * *`   |\n| Every Monday at 12pm  | `0 12 * * MON` |\n| Every weekday (Monday - Friday) at 6am | `0 6 * * MON-FRI` |\n\nNote: Currently, you can only create monitors at some limited schedules. You can head to [Postman Monitors](https://monitor.getpostman.com) to see the allowed schedules. \n\nFor more information about the format of the `timezone` value, check this [list of time zones.](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)\n\nYou can also specify the context of a workspace to create a monitor in directly by passing the `workspace` as a query param.\n\n\n> Requires <a href=\"#authentication\">API Key</a> as `X-Api-Key` request header or `apikey` URL query parameter."
  },
  "response": [
    {
      "name": "Cron Pattern Not Allowed",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n\t\"monitor\": {\n\t\t\"name\": \"This is a Monitor Name\",\n\t\t\"schedule\": {\n\t\t\t\"cron\": \"* * * * *\",\n\t\t\t\"timezone\": \"Asia/Kolkata\"\n\t\t},\n\t\t\"collection\": \"5852-8d05dd85-222c-1452-553b-e76a531b71ed\",\n\t\t\"environment\": \"5852-8a4c21ea-2a36-40d1-a82d-d717fac9d6ef\"\n\t}\n}"
        },
        "url": {
          "raw": "https://api.getpostman.com/monitors",
          "protocol": "https",
          "host": [
            "api",
            "getpostman",
            "com"
          ],
          "path": [
            "monitors"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json",
          "name": "Content-Type",
          "description": {
            "content": "",
            "type": "text/plain"
          }
        }
      ],
      "cookie": [
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "yes",
          "key": "getpostmanlogin"
        },
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "813af79fd620c970d59f4e41275292a96873bb5065975eccf67a84cfdc24b448037430d26c2a29f4192ad492875ed7a0d53bbea8c63f760bb75c886624b4da560fc52c7f9f9e79837bee212f90b9a59c1dfcf94b95156b20f45169eab2ed93b0c38669819143ae41e45dfaac6a5f0cf6d5e76ca40134c3bd9ef9f5532ad6d179519aa0315fe4e6e157ee9d71c9f14aa9b0455ff84f94ae7519f1139d0cccdeeef7e2aafe1696cf640ec874c62d4d5bda3dbe17cf6083fb276b7f3355eb19162430f171166d19a7d79da028c76b3c2b97e88c93dc7183bc486d9d331b93b9a20de1216e84ca74f7b6887df61785d0b65be19f56283523f211fd43a772afa39aadc3b8dc011ba680b69a7e4fcda83be75d593c8ce6c6997bf530b57a8036881ea3d5b3c28d096099ca712f5d6916b453f1b338c455c4f861da638dffd05fd2a3dd5b9dd6dbe5f2c3a30e304363c9c2bcfbe5d9abeba9c06df16d155a70c6b0a9848f7446a5646e58640d7fad642df11350f528e4bacb5c446986cddf8f0c7ad10ec1067daccca962d6fb90aad8db55c2ffa1dc8716865350d5127cb69e44cfc4511836cbc5828c1c01370c7464fef1f07c716456a57a467bc1445ea88b705ef9c0c068948a73dca851804663befbc2d9aec7cfc3a2daf377b1a8c020091216d82504ff9b38c84234ad9b6f8c596a",
          "key": "postman.sid"
        },
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "b8ee90dd180562a5a21edad92ea0b987583b7599811884947b9aae88d0c060e8abb0c337534285da6defa4cfabba320b37b611b2c9586b81cb38220830b58440a2ff03756c898b89eb08799bc486c7dc08643ef1ee6e38e5988c4aafda47f1ed26c4218a23620f43d57aa19bb7f79762b394384215a7805e6b1c2cc092b6ac5ad8e8848b1ce655edba6f52820a2ac5acf3d289dda878c6a1fe62e88bb4159f605e8081afa2afce7a72a0c5d96515d566bcbf9cb3842cfc2b7f3a48badbcbfb9e5907b6451674d2c09cf6bf0b34b967edfc3a6389a834f7be21592ba2fbf7aa9eaaa6b87f99590813ded37c6e4ad17e7afcca74455b703d2d653e6ce063ce8eb195ce46c910a1b61fb71f13a8cb52ab2a7bded1b9b5a6b56ad5a66ceafc20afc70962a1f49b8abf2ce3f9e7cf3f44aaf0f41f81605b4ee612f3044d81b787a7cb128c56474a25cdc13803e9057603ead1f1fd6666ae5467ca9e250bb228dfd11dafd16345019bb7e06c58b27bf69d550cbfcef348bc746fdea61d4ea93c48d5f5e4e729adf18655669170f0a059025a79fb2a48f924d9748895a42780d1a9fae32ebf2d57df434c60b675412e217d126b9edbd28b949dfcbcbc8518aa51339d3e1d1f37c6cac4866064c54a476cf94d749a570938a7ad3ce28a9f1c5ea6623b",
          "key": "postman-staging.sid"
        }
      ],
      "body": "{\n  \"error\": {\n    \"name\": \"cronPatternNotAllowedError\",\n    \"message\": \"The specified cron pattern is not allowed. Please check https://monitor.getpostman.com for the allowed schedules.\",\n    \"details\": {\n      \"pattern\": \"* * * * *\"\n    }\n  }\n}"
    },
    {
      "name": "Invalid Collection UID",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n\t\"monitor\": {\n\t\t\"name\": \"This is a Monitor Name\",\n\t\t\"schedule\": {\n\t\t\t\"cron\": \"0 0 * * *\",\n\t\t\t\"timezone\": \"Asia/Kolkata\"\n\t\t},\n\t\t\"collection\": \"8d05dd85-222c-1452-553b-e76a531b71ed\",\n\t\t\"environment\": \"5852-8a4c21ea-2a36-40d1-a82d-d717fac9d6ef\"\n\t}\n}"
        },
        "url": {
          "raw": "https://api.getpostman.com/monitors",
          "protocol": "https",
          "host": [
            "api",
            "getpostman",
            "com"
          ],
          "path": [
            "monitors"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json",
          "name": "Content-Type",
          "description": {
            "content": "",
            "type": "text/plain"
          }
        }
      ],
      "cookie": [
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "yes",
          "key": "getpostmanlogin"
        },
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "813af79fd620c970d59f4e41275292a96873bb5065975eccf67a84cfdc24b448037430d26c2a29f4192ad492875ed7a0d53bbea8c63f760bb75c886624b4da560fc52c7f9f9e79837bee212f90b9a59c1dfcf94b95156b20f45169eab2ed93b0c38669819143ae41e45dfaac6a5f0cf6d5e76ca40134c3bd9ef9f5532ad6d179519aa0315fe4e6e157ee9d71c9f14aa9b0455ff84f94ae7519f1139d0cccdeeef7e2aafe1696cf640ec874c62d4d5bda3dbe17cf6083fb276b7f3355eb19162430f171166d19a7d79da028c76b3c2b97e88c93dc7183bc486d9d331b93b9a20de1216e84ca74f7b6887df61785d0b65be19f56283523f211fd43a772afa39aadc3b8dc011ba680b69a7e4fcda83be75d593c8ce6c6997bf530b57a8036881ea3d5b3c28d096099ca712f5d6916b453f1b338c455c4f861da638dffd05fd2a3dd5b9dd6dbe5f2c3a30e304363c9c2bcfbe5d9abeba9c06df16d155a70c6b0a9848f7446a5646e58640d7fad642df11350f528e4bacb5c446986cddf8f0c7ad10ec1067daccca962d6fb90aad8db55c2ffa1dc8716865350d5127cb69e44cfc4511836cbc5828c1c01370c7464fef1f07c716456a57a467bc1445ea88b705ef9c0c068948a73dca851804663befbc2d9aec7cfc3a2daf377b1a8c020091216d82504ff9b38c84234ad9b6f8c596a",
          "key": "postman.sid"
        },
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "b8ee90dd180562a5a21edad92ea0b987583b7599811884947b9aae88d0c060e8abb0c337534285da6defa4cfabba320b37b611b2c9586b81cb38220830b58440a2ff03756c898b89eb08799bc486c7dc08643ef1ee6e38e5988c4aafda47f1ed26c4218a23620f43d57aa19bb7f79762b394384215a7805e6b1c2cc092b6ac5ad8e8848b1ce655edba6f52820a2ac5acf3d289dda878c6a1fe62e88bb4159f605e8081afa2afce7a72a0c5d96515d566bcbf9cb3842cfc2b7f3a48badbcbfb9e5907b6451674d2c09cf6bf0b34b967edfc3a6389a834f7be21592ba2fbf7aa9eaaa6b87f99590813ded37c6e4ad17e7afcca74455b703d2d653e6ce063ce8eb195ce46c910a1b61fb71f13a8cb52ab2a7bded1b9b5a6b56ad5a66ceafc20afc70962a1f49b8abf2ce3f9e7cf3f44aaf0f41f81605b4ee612f3044d81b787a7cb128c56474a25cdc13803e9057603ead1f1fd6666ae5467ca9e250bb228dfd11dafd16345019bb7e06c58b27bf69d550cbfcef348bc746fdea61d4ea93c48d5f5e4e729adf18655669170f0a059025a79fb2a48f924d9748895a42780d1a9fae32ebf2d57df434c60b675412e217d126b9edbd28b949dfcbcbc8518aa51339d3e1d1f37c6cac4866064c54a476cf94d749a570938a7ad3ce28a9f1c5ea6623b",
          "key": "postman-staging.sid"
        }
      ],
      "body": "{\n  \"error\": {\n    \"name\": \"invalidUidError\",\n    \"message\": \"The specified uid is invalid.\",\n    \"details\": {\n      \"param\": \"collection\",\n      \"uid\": \"8d05dd85-222c-1452-553b-e76a531b71ed\"\n    }\n  }\n}"
    },
    {
      "name": "Invalid Environment UID",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n\t\"monitor\": {\n\t\t\"name\": \"This is a Monitor Name\",\n\t\t\"schedule\": {\n\t\t\t\"cron\": \"0 0 * * *\",\n\t\t\t\"timezone\": \"Asia/Kolkata\"\n\t\t},\n\t\t\"collection\": \"5852-8d05dd85-222c-1452-553b-e76a531b71ed\",\n\t\t\"environment\": \"8a4c21ea-2a36-40d1-a82d-d717fac9d6ef\"\n\t}\n}"
        },
        "url": {
          "raw": "https://api.getpostman.com/monitors",
          "protocol": "https",
          "host": [
            "api",
            "getpostman",
            "com"
          ],
          "path": [
            "monitors"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json",
          "name": "Content-Type",
          "description": {
            "content": "",
            "type": "text/plain"
          }
        }
      ],
      "cookie": [
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "yes",
          "key": "getpostmanlogin"
        },
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "813af79fd620c970d59f4e41275292a96873bb5065975eccf67a84cfdc24b448037430d26c2a29f4192ad492875ed7a0d53bbea8c63f760bb75c886624b4da560fc52c7f9f9e79837bee212f90b9a59c1dfcf94b95156b20f45169eab2ed93b0c38669819143ae41e45dfaac6a5f0cf6d5e76ca40134c3bd9ef9f5532ad6d179519aa0315fe4e6e157ee9d71c9f14aa9b0455ff84f94ae7519f1139d0cccdeeef7e2aafe1696cf640ec874c62d4d5bda3dbe17cf6083fb276b7f3355eb19162430f171166d19a7d79da028c76b3c2b97e88c93dc7183bc486d9d331b93b9a20de1216e84ca74f7b6887df61785d0b65be19f56283523f211fd43a772afa39aadc3b8dc011ba680b69a7e4fcda83be75d593c8ce6c6997bf530b57a8036881ea3d5b3c28d096099ca712f5d6916b453f1b338c455c4f861da638dffd05fd2a3dd5b9dd6dbe5f2c3a30e304363c9c2bcfbe5d9abeba9c06df16d155a70c6b0a9848f7446a5646e58640d7fad642df11350f528e4bacb5c446986cddf8f0c7ad10ec1067daccca962d6fb90aad8db55c2ffa1dc8716865350d5127cb69e44cfc4511836cbc5828c1c01370c7464fef1f07c716456a57a467bc1445ea88b705ef9c0c068948a73dca851804663befbc2d9aec7cfc3a2daf377b1a8c020091216d82504ff9b38c84234ad9b6f8c596a",
          "key": "postman.sid"
        },
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "b8ee90dd180562a5a21edad92ea0b987583b7599811884947b9aae88d0c060e8abb0c337534285da6defa4cfabba320b37b611b2c9586b81cb38220830b58440a2ff03756c898b89eb08799bc486c7dc08643ef1ee6e38e5988c4aafda47f1ed26c4218a23620f43d57aa19bb7f79762b394384215a7805e6b1c2cc092b6ac5ad8e8848b1ce655edba6f52820a2ac5acf3d289dda878c6a1fe62e88bb4159f605e8081afa2afce7a72a0c5d96515d566bcbf9cb3842cfc2b7f3a48badbcbfb9e5907b6451674d2c09cf6bf0b34b967edfc3a6389a834f7be21592ba2fbf7aa9eaaa6b87f99590813ded37c6e4ad17e7afcca74455b703d2d653e6ce063ce8eb195ce46c910a1b61fb71f13a8cb52ab2a7bded1b9b5a6b56ad5a66ceafc20afc70962a1f49b8abf2ce3f9e7cf3f44aaf0f41f81605b4ee612f3044d81b787a7cb128c56474a25cdc13803e9057603ead1f1fd6666ae5467ca9e250bb228dfd11dafd16345019bb7e06c58b27bf69d550cbfcef348bc746fdea61d4ea93c48d5f5e4e729adf18655669170f0a059025a79fb2a48f924d9748895a42780d1a9fae32ebf2d57df434c60b675412e217d126b9edbd28b949dfcbcbc8518aa51339d3e1d1f37c6cac4866064c54a476cf94d749a570938a7ad3ce28a9f1c5ea6623b",
          "key": "postman-staging.sid"
        }
      ],
      "body": "{\n  \"error\": {\n    \"name\": \"invalidUidError\",\n    \"message\": \"The specified uid is invalid.\",\n    \"details\": {\n      \"param\": \"environment\",\n      \"uid\": \"8a4c21ea-2a36-40d1-a82d-d717fac9d6ef\"\n    }\n  }\n}"
    },
    {
      "name": "Monitor Created",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "name": "Content-Type",
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"monitor\": {\n    \"name\": \"This is a Monitor Name\",\n    \"schedule\": {\n      \"cron\": \"0 0 * * *\",\n      \"timezone\": \"Asia/Kolkata\"\n    },\n    \"collection\": \"5852-8d05dd85-222c-1452-553b-e76a531b71ed\",\n    \"environment\": \"5852-8a4c21ea-2a36-40d1-a82d-d717fac9d6ef\"\n  }\n}"
        },
        "url": {
          "raw": "https://api.getpostman.com/monitors",
          "protocol": "https",
          "host": [
            "api",
            "getpostman",
            "com"
          ],
          "path": [
            "monitors"
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json",
          "name": "Content-Type",
          "description": {
            "content": "",
            "type": "text/plain"
          }
        }
      ],
      "cookie": [
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "yes",
          "key": "getpostmanlogin"
        },
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "0e9f9b1f3e7218e7fd625cca14597bc771064a433bdd75b5a40196cef86c3fa29d483358e0b254b0a097ac305b132ec8481e2c5b835663fbed3bbb93b5a747cf8776efe85650e29a8e5f0a63906480e5b9e5a9860bef703234812ce9f65ea6dcbc099ac952d1c36338e2d192a793b82a1d8a2dd6dd031f831c08805a9e7ea1f55d46c54cf6ecaecbac84ddf581c8a267a116c0d6d935f19171bce93c6e040c0bd49fc1325bdb8929914548d7c0cae78796aba4073dc9ab63194a90e430919d8757c7ccb7b4dffc61b9cd4a748edc88d0b4ba727c83ea1af546908ff63a1e2ee9784a7b9af2f61997e0dd34adcb479151d11d0e8d67ba76050d55c7bbb88f2f700e14f848f6b929b441869fba53436eb7983660d0e4af82aa0dc5c47dddf974599280179889c03c3e38212eaa8270c641298f0a49b923ed3d04d61e2c6c25844b67df9e4814d378b440e8124e429dc292a147038a57c03e8b8ece700b376fcf8e002dca35142f97b5f49144e2f7477b99d767dff12bb37dd846419051bdaa4c6d931545a5df09bda8a80a336585e5d6ba44f087607512344f91321a359dc150cb411600fbf0d974f63116046d681d3f82a16e50e3bb69c463430e284f64e007f354a9ed4a2afdb27caad0414d451875ec78ea98924e32d8f881eb2c260b348e00baf782",
          "key": "postman.sid"
        }
      ],
      "body": "{\n  \"monitor\": {\n    \"id\": \"1e6b6dfd-7ba4-4590-9ee1-5948102d7797\",\n    \"name\": \"Monitor Name\",\n    \"uid\": \"5852-1e6b6dfd-7ba4-4590-9ee1-5948102d7797\"\n  }\n}"
    },
    {
      "name": "Invalid Timezone",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n\t\"monitor\": {\n\t\t\"name\": \"This is a Monitor Name\",\n\t\t\"schedule\": {\n\t\t\t\"cron\": \"0 0 * * *\",\n\t\t\t\"timezone\": \"this is not a timezone\"\n\t\t},\n\t\t\"collection\": \"5852-8d05dd85-222c-1452-553b-e76a531b71ed\",\n\t\t\"environment\": \"5852-8a4c21ea-2a36-40d1-a82d-d717fac9d6ef\"\n\t}\n}"
        },
        "url": {
          "raw": "https://api.getpostman.com/monitors",
          "protocol": "https",
          "host": [
            "api",
            "getpostman",
            "com"
          ],
          "path": [
            "monitors"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json",
          "name": "Content-Type",
          "description": {
            "content": "",
            "type": "text/plain"
          }
        }
      ],
      "cookie": [
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "yes",
          "key": "getpostmanlogin"
        },
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "813af79fd620c970d59f4e41275292a96873bb5065975eccf67a84cfdc24b448037430d26c2a29f4192ad492875ed7a0d53bbea8c63f760bb75c886624b4da560fc52c7f9f9e79837bee212f90b9a59c1dfcf94b95156b20f45169eab2ed93b0c38669819143ae41e45dfaac6a5f0cf6d5e76ca40134c3bd9ef9f5532ad6d179519aa0315fe4e6e157ee9d71c9f14aa9b0455ff84f94ae7519f1139d0cccdeeef7e2aafe1696cf640ec874c62d4d5bda3dbe17cf6083fb276b7f3355eb19162430f171166d19a7d79da028c76b3c2b97e88c93dc7183bc486d9d331b93b9a20de1216e84ca74f7b6887df61785d0b65be19f56283523f211fd43a772afa39aadc3b8dc011ba680b69a7e4fcda83be75d593c8ce6c6997bf530b57a8036881ea3d5b3c28d096099ca712f5d6916b453f1b338c455c4f861da638dffd05fd2a3dd5b9dd6dbe5f2c3a30e304363c9c2bcfbe5d9abeba9c06df16d155a70c6b0a9848f7446a5646e58640d7fad642df11350f528e4bacb5c446986cddf8f0c7ad10ec1067daccca962d6fb90aad8db55c2ffa1dc8716865350d5127cb69e44cfc4511836cbc5828c1c01370c7464fef1f07c716456a57a467bc1445ea88b705ef9c0c068948a73dca851804663befbc2d9aec7cfc3a2daf377b1a8c020091216d82504ff9b38c84234ad9b6f8c596a",
          "key": "postman.sid"
        },
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "b8ee90dd180562a5a21edad92ea0b987583b7599811884947b9aae88d0c060e8abb0c337534285da6defa4cfabba320b37b611b2c9586b81cb38220830b58440a2ff03756c898b89eb08799bc486c7dc08643ef1ee6e38e5988c4aafda47f1ed26c4218a23620f43d57aa19bb7f79762b394384215a7805e6b1c2cc092b6ac5ad8e8848b1ce655edba6f52820a2ac5acf3d289dda878c6a1fe62e88bb4159f605e8081afa2afce7a72a0c5d96515d566bcbf9cb3842cfc2b7f3a48badbcbfb9e5907b6451674d2c09cf6bf0b34b967edfc3a6389a834f7be21592ba2fbf7aa9eaaa6b87f99590813ded37c6e4ad17e7afcca74455b703d2d653e6ce063ce8eb195ce46c910a1b61fb71f13a8cb52ab2a7bded1b9b5a6b56ad5a66ceafc20afc70962a1f49b8abf2ce3f9e7cf3f44aaf0f41f81605b4ee612f3044d81b787a7cb128c56474a25cdc13803e9057603ead1f1fd6666ae5467ca9e250bb228dfd11dafd16345019bb7e06c58b27bf69d550cbfcef348bc746fdea61d4ea93c48d5f5e4e729adf18655669170f0a059025a79fb2a48f924d9748895a42780d1a9fae32ebf2d57df434c60b675412e217d126b9edbd28b949dfcbcbc8518aa51339d3e1d1f37c6cac4866064c54a476cf94d749a570938a7ad3ce28a9f1c5ea6623b",
          "key": "postman-staging.sid"
        }
      ],
      "body": "{\n  \"error\": {\n    \"name\": \"invalidParamsError\",\n    \"message\": \"The request had invalid parameters\",\n    \"details\": {\n      \"param\": \"schedule.timezone\"\n    }\n  }\n}"
    },
    {
      "name": "Parameter Missing",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n\t\n}"
        },
        "url": {
          "raw": "https://api.getpostman.com/monitors",
          "protocol": "https",
          "host": [
            "api",
            "getpostman",
            "com"
          ],
          "path": [
            "monitors"
          ]
        }
      },
      "status": "Bad Request",
      "code": 400,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json",
          "name": "Content-Type",
          "description": {
            "content": "",
            "type": "text/plain"
          }
        }
      ],
      "cookie": [
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "yes",
          "key": "getpostmanlogin"
        },
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "813af79fd620c970d59f4e41275292a96873bb5065975eccf67a84cfdc24b448037430d26c2a29f4192ad492875ed7a0d53bbea8c63f760bb75c886624b4da560fc52c7f9f9e79837bee212f90b9a59c1dfcf94b95156b20f45169eab2ed93b0c38669819143ae41e45dfaac6a5f0cf6d5e76ca40134c3bd9ef9f5532ad6d179519aa0315fe4e6e157ee9d71c9f14aa9b0455ff84f94ae7519f1139d0cccdeeef7e2aafe1696cf640ec874c62d4d5bda3dbe17cf6083fb276b7f3355eb19162430f171166d19a7d79da028c76b3c2b97e88c93dc7183bc486d9d331b93b9a20de1216e84ca74f7b6887df61785d0b65be19f56283523f211fd43a772afa39aadc3b8dc011ba680b69a7e4fcda83be75d593c8ce6c6997bf530b57a8036881ea3d5b3c28d096099ca712f5d6916b453f1b338c455c4f861da638dffd05fd2a3dd5b9dd6dbe5f2c3a30e304363c9c2bcfbe5d9abeba9c06df16d155a70c6b0a9848f7446a5646e58640d7fad642df11350f528e4bacb5c446986cddf8f0c7ad10ec1067daccca962d6fb90aad8db55c2ffa1dc8716865350d5127cb69e44cfc4511836cbc5828c1c01370c7464fef1f07c716456a57a467bc1445ea88b705ef9c0c068948a73dca851804663befbc2d9aec7cfc3a2daf377b1a8c020091216d82504ff9b38c84234ad9b6f8c596a",
          "key": "postman.sid"
        },
        {
          "expires": "Invalid Date",
          "hostOnly": false,
          "httpOnly": false,
          "domain": "getpostman.com",
          "path": "/",
          "secure": false,
          "session": false,
          "value": "b8ee90dd180562a5a21edad92ea0b987583b7599811884947b9aae88d0c060e8abb0c337534285da6defa4cfabba320b37b611b2c9586b81cb38220830b58440a2ff03756c898b89eb08799bc486c7dc08643ef1ee6e38e5988c4aafda47f1ed26c4218a23620f43d57aa19bb7f79762b394384215a7805e6b1c2cc092b6ac5ad8e8848b1ce655edba6f52820a2ac5acf3d289dda878c6a1fe62e88bb4159f605e8081afa2afce7a72a0c5d96515d566bcbf9cb3842cfc2b7f3a48badbcbfb9e5907b6451674d2c09cf6bf0b34b967edfc3a6389a834f7be21592ba2fbf7aa9eaaa6b87f99590813ded37c6e4ad17e7afcca74455b703d2d653e6ce063ce8eb195ce46c910a1b61fb71f13a8cb52ab2a7bded1b9b5a6b56ad5a66ceafc20afc70962a1f49b8abf2ce3f9e7cf3f44aaf0f41f81605b4ee612f3044d81b787a7cb128c56474a25cdc13803e9057603ead1f1fd6666ae5467ca9e250bb228dfd11dafd16345019bb7e06c58b27bf69d550cbfcef348bc746fdea61d4ea93c48d5f5e4e729adf18655669170f0a059025a79fb2a48f924d9748895a42780d1a9fae32ebf2d57df434c60b675412e217d126b9edbd28b949dfcbcbc8518aa51339d3e1d1f37c6cac4866064c54a476cf94d749a570938a7ad3ce28a9f1c5ea6623b",
          "key": "postman-staging.sid"
        }
      ],
      "body": "{\n  \"error\": {\n    \"name\": \"paramMissingError\",\n    \"message\": \"Parameter is missing in the request.\",\n    \"details\": {\n      \"param\": \"monitor\"\n    }\n  }\n}"
    },
    {
      "name": "Create Monitor in a Workspace",
      "originalRequest": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"monitor\": {\n    \"name\": \"This is a Monitor Name\",\n    \"schedule\": {\n      \"cron\": \"0 0 * * *\",\n      \"timezone\": \"Asia/Kolkata\"\n    },\n    \"collection\": \"5852-8d05dd85-222c-1452-553b-e76a531b71ed\",\n    \"environment\": \"5852-8a4c21ea-2a36-40d1-a82d-d717fac9d6ef\"\n  }\n}"
        },
        "url": {
          "raw": "https://api.getpostman.com/monitors?workspace={{workspace_id}}",
          "protocol": "https",
          "host": [
            "api",
            "getpostman",
            "com"
          ],
          "path": [
            "monitors"
          ],
          "query": [
            {
              "key": "workspace",
              "value": "{{workspace_id}}",
              "description": "The workspace ID in which the monitor will be created"
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json",
          "name": "Content-Type",
          "description": {
            "content": "",
            "type": "text/plain"
          }
        }
      ],
      "cookie": [
      ],
      "body": "{\n    \"monitor\": {\n        \"id\": \"1e6b6dfd-7ba4-4590-9ee1-5948102d7797\",\n        \"name\": \"Monitor Name\",\n        \"uid\": \"5852-1e6b6dfd-7ba4-4590-9ee1-5948102d7797\"\n    }\n}"
    }
  ]
}