statping/source/tmpl/postman.json

1376 lines
32 KiB
JSON
Raw Normal View History

2018-09-12 21:29:47 +00:00
{
"info": {
"_postman_id": "d74ac4a3-8915-46e8-8ed2-5044ea4ce53b",
"name": "Statup",
"description": "Statup API Requests",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Main",
"item": [
{
"name": "Statup Details",
2018-11-17 17:14:14 +00:00
"event": [
{
"listen": "test",
"script": {
"id": "08b8f487-2318-44b9-bdb8-f1f1041e9462",
"exec": [
"pm.test(\"Check Core API Route\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.name).to.eql(\"Statup\");",
" pm.expect(jsonData.description).to.eql(\"Statup Monitoring Sample Data\");",
" pm.expect(jsonData.using_cdn).to.eql(false);",
" pm.expect(jsonData.database).to.eql(\"sqlite\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
2018-09-12 21:29:47 +00:00
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_key}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {},
"url": {
"raw": "{{endpoint}}/api",
"host": [
"{{endpoint}}"
],
"path": [
"api"
]
}
},
"response": []
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_key}}",
"type": "string"
}
]
}
},
{
"name": "Services",
"item": [
{
2018-11-17 17:14:14 +00:00
"name": "All Services",
"event": [
{
"listen": "test",
"script": {
"id": "d87f8a4e-7640-45b8-9d45-4f6e6f2463ee",
"exec": [
"pm.test(\"View All Services\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.length).to.eql(5);",
"});"
],
"type": "text/javascript"
}
}
],
2018-09-12 21:29:47 +00:00
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_key}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
2018-11-17 17:14:14 +00:00
"body": {
"mode": "raw",
"raw": ""
},
2018-09-12 21:29:47 +00:00
"url": {
"raw": "{{endpoint}}/api/services",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"services"
]
}
},
"response": []
},
{
"name": "View Service",
2018-11-17 17:14:14 +00:00
"event": [
{
"listen": "test",
"script": {
"id": "023c5643-6cb1-4cd0-b775-566f232d68f8",
"exec": [
"pm.test(\"View Service\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.name).to.eql(\"Google\");",
" pm.expect(jsonData.status_code).to.eql(200);",
" pm.expect(jsonData.type).to.eql(\"http\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
2018-09-12 21:29:47 +00:00
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_key}}",
"type": "string"
}
]
},
"method": "GET",
2018-11-17 17:14:14 +00:00
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"token\": {\n\t\t\"value\": \"ExponentPushToken[SBryVgIxjgaMKCP5MBtt2J]\"\n\t},\n\t\"user\": {\n\t\t\"username\": \"Brent\"\n\t}\n}"
},
2018-09-12 21:29:47 +00:00
"url": {
"raw": "{{endpoint}}/api/services/1",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"services",
"1"
]
}
},
"response": []
},
2018-11-17 17:14:14 +00:00
{
"name": "View Service Chart Data",
"event": [
{
"listen": "test",
"script": {
"id": "023c5643-6cb1-4cd0-b775-566f232d68f8",
"exec": [
"pm.test(\"Service Chart Default\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.data.length).to.be.at.least(100);",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_key}}",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{endpoint}}/api/services/1/data",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"services",
"1",
"data"
]
}
},
"response": []
},
2018-09-12 21:29:47 +00:00
{
"name": "Create Service",
2018-11-17 17:14:14 +00:00
"event": [
{
"listen": "test",
"script": {
"id": "d4eb16fe-8495-40e5-9ca3-be20951e5133",
"exec": [
"pm.test(\"Create Service\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.output.name).to.eql(\"New Service\");",
" pm.expect(jsonData.output.domain).to.eql(\"https://statup.io\");",
" pm.expect(jsonData.output.type).to.eql(\"http\");",
" pm.expect(jsonData.output.method).to.eql(\"GET\");",
" pm.expect(jsonData.output.expected_status).to.eql(200);",
"});"
],
"type": "text/javascript"
}
}
],
2018-09-12 21:29:47 +00:00
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_key}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
2018-11-17 17:14:14 +00:00
"raw": "{\n \"name\": \"New Service\",\n \"domain\": \"https://statup.io\",\n \"expected\": \"\",\n \"expected_status\": 200,\n \"check_interval\": 30,\n \"type\": \"http\",\n \"method\": \"GET\",\n \"post_data\": \"\",\n \"port\": 0,\n \"timeout\": 30,\n \"order_id\": 0\n}"
2018-09-12 21:29:47 +00:00
},
"url": {
"raw": "{{endpoint}}/api/services",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"services"
]
}
},
"response": []
},
{
"name": "Update Service",
2018-11-17 17:14:14 +00:00
"event": [
{
"listen": "test",
"script": {
"id": "b5a67a19-fd08-40b0-a961-3e9474ab78c6",
"exec": [
"pm.test(\"Update Service\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.output.name).to.eql(\"Updated Google Service\");",
" pm.expect(jsonData.output.domain).to.eql(\"https://google.com\");",
" pm.expect(jsonData.output.type).to.eql(\"http\");",
" pm.expect(jsonData.output.method).to.eql(\"GET\");",
" pm.expect(jsonData.output.expected_status).to.eql(200);",
"});"
],
"type": "text/javascript"
}
}
],
2018-09-12 21:29:47 +00:00
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_key}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
2018-11-17 17:14:14 +00:00
"raw": "{\n\t\"id\": 1,\n \"name\": \"Updated Google Service\",\n \"domain\": \"https://google.com\",\n \"expected\": \"\",\n \"expected_status\": 200,\n \"check_interval\": 60,\n \"type\": \"http\",\n \"method\": \"GET\",\n \"post_data\": \"\",\n \"port\": 0,\n \"timeout\": 10,\n \"order_id\": 0\n}"
2018-09-12 21:29:47 +00:00
},
"url": {
2018-11-17 17:14:14 +00:00
"raw": "{{endpoint}}/api/services/1",
2018-09-12 21:29:47 +00:00
"host": [
"{{endpoint}}"
],
"path": [
"api",
"services",
2018-11-17 17:14:14 +00:00
"1"
2018-09-12 21:29:47 +00:00
]
}
},
"response": []
},
{
"name": "Delete Service",
2018-11-17 17:14:14 +00:00
"event": [
{
"listen": "test",
"script": {
"id": "dd4d721d-d874-448b-abc9-59c1afceb58e",
"exec": [
"pm.test(\"Delete Service\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.status).to.eql(\"success\");",
" pm.expect(jsonData.type).to.eql(\"service\");",
" pm.expect(jsonData.method).to.eql(\"delete\");",
"});"
],
"type": "text/javascript"
}
}
],
2018-09-12 21:29:47 +00:00
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_key}}",
"type": "string"
}
]
},
"method": "DELETE",
"header": [],
"body": {},
"url": {
"raw": "{{endpoint}}/api/services/1",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"services",
"1"
]
}
},
"response": []
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_key}}",
"type": "string"
}
]
},
"event": [
{
"listen": "prerequest",
"script": {
"id": "4cd2ab82-e60d-45cd-9b74-cb4b5d893f4d",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "c7cb2b6d-289a-4073-b291-202bbec8cb44",
"type": "text/javascript",
"exec": [
""
]
}
}
]
},
{
"name": "Users",
"item": [
{
"name": "View All Users",
2018-11-17 17:14:14 +00:00
"event": [
{
"listen": "test",
"script": {
"id": "9a2977fe-9689-4039-bdcb-eaa34abee958",
"exec": [
"pm.test(\"View All Users\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.length).to.eql(1);",
" var user = jsonData[0];",
" pm.expect(user.id).to.eql(1);",
" pm.expect(user.username).to.eql(\"admin\");",
" pm.expect(user.email).to.eql(\"info@admin.com\");",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
2018-09-12 21:29:47 +00:00
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_key}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {},
"url": {
"raw": "{{endpoint}}/api/users",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"users"
]
}
},
"response": []
},
{
2018-11-17 17:14:14 +00:00
"name": "Create User",
"event": [
{
"listen": "test",
"script": {
"id": "1913466d-83b2-4d5b-ac48-89c9abdd0c8d",
"exec": [
"pm.test(\"Create User\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.status).to.eql(\"success\");",
" pm.expect(jsonData.type).to.eql(\"user\");",
" pm.expect(jsonData.method).to.eql(\"create\");",
"});"
],
"type": "text/javascript"
}
}
],
2018-09-12 21:29:47 +00:00
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_key}}",
"type": "string"
}
]
},
2018-11-17 17:14:14 +00:00
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"username\": \"admissdsn2\",\n \"email\": \"info@emsdssssail.com\",\n \"password\": \"passsword123\",\n \"admin\": true\n}"
},
2018-09-12 21:29:47 +00:00
"url": {
2018-11-17 17:14:14 +00:00
"raw": "{{endpoint}}/api/users",
2018-09-12 21:29:47 +00:00
"host": [
"{{endpoint}}"
],
"path": [
"api",
2018-11-17 17:14:14 +00:00
"users"
2018-09-12 21:29:47 +00:00
]
}
},
"response": []
},
{
2018-11-17 17:14:14 +00:00
"name": "View User",
"event": [
{
"listen": "test",
"script": {
"id": "555b7ba4-bb36-4e86-a541-fa5a5008f951",
"exec": [
"pm.test(\"View User\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.id).to.eql(1);",
" pm.expect(jsonData.username).to.eql(\"admin\");",
" pm.expect(jsonData.email).to.eql(\"info@admin.com\");",
" pm.expect(jsonData.admin).to.eql(true);",
"});"
],
"type": "text/javascript"
}
}
],
2018-09-12 21:29:47 +00:00
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_key}}",
"type": "string"
}
]
},
2018-11-17 17:14:14 +00:00
"method": "GET",
"header": [],
2018-09-12 21:29:47 +00:00
"body": {
"mode": "raw",
2018-11-17 17:14:14 +00:00
"raw": ""
2018-09-12 21:29:47 +00:00
},
"url": {
2018-11-17 17:14:14 +00:00
"raw": "{{endpoint}}/api/users/1",
2018-09-12 21:29:47 +00:00
"host": [
"{{endpoint}}"
],
"path": [
"api",
2018-11-17 17:14:14 +00:00
"users",
"1"
2018-09-12 21:29:47 +00:00
]
}
},
"response": []
},
{
"name": "Update User",
2018-11-17 17:14:14 +00:00
"event": [
{
"listen": "prerequest",
"script": {
"id": "d23b1822-d1de-4545-9a82-3cf4719a7e82",
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "b0d22bbd-a428-4df3-8295-b40542bfa21f",
"exec": [
"pm.test(\"Update User\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.status).to.eql(\"success\");",
"});"
],
"type": "text/javascript"
}
}
],
2018-09-12 21:29:47 +00:00
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_key}}",
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json"
}
],
"body": {
"mode": "raw",
2018-11-17 17:14:14 +00:00
"raw": "{\n \"username\": \"adminupdated\",\n \"email\": \"info@email.com\",\n \"password\": \"password12345\",\n \"admin\": true\n}"
2018-09-12 21:29:47 +00:00
},
"url": {
2018-11-17 17:14:14 +00:00
"raw": "{{endpoint}}/api/users/1",
2018-09-12 21:29:47 +00:00
"host": [
"{{endpoint}}"
],
"path": [
"api",
"users",
2018-11-17 17:14:14 +00:00
"1"
2018-09-12 21:29:47 +00:00
]
}
},
"response": []
},
{
"name": "Delete User",
2018-11-17 17:14:14 +00:00
"event": [
{
"listen": "test",
"script": {
"id": "bd8c3425-a97f-4f8c-b849-71b65dd543ee",
"exec": [
"pm.test(\"Delete User\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.status).to.eql(\"success\");",
" pm.expect(jsonData.type).to.eql(\"user\");",
" pm.expect(jsonData.id).to.eql(1);",
" pm.expect(jsonData.method).to.eql(\"delete\");",
"});"
],
"type": "text/javascript"
}
}
],
2018-09-12 21:29:47 +00:00
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_key}}",
"type": "string"
}
]
},
"method": "DELETE",
"header": [],
"body": {},
"url": {
2018-11-17 17:14:14 +00:00
"raw": "{{endpoint}}/api/users/1",
2018-09-12 21:29:47 +00:00
"host": [
"{{endpoint}}"
],
"path": [
"api",
"users",
2018-11-17 17:14:14 +00:00
"1"
2018-09-12 21:29:47 +00:00
]
}
},
"response": []
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{api_key}}",
"type": "string"
}
]
},
"event": [
{
"listen": "prerequest",
"script": {
"id": "9720db1a-bc4c-4e05-94ea-2782aaafb793",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "c667ae2d-41f3-4dea-ab62-3b544e2bc8f9",
"type": "text/javascript",
"exec": [
""
]
}
}
]
2018-11-06 09:03:21 +00:00
},
{
"name": "Notifiers",
"item": [
2018-11-17 17:14:14 +00:00
{
"name": "All Notifiers",
"event": [
{
"listen": "test",
"script": {
"id": "e9105618-6db8-4a57-ae7f-782989842f4a",
"exec": [
"pm.test(\"View All Notifiers\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.length).to.eql(8);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "e351393306ea245de5f9588cbe8627c74db007c6",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{endpoint}}/api/notifiers",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"notifiers"
]
}
},
"response": []
},
2018-11-06 09:03:21 +00:00
{
"name": "View Notifier",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
2018-11-17 17:14:14 +00:00
"value": "e351393306ea245de5f9588cbe8627c74db007c6",
2018-11-06 09:03:21 +00:00
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{endpoint}}/api/notifier/mobile",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"notifier",
"mobile"
]
}
},
"response": []
},
{
"name": "Update Notifier",
2018-11-17 17:14:14 +00:00
"event": [
{
"listen": "test",
"script": {
"id": "d714d71d-4d6a-4b2e-a6ea-16c34dec3041",
"exec": [
"pm.test(\"Update Notifier\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.output.method).to.eql(\"mobile\");",
" pm.expect(jsonData.output.enabled).to.eql(true);",
" pm.expect(jsonData.output.limits).to.eql(55);",
" pm.expect(jsonData.output.removeable).to.eql(false);",
"});"
],
"type": "text/javascript"
}
}
],
2018-11-06 09:03:21 +00:00
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
2018-11-17 17:14:14 +00:00
"value": "e351393306ea245de5f9588cbe8627c74db007c6",
2018-11-06 09:03:21 +00:00
"type": "string"
}
]
},
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
2018-11-17 17:14:14 +00:00
"raw": "{\n \"method\": \"mobile\",\n \"host\": \"\",\n \"port\": 0,\n \"username\": \"\",\n \"var1\": \"ExponentPushToken[ToBadIWillError123456]\",\n \"var2\": \"\",\n \"api_key\": \"\",\n \"api_secret\": \"\",\n \"enabled\": true,\n \"limits\": 55\n}"
2018-11-06 09:03:21 +00:00
},
"url": {
"raw": "{{endpoint}}/api/notifier/mobile",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"notifier",
"mobile"
]
}
},
"response": []
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
2018-11-17 17:14:14 +00:00
"value": "e351393306ea245de5f9588cbe8627c74db007c6",
2018-11-06 09:03:21 +00:00
"type": "string"
}
]
}
2018-11-17 17:14:14 +00:00
},
{
"name": "Messages",
"item": [
{
"name": "All Messages",
"event": [
{
"listen": "test",
"script": {
"id": "3c484d1b-6e77-4084-b844-3ca77dc50108",
"exec": [
"pm.test(\"View All Messages\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.length).to.eql(2);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{endpoint}}/api/messages",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"messages"
]
}
},
"response": []
},
{
"name": "Create Message",
"event": [
{
"listen": "test",
"script": {
"id": "12caf74a-61d7-4f6e-89b5-fca2f65464c4",
"exec": [
"pm.test(\"Create Message\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.output.title).to.eql(\"API Message\");",
" pm.expect(jsonData.output.service).to.eql(1);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"title\": \"API Message\",\n \"description\": \"This is an example a upcoming message for a service!\",\n \"start_on\": \"2022-11-17T03:28:16.323797-08:00\",\n \"end_on\": \"2022-11-17T05:13:16.323798-08:00\",\n \"service\": 1,\n \"notify_users\": null,\n \"notify_method\": \"\",\n \"notify_before\": 0\n}"
},
"url": {
"raw": "{{endpoint}}/api/messages",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"messages"
]
}
},
"response": []
},
{
"name": "View Message",
"event": [
{
"listen": "test",
"script": {
"id": "abbb5178-9613-418c-b5ee-be2d6b4fdb8f",
"exec": [
"pm.test(\"View Message\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.title).to.eql(\"Routine Downtime\");",
" pm.expect(jsonData.service).to.eql(1);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{endpoint}}/api/messages/1",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"messages",
"1"
]
}
},
"response": []
},
{
"name": "Update Message",
"event": [
{
"listen": "test",
"script": {
"id": "a0403c03-0838-4fd2-9cce-aebaf8a128c3",
"exec": [
"pm.test(\"Update Message\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.status).to.eql(\"success\");",
" pm.expect(jsonData.method).to.eql(\"update\");",
" pm.expect(jsonData.id).to.eql(1);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"title\": \"Routine Downtime\",\n \"description\": \"This is an example a upcoming message for a service!\",\n \"start_on\": \"2055-11-17T03:28:16.323797-08:00\",\n \"end_on\": \"2055-11-17T05:13:16.323798-08:00\",\n \"service\": 2,\n \"notify_users\": true,\n \"notify_method\": \"email\",\n \"notify_before\": 900\n}"
},
"url": {
"raw": "{{endpoint}}/api/messages/1",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"messages",
"1"
]
}
},
"response": []
},
{
"name": "Delete Message",
"event": [
{
"listen": "test",
"script": {
"id": "6cb2527f-41c2-4feb-9573-1e4d59efa116",
"exec": [
"pm.test(\"Delete Message\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.status).to.eql(\"success\");",
" pm.expect(jsonData.method).to.eql(\"delete\");",
" pm.expect(jsonData.type).to.eql(\"message\");",
" pm.expect(jsonData.id).to.eql(1);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "DELETE",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{endpoint}}/api/messages/1",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"messages",
"1"
]
}
},
"response": []
}
]
},
{
"name": "Checkins",
"item": [
2018-11-21 04:29:21 +00:00
{
"name": "Create Checkin",
"event": [
{
"listen": "test",
"script": {
"id": "af07a95b-1bf5-42c7-bd3f-a32f3ab2a264",
"exec": [
"pm.test(\"Create Checkin\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.status).to.eql(\"success\");",
" pm.expect(jsonData.type).to.eql(\"checkin\");",
" pm.expect(jsonData.output.name).to.eql(\"Server Checkin\");",
" pm.expect(jsonData.output.grace).to.eql(60);",
" pm.expect(jsonData.output.interval).to.eql(900);",
" var id = jsonData.output.api_key;",
" pm.globals.set(\"checkin_id\", id);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"service_id\": 1,\n \"name\": \"Server Checkin\",\n \"interval\": 900,\n \"grace\": 60\n}"
},
"url": {
"raw": "{{endpoint}}/api/checkin",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"checkin"
]
}
},
"response": [
{
"name": "Create Checkin",
"originalRequest": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"service_id\": 14,\n \"name\": \"Server Checkin\",\n \"interval\": 900,\n \"grace\": 60\n}"
},
"url": {
"raw": "{{endpoint}}/api/checkin",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"checkin"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Date",
"value": "Tue, 20 Nov 2018 20:37:10 GMT"
},
{
"key": "Content-Length",
"value": "265"
}
],
"cookie": [],
"body": "{\n \"status\": \"success\",\n \"type\": \"checkin\",\n \"method\": \"create\",\n \"id\": 4,\n \"output\": {\n \"id\": 4,\n \"service_id\": 14,\n \"name\": \"Server Checkin\",\n \"interval\": 900,\n \"grace\": 60,\n \"api_key\": \"AJ0GsdG\",\n \"created_at\": \"2018-11-20T20:37:10.437194Z\",\n \"updated_at\": \"2018-11-20T20:37:10.437194Z\",\n \"hits\": null\n }\n}"
}
]
},
{
"name": "Run Checkin",
"event": [
{
"listen": "test",
"script": {
"id": "652a1c5b-5379-43c2-9cd8-ebd8f8dad0f6",
"exec": [
"pm.test(\"Hit the Checkin API Endpoint\", function () {",
" var jsonData = pm.response.json();",
" pm.expect(jsonData.status).to.eql(\"success\");",
2018-11-21 04:29:21 +00:00
" pm.expect(jsonData.type).to.eql(\"checkin_hit\");",
" pm.expect(jsonData.method).to.eql(\"update\");",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
2018-11-21 04:29:21 +00:00
"raw": "{{endpoint}}/checkin/{{checkin_id}}",
"host": [
"{{endpoint}}"
],
"path": [
"checkin",
2018-11-21 04:29:21 +00:00
"{{checkin_id}}"
]
}
},
"response": []
},
{
"name": "View Checkin",
"event": [
{
"listen": "test",
"script": {
"id": "93ff6b86-368b-406f-9d75-07338714ebca",
"exec": [
"pm.test(\"View Checkin\", function () {",
" var jsonData = pm.response.json();",
2018-11-21 04:29:21 +00:00
" var id = pm.globals.get(\"checkin_id\");",
" pm.expect(jsonData.name).to.eql(\"Server Checkin\");",
2018-11-21 04:29:21 +00:00
" pm.expect(jsonData.api_key).to.eql(id);",
" pm.expect(jsonData.grace).to.eql(60);",
2018-11-21 04:29:21 +00:00
" pm.expect(jsonData.interval).to.eql(900);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
2018-11-21 04:29:21 +00:00
"raw": "{{endpoint}}/api/checkin/{{checkin_id}}",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"checkin",
2018-11-21 04:29:21 +00:00
"{{checkin_id}}"
]
}
},
"response": []
},
{
"name": "View All Checkin's",
2018-11-21 04:29:21 +00:00
"event": [
{
"listen": "test",
"script": {
"id": "54bded63-de27-4839-8783-25874c35c3ea",
"exec": [
"pm.test(\"View All Checkins\", function () {",
" var jsonData = pm.response.json();",
" var first = jsonData[0];",
" var id = pm.globals.get(\"checkin_id\");",
" pm.expect(first.name).to.eql(\"Server Checkin\");",
" pm.expect(first.api_key).to.eql(id);",
" pm.expect(first.grace).to.eql(60);",
" pm.expect(first.interval).to.eql(900);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{endpoint}}/api/checkins",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"checkins"
]
}
},
"response": []
},
{
2018-11-21 04:29:21 +00:00
"name": "Delete Checkin",
"event": [
{
2018-11-21 04:29:21 +00:00
"listen": "test",
"script": {
"id": "d3fdc6b9-d8ca-4634-a735-af8db0f31cef",
"exec": [
"pm.test(\"Delete Checkin\", function () {",
" var jsonData = pm.response.json();",
" var id = pm.globals.get(\"checkin_id\");",
" pm.expect(jsonData.status).to.eql(\"success\");",
" pm.expect(jsonData.type).to.eql(\"checkin\");",
" pm.expect(jsonData.method).to.eql(\"delete\");",
" pm.expect(jsonData.output.api_key).to.eql(id);",
"});"
],
2018-11-21 04:29:21 +00:00
"type": "text/javascript"
}
}
2018-11-21 04:29:21 +00:00
],
"request": {
"method": "DELETE",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
2018-11-21 04:29:21 +00:00
"raw": "{{endpoint}}/api/checkin/{{checkin_id}}",
"host": [
"{{endpoint}}"
],
"path": [
"api",
"checkin",
2018-11-21 04:29:21 +00:00
"{{checkin_id}}"
]
}
},
"response": []
}
]
2018-09-12 21:29:47 +00:00
}
]
}