A24_Patriot_API/Patriot API.postman_collect...

499 lines
12 KiB
JSON

{
"info": {
"_postman_id": "d549670f-756d-49fa-925b-dd82e8e9cc0c",
"name": "Patriot API",
"description": "Common Status Codes\n\n- \\- 200 OK: Request successful (e.g.,UPSERT update, reads)\n \n- \\- 201 Created: Resource created (e.g., UPSERT create, add user, upsert zone)\n \n- \\- 204 No Content: Deleted successfully\n \n- \\- 401 Unauthorized: Missing/invalid/disabled/expired API key\n \n- \\- 404 Not Found: Client or resource not found\n \n- \\- 409 Conflict: Duplicate user number\n \n- \\- 422 Unprocessable Entity: Validation error (e.g., zone_id out of range)",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "18764749"
},
"item": [
{
"name": "GET",
"item": [
{
"name": "Client info",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "X-Client-Id",
"value": "{{clientId}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/clients",
"host": [
"{{baseUrl}}"
],
"path": [
"clients"
]
},
"description": "Gets all client information for selected client.\n\nClient ID must be set in the \"X-Client-Id\" header."
},
"response": []
},
{
"name": "Zones",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "X-Client-Id",
"value": "{{clientId}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/clients/zones",
"host": [
"{{baseUrl}}"
],
"path": [
"clients",
"zones"
]
},
"description": "Gets zone info for selected zone\n\nClient ID must be set in the \"X-Client-Id\" header."
},
"response": []
},
{
"name": "All Users",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "X-Client-Id",
"value": "{{clientId}}",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/clients/users",
"host": [
"{{baseUrl}}"
],
"path": [
"clients",
"users"
]
},
"description": "Gets all users for client\n\nClient ID must be set in the \"X-Client-Id\" header."
},
"response": []
},
{
"name": "Specific user",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
},
{
"key": "X-Client-Id",
"value": "{{clientId}}",
"type": "text"
},
{
"key": "X-User-No",
"value": "1",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/clients/users",
"host": [
"{{baseUrl}}"
],
"path": [
"clients",
"users"
]
},
"description": "Get a specific user\n\nClient ID must be set in the \"X-Client-Id\" header.\n\nUser ID must be set in the \"X-User-Id\" header."
},
"response": []
}
],
"description": "Get stored information from API"
},
{
"name": "POST/PUT/PATCH",
"item": [
{
"name": "Create client",
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"client_id\": 1234,\n \"info\": {\n \"Name\": \"Customer Name\",\n \"Location\": \"Address line 1\",\n \"area_code\": \"area/postal code\",\n \"area\": \"City\",\n \"AltLookup\": true,\n \"AltAlarmNo\": \"SIA1000101\",\n \"ConvertType\": \"None\",\n \"NoSigsMon\": \"None\",\n \"SinceDays\": 0,\n \"SinceHrs\": 0,\n \"SinceMins\": 0,\n \"ResetNosigsIgnored\": true,\n \"ResetNosigsDays\": 0,\n \"ResetNosigsHrs\": 0,\n \"ResetNosigsMins\": 0,\n \"PanelName\": \"Panel Type\",\n \"PanelSite\": \"Panel location\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/clients",
"host": [
"{{baseUrl}}"
],
"path": [
"clients"
]
},
"description": "Expected response: 201 Created on first call, 200 OK on updates."
},
"response": []
},
{
"name": "Update client",
"request": {
"method": "PATCH",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"client_id\": 1234,\n \"info\": {\n \"Location\": \"New street 99\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/clients",
"host": [
"{{baseUrl}}"
],
"path": [
"clients"
]
},
"description": "Updates specific fields on an existing client.\n\nPossible keys:\n\n\"Name\": \"Customer Name\", \n\"Location\": \"New street 99\", \n\"area_code\": \"area/postal code\", \n\"area\": \"City\", \n\"AltLookup\": true, \n\"AltAlarmNo\": \"SIA1000101\", \n\"ConvertType\": \"None\", \n\"NoSigsMon\": \"None\", \n\"SinceDays\": 0, \n\"SinceHrs\": 0, \n\"SinceMins\": 0, \n\"ResetNosigsIgnored\": true, \n\"ResetNosigsDays\": 0, \n\"ResetNosigsHrs\": 0, \n\"ResetNosigsMins\": 0, \n\"PanelName\": \"Panel Type\", \n\"PanelSite\": \"Panel location\"\n\nExample:\n\n{ \n\"client_id\": 1234, \n\"info\": { \n\"Location\": \"New street 99\" \n} \n}"
},
"response": [
{
"name": "Update client",
"originalRequest": {
"method": "PATCH",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"client_id\": 1234,\n \"info\": {\n \"Location\": \"New street 99\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/clients",
"host": [
"{{baseUrl}}"
],
"path": [
"clients"
]
}
},
"_postman_previewlanguage": "",
"header": [],
"cookie": [],
"body": ""
}
]
},
{
"name": "Create/Update zone",
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"client_id\": 1234,\n \"zone_id\": 1,\n \"Zone_area\": \"Entrance\",\n \"ModuleNo\": 0\n}\n",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/clients/zones",
"host": [
"{{baseUrl}}"
],
"path": [
"clients",
"zones"
]
},
"description": "Creates or updates a zone"
},
"response": []
},
{
"name": "Create users",
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"client_id\": {{clientId}},\n \"user\": {\n \"User_Name\": \"User Number 1\",\n \"MobileNo\": \"+4712345678\",\n \"MobileNoOrder\": 1,\n \"Email\": \"user@email.com\",\n \"Type\": \"U\",\n \"UserNo\": 1,\n \"Instructions\": \"Optional\",\n \"CallOrder\": 0\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/clients/users",
"host": [
"{{baseUrl}}"
],
"path": [
"clients",
"users"
]
},
"description": "Create users, all JSON data in example must be present."
},
"response": []
},
{
"name": "Update user",
"request": {
"method": "PUT",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"client_id\": {{clientId}},\n \"user\": {\n \"User_Name\": \"Changed Name\",\n \"MobileNo\": \"+4798765432\",\n \"MobileNoOrder\": 1,\n \"Email\": \"new@email.com\",\n \"Type\": \"U\",\n \"UserNo\": 1,\n \"Instructions\": \"New instructions\",\n \"CallOrder\": 0\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/clients/users",
"host": [
"{{baseUrl}}"
],
"path": [
"clients",
"users"
]
},
"description": "Update users, all JSON data in example must be present."
},
"response": []
}
]
},
{
"name": "DELETE",
"item": [
{
"name": "Zones",
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"client_id\": {{clientId}},\n \"zone_id\": 1\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/clients/zones",
"host": [
"{{baseUrl}}"
],
"path": [
"clients",
"zones"
]
},
"description": "Select zone number to delete, use GET /clients/zones to list zone numbers and names."
},
"response": []
},
{
"name": "User",
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"client_id\": {{clientId}},\n \"user_no\": 1\n}\n",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/clients/users",
"host": [
"{{baseUrl}}"
],
"path": [
"clients",
"users"
]
},
"description": "Deletes the selected user, use GET /clients/users to get correct user id."
},
"response": []
},
{
"name": "Client",
"request": {
"method": "DELETE",
"header": [
{
"key": "Authorization",
"value": "Bearer {{apiKey}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"client_id\": {{clientId}}\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseUrl}}/clients",
"host": [
"{{baseUrl}}"
],
"path": [
"clients"
]
},
"description": "Deletes entire client!\n\nWARNING! Data will be permanently deleted!"
},
"response": []
}
],
"description": "Deletes the records requested. WARNING! Data will be permanently deleted!"
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"packages": {},
"requests": {},
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"packages": {},
"requests": {},
"exec": [
""
]
}
}
],
"variable": [
{
"key": "baseUrl",
"value": ""
},
{
"key": "clientId",
"value": ""
},
{
"key": "apiKeyf",
"value": ""
},
{
"key": "apiKey",
"value": ""
}
]
}