{ "info": { "_postman_id": "f7926ba4-6fae-4e5e-973b-402456b66ceb", "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": "50473838", "_collection_link": "https://mrnutsen-7f68d4fc-3205107.postman.co/workspace/A24_Patriot_API~882aa50c-5471-4e78-aa12-1811e10b3979/collection/50473838-f7926ba4-6fae-4e5e-973b-402456b66ceb?action=share&source=collection_link&creator=50473838" }, "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}}/zones", "host": [ "{{baseUrl}}" ], "path": [ "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}}/users", "host": [ "{{baseUrl}}" ], "path": [ "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}}/user", "host": [ "{{baseUrl}}" ], "path": [ "user" ] }, "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\": {{clientId}},\n \"info\": {\n \"Name\": \"Anders Knutsen\",\n \"Alias\": \"000FD267\",\n \"Location\": \"Lislebyveien 58\",\n \"area_code\": \"1604\",\n \"area\": \"Fredrikstad\",\n \"BusPhone\": \"69310000\",\n \"Email\": \"post@ostsik.no\",\n \"OKPassword\": \"franzjager\",\n \"SpecRequest\": \"Dette skal gjøres ved alarm på denne kunden.\",\n \"NoSigsMon\": \"1\",\n \"SinceDays\": 1,\n \"SinceHrs\": 0,\n \"SinceMins\": 30,\n \"ResetNosigsIgnored\": true,\n \"ResetNosigsDays\": 7,\n \"ResetNosigsHrs\": 0,\n \"ResetNosigsMins\": 0,\n \"InstallDateTime\": \"2023-02-20\",\n \"PanelName\": \"Futurehome\",\n \"PanelSite\": \"Stue\",\n \"KeypadLocation\": \"Inngang\",\n \"SPPage\": \"Ekstra informasjon som kan være relevant.\"\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\": {{clientId}},\n \"info\": {\n \"Name\": \"Anders Knutsen\",\n \"Alias\": \"000FD267\",\n \"Location\": \"Bergbyveien\",\n \"area_code\": \"1730\",\n \"area\": \"Ise\",\n \"BusPhone\": \"69310000\",\n \"Email\": \"post@ostsik.no\",\n \"OKPassword\": \"franzjager\",\n \"SpecRequest\": \"Dette skal gjøres ved alarm på denne kunden.\",\n \"NoSigsMon\": \"Disabled\",\n \"SinceDays\": 1,\n \"SinceHrs\": 0,\n \"SinceMins\": 30,\n \"ResetNosigsIgnored\": true,\n \"ResetNosigsDays\": 14,\n \"ResetNosigsHrs\": 0,\n \"ResetNosigsMins\": 0,\n \"InstallDateTime\": \"2025-12-01\",\n \"PanelName\": \"Futurehome\",\n \"PanelSite\": \"Ved tv\",\n \"KeypadLocation\": \"Inngang\",\n \"SPPage\": \"Ekstra informasjon som kan være relevant.\"\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\"Alias\": \"optional\", \n\"Location\": \"optional\", \n\"area_code\": \"optional\", \n\"area\": \"optional\", \n\"BusPhone\": \"optional\", \n\"Email\": \"optional\", \n\"OKPassword\": \"optional\", \n\"SpecRequest\": \"optional\", \n\"NoSigsMon\": \"optional\", \n\"SinceDays\": 0, \n\"SinceHrs\": 0, \n\"SinceMins\": 0, \n\"ResetNosigsIgnored\": true, \n\"ResetNosigsDays\": 0, \n\"ResetNosigsHrs\": 0, \n\"ResetNosigsMins\": 0, \n\"InstallDateTime\": \"optional\", \n\"PanelName\": \"optional\", \n\"PanelSite\": \"optional\", \n\"KeypadLocation\": \"optional\", \n\"SPPage\": \"optional\"\n\nExample:\n\n{ \n\"client_id\": 1234, \n\"info\": { \n\"Location\": \"New street 99\" \n} \n}" }, "response": [] }, { "name": "Create zone", "request": { "method": "POST", "header": [ { "key": "Authorization", "value": "Bearer {{apiKey}}", "type": "text" } ], "body": { "mode": "raw", "raw": "{\n \"client_id\": {{clientId}},\n \"zone\": {\n \"ZoneNo\": 1,\n \"ZoneText\": \"Tastatur\"\n }\n}\n", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseUrl}}/zones", "host": [ "{{baseUrl}}" ], "path": [ "zones" ] }, "description": "Creates or updates a zone" }, "response": [] }, { "name": "Update zone", "request": { "method": "PATCH", "header": [ { "key": "Authorization", "value": "Bearer {{apiKey}}", "type": "text" } ], "body": { "mode": "raw", "raw": "{\n \"client_id\": {{clientId}},\n \"zone\": {\n \"ZoneNo\": 1,\n \"ZoneText\": \"Tastatur\"\n }\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseUrl}}/zones", "host": [ "{{baseUrl}}" ], "path": [ "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\": \"Anders Knutsen\",\n \"MobileNo\": \"+4740642018\",\n \"MobileNoOrder\": 1,\n \"Email\": \"anders@alarm24.no\",\n \"Type\": \"U\",\n \"UserNo\": 1,\n \"Instructions\": \"\",\n \"CallOrder\": 1\n }\n}\n", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseUrl}}/users", "host": [ "{{baseUrl}}" ], "path": [ "users" ] }, "description": "Create users, all JSON data in example must be present." }, "response": [] }, { "name": "Update user", "request": { "method": "PATCH", "header": [ { "key": "Authorization", "value": "Bearer {{apiKey}}", "type": "text" } ], "body": { "mode": "raw", "raw": "{\n \"client_id\": {{clientId}},\n \"user\": {\n \"User_Name\": \"Anders Knutsen\",\n \"MobileNo\": \"40642018\",\n \"MobileNoOrder\": 1,\n \"Email\": \"anders@alarm24.no\",\n \"Type\": \"U\",\n \"UserNo\": 1,\n \"Instructions\": \"Do this\",\n \"CallOrder\": 1\n }\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseUrl}}/users", "host": [ "{{baseUrl}}" ], "path": [ "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_no\": 1\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "{{baseUrl}}/zones", "host": [ "{{baseUrl}}" ], "path": [ "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}}/users", "host": [ "{{baseUrl}}" ], "path": [ "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\": 1234\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": "" } ] }