{"info":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","description":"<html><head></head><body><p>The complete and updated API documentation for the VAR365 Agent Panel project, including all user roles (Owner, Master Agent, Agent).</p>\n<p><strong>Authentication</strong>:\nThis collection uses two methods:</p>\n<ol>\n<li><strong>HMAC-SHA256 (for External API)</strong>: Used for the 'Agent Role' endpoints. It requires <code>Authorization: Bearer YOUR_AGENT_API_KEY</code>, <code>X-Timestamp</code>, and <code>X-Signature</code> headers. The script in 'Pre-request Script' handles this automatically.</li>\n<li><strong>Session-based (for Internal Frontend)</strong>: Used for 'Owner' and 'Master Agent' roles, which are designed to be called from the web interface after logging in.</li>\n</ol>\n<p><strong>Required Collection Variables:</strong></p>\n<ul>\n<li><code>baseUrl</code>: The base URL of your API (e.g., <a href=\"https://agent.var365.com\">https://agent.var365.com</a>)</li>\n<li><code>apiKey</code>: Your agent's API Key from the profile page.</li>\n<li><code>apiSecret</code>: Your agent's Secret Key from the profile page.</li>\n<li><code>userId</code>: A sample member ID for testing.</li>\n<li><code>agentId</code>: A sample sub-agent ID for testing.</li>\n<li><code>masterId</code>: A sample master agent ID for testing.</li>\n</ul>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"14966765","collectionId":"d8025f7a-9e97-4337-a577-92d94f70015f","publishedId":"2sB34eHMYj","public":true,"customColor":{"top-bar":"EEE","right-sidebar":"303030","highlight":"06b6d4"},"publishDate":"2025-07-08T16:44:27.000Z"},"item":[{"name":"Owner Role (Session Only)","item":[{"name":"Dashboard","item":[{"name":"Get Dashboard Stats","id":"28900a04-c5b9-4737-984a-39af9fa97ccf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/owner/dashboard","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","owner","dashboard"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"28900a04-c5b9-4737-984a-39af9fa97ccf"}],"id":"1b6347b3-3665-4553-b45f-633cc451511f","_postman_id":"1b6347b3-3665-4553-b45f-633cc451511f","description":"","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}}},{"name":"Master Agent Management","item":[{"name":"Get All Master Agents","id":"74531f01-7ce7-4a2e-9534-ad5171a457a8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/owner/masters?search=","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","owner","masters"],"host":["http://localhost:3000"],"query":[{"key":"search","value":""}],"variable":[]}},"response":[],"_postman_id":"74531f01-7ce7-4a2e-9534-ad5171a457a8"},{"name":"Get Master Agent Details","id":"0a0f5974-a68f-4f49-a0e1-af58bf0a7044","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/owner/masters/1","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","owner","masters","1"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"0a0f5974-a68f-4f49-a0e1-af58bf0a7044"},{"name":"Create New Master Agent","id":"b5be3236-c033-4a6e-bb59-5b1484a1f4bd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"agentCode\": \"MASTER01\",\n    \"username\": \"master01\",\n    \"password\": \"MasterPassword123!\",\n    \"fullName\": \"Master Agent One\",\n    \"phone\": \"0800000001\",\n    \"initialBalance\": 100000\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/owner/create-master","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","owner","create-master"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"b5be3236-c033-4a6e-bb59-5b1484a1f4bd"},{"name":"Update Master Agent Balance","id":"da3f4279-df5d-420f-96d3-4bf422d179b0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"agentId\": \"1\",\n    \"amount\": 10000,\n    \"type\": \"deposit\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/owner/masters/update-balance","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","owner","masters","update-balance"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"da3f4279-df5d-420f-96d3-4bf422d179b0"},{"name":"Update Master Agent Status","id":"edc10100-7f1c-45e2-9bb1-b4961dd9bd91","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"agentId\": \"1\",\n    \"status\": \"suspended\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/owner/masters/update-status","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","owner","masters","update-status"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"edc10100-7f1c-45e2-9bb1-b4961dd9bd91"}],"id":"51acb017-ceed-4495-9f3d-cae189f5df97","_postman_id":"51acb017-ceed-4495-9f3d-cae189f5df97","description":"","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}}},{"name":"Product Management","item":[{"name":"Get All Products & Games","id":"f778017a-2338-45ee-8733-79153758ac34","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/owner/products","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","owner","products"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"f778017a-2338-45ee-8733-79153758ac34"},{"name":"Toggle Product Status","id":"fdb8674d-9db4-4c58-9fda-e885d48e02da","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"scope\": \"product\",\n    \"id\": 1002,\n    \"isDisabled\": true\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/owner/products","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","owner","products"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"fdb8674d-9db4-4c58-9fda-e885d48e02da"},{"name":"Toggle Game Status","id":"ca811345-313b-4333-9489-03dfc633db72","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"scope\": \"game\",\n    \"id\": \"PG-SL-001\",\n    \"isDisabled\": true\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/owner/products","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","owner","products"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"ca811345-313b-4333-9489-03dfc633db72"}],"id":"92f6a7c8-0dd8-4a4e-89f5-949ffd4df705","_postman_id":"92f6a7c8-0dd8-4a4e-89f5-949ffd4df705","description":"","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}}},{"name":"Reports","item":[{"name":"Get Win/Loss Report by Master","id":"ee1dd3b2-cbc4-42d9-9009-02153a197e3e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/owner/reports/win-loss-by-master?from=2025-07-01&to=2025-07-08","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","owner","reports","win-loss-by-master"],"host":["http://localhost:3000"],"query":[{"key":"from","value":"2025-07-01"},{"key":"to","value":"2025-07-08"}],"variable":[]}},"response":[],"_postman_id":"ee1dd3b2-cbc4-42d9-9009-02153a197e3e"},{"name":"Get Owner Transactions","id":"23c250bd-e401-4606-98cc-b045fd44ceb6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/owner/transactions?from=2025-07-01&to=2025-07-08","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","owner","transactions"],"host":["http://localhost:3000"],"query":[{"key":"from","value":"2025-07-01"},{"key":"to","value":"2025-07-08"}],"variable":[]}},"response":[],"_postman_id":"23c250bd-e401-4606-98cc-b045fd44ceb6"}],"id":"695331dd-a39e-4ff3-a0a5-e5cd6f9f54ef","_postman_id":"695331dd-a39e-4ff3-a0a5-e5cd6f9f54ef","description":"","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}}}],"id":"a962ba26-23cf-453c-a973-8f841c3d88bc","description":"<p>Endpoints accessible only to the 'owner' role via a valid web session.</p>\n","_postman_id":"a962ba26-23cf-453c-a973-8f841c3d88bc","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}}},{"name":"Master Agent Role (Session Only)","item":[{"name":"Sub-Agent Management","item":[{"name":"Get Sub-Agents List","id":"13b99e4d-1b88-46f3-ac9a-cc0e79e26705","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/master-agent/sub-agents","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","master-agent","sub-agents"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"13b99e4d-1b88-46f3-ac9a-cc0e79e26705"},{"name":"Get Sub-Agent Details","id":"64641ed7-2679-4ba4-b14a-4bcc20b7a172","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/master-agent/sub-agents/2","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","master-agent","sub-agents","2"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"64641ed7-2679-4ba4-b14a-4bcc20b7a172"},{"name":"Create New Sub-Agent","id":"aad7a1bc-4f33-4b2f-8b7f-c6d86628b262","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"agentCode\": \"SUB02\",\n    \"usernameSuffix\": \"sub02\",\n    \"password\": \"aPassword123\",\n    \"fullName\": \"Another Sub Agent\",\n    \"phone\": \"\",\n    \"initialBalance\": 0\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/master-agent/create-agent","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","master-agent","create-agent"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"aad7a1bc-4f33-4b2f-8b7f-c6d86628b262"},{"name":"Update Sub-Agent Balance","id":"3b1b7643-0a02-4142-9c8a-7c0580b981cc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"agentId\": \"2\",\n    \"amount\": 1000,\n    \"type\": \"deposit\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/master-agent/update-agent-balance","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","master-agent","update-agent-balance"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"3b1b7643-0a02-4142-9c8a-7c0580b981cc"},{"name":"Update Sub-Agent Status","id":"9e59b269-46a5-4ff3-8d4e-7797ac13fd25","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"agentId\": \"2\",\n    \"status\": \"suspended\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/master-agent/update-agent-status","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","master-agent","update-agent-status"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"9e59b269-46a5-4ff3-8d4e-7797ac13fd25"},{"name":"Update Sub-Agent Info","id":"c3141cef-bad3-4b9c-b5f2-3531ee60fff9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"fullName\": \"Sub Agent New Name\",\n    \"phone\": \"0811112222\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/master-agent/sub-agents/2/update","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","master-agent","sub-agents","2","update"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"c3141cef-bad3-4b9c-b5f2-3531ee60fff9"},{"name":"Reset Sub-Agent Password","id":"5448268f-de15-4f6f-99ed-5f68d989fb97","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"newPassword\": \"newPassword123\",\n    \"confirmationPassword\": \"myMasterPassword\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/master-agent/sub-agents/2/reset-password","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","master-agent","sub-agents","2","reset-password"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"5448268f-de15-4f6f-99ed-5f68d989fb97"}],"id":"c85cfbae-7863-481a-a2c1-6071af0c8fd7","_postman_id":"c85cfbae-7863-481a-a2c1-6071af0c8fd7","description":"","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}}},{"name":"Reports","item":[{"name":"Get Win/Loss by Sub-Agent","id":"26a17c72-2601-4b85-85e4-17a6ba361e29","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/master-agent/reports/win-loss-by-sub-agent?from=2025-07-01&to=2025-07-08","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","master-agent","reports","win-loss-by-sub-agent"],"host":["http://localhost:3000"],"query":[{"key":"from","value":"2025-07-01"},{"key":"to","value":"2025-07-08"}],"variable":[]}},"response":[],"_postman_id":"26a17c72-2601-4b85-85e4-17a6ba361e29"},{"name":"Get Transactions with Sub-Agents","id":"a14da997-351f-4e45-b129-5bec8ea907a3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/master-agent/transactions?from=2025-07-01&to=2025-07-08","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","master-agent","transactions"],"host":["http://localhost:3000"],"query":[{"key":"from","value":"2025-07-01"},{"key":"to","value":"2025-07-08"}],"variable":[]}},"response":[],"_postman_id":"a14da997-351f-4e45-b129-5bec8ea907a3"},{"name":"Get Member Transactions in Downline","id":"0db369bd-c1c6-44f4-b25e-18d5781b2fb4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/master-agent/sub-agent-user-transactions?from=2025-07-01&to=2025-07-08&agentId=2","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","master-agent","sub-agent-user-transactions"],"host":["http://localhost:3000"],"query":[{"key":"from","value":"2025-07-01"},{"key":"to","value":"2025-07-08"},{"key":"agentId","value":"2"}],"variable":[]}},"response":[],"_postman_id":"0db369bd-c1c6-44f4-b25e-18d5781b2fb4"}],"id":"c1a88c41-8137-4f96-ac50-d91309d09421","_postman_id":"c1a88c41-8137-4f96-ac50-d91309d09421","description":"","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}}}],"id":"d9b18bfc-8c3c-4b59-b293-705ce9f58764","description":"<p>Endpoints accessible only to the 'master_agent' role via a valid web session. These are not available for external API access.</p>\n","_postman_id":"d9b18bfc-8c3c-4b59-b293-705ce9f58764","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}}},{"name":"Agent Role (External API)","item":[{"name":"Agent","item":[{"name":"Get My Dashboard Stats","id":"d1790c46-c46a-481e-bf6f-928446a3bc27","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/agent/me","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","me"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"d1790c46-c46a-481e-bf6f-928446a3bc27"},{"name":"Get My Profile","id":"535cc2f9-0fa2-4274-8739-2a1869f16dc4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/agent/profile","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","profile"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"535cc2f9-0fa2-4274-8739-2a1869f16dc4"},{"name":"Update My Profile","id":"0f6ebb0e-7fe3-42dc-9bdb-1bb05f8dbad9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"full_name\": \"Mr crazy eiei\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/agent/profile","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","profile"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"0f6ebb0e-7fe3-42dc-9bdb-1bb05f8dbad9"},{"name":"Generate New Credentials","id":"7d9edf1d-475f-46a8-bf3f-76085b3efe5f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"http://localhost:3000/api/agent/profile/generate-api-key","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","profile","generate-api-key"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"7d9edf1d-475f-46a8-bf3f-76085b3efe5f"}],"id":"d1ab73dc-5f7f-419f-afc3-8d1077c67c4f","_postman_id":"d1ab73dc-5f7f-419f-afc3-8d1077c67c4f","description":"","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}}},{"name":"Member Management","item":[{"name":"Get Members List","id":"74bc7715-227e-4904-898e-2d5b9bc9c2bf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/agent/users?page=1&limit=10&search=","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","users"],"host":["http://localhost:3000"],"query":[{"key":"page","value":"1"},{"key":"limit","value":"10"},{"key":"search","value":""}],"variable":[]}},"response":[],"_postman_id":"74bc7715-227e-4904-898e-2d5b9bc9c2bf"},{"name":"Get Next Member Username","id":"c398c96d-d0c2-4b66-a9a7-bf1a59b9bdc8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/agent/users/next-username","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","users","next-username"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"c398c96d-d0c2-4b66-a9a7-bf1a59b9bdc8"},{"name":"Create New Member","id":"a305228d-7f05-4a83-a802-14e1e678dd3f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"usernameSuffix\": \"test01\",\n    \"password\": \"strongPassword123\",\n    \"fullName\": \"API Test User\",\n    \"phone\": \"0812345678\",\n    \"initialBalance\": 100\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/agent/users/create","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","users","create"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"a305228d-7f05-4a83-a802-14e1e678dd3f"},{"name":"Get Member Details","id":"eb7c71a9-72be-41c8-acd9-ef84f75b976f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/agent/users/1","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","users","1"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"eb7c71a9-72be-41c8-acd9-ef84f75b976f"},{"name":"Update Member Info","id":"dacb420c-3b7f-44ad-b597-e9ae4919eca7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"fullName\": \"Updated Member Name\",\n    \"phone\": \"0987654321\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/agent/users/1/update","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","users","1","update"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"dacb420c-3b7f-44ad-b597-e9ae4919eca7"},{"name":"Update Member Status","id":"25eb5494-cdb7-490c-a1c1-e525fa4982d6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"userId\": \"1\",\n    \"status\": \"suspended\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/agent/users/update-status","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","users","update-status"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"25eb5494-cdb7-490c-a1c1-e525fa4982d6"},{"name":"Update Member Balance","id":"f6c030e6-950c-4216-9bd4-633522ad19ac","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"userId\": 1,\n    \"amount\": 500,\n    \"type\": \"deposit\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/agent/users/update-balance","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","users","update-balance"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"f6c030e6-950c-4216-9bd4-633522ad19ac"},{"name":"Reset Member Password","id":"082bee68-ac66-4522-a0af-7c9df11b7902","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"newPassword\": \"newPassword123\",\n    \"confirmationPassword\": \"myAgentPassword\"\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/agent/users/1/reset-password","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","users","1","reset-password"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"082bee68-ac66-4522-a0af-7c9df11b7902"}],"id":"c46dfc3f-1ba2-4756-b445-64e11000f087","_postman_id":"c46dfc3f-1ba2-4756-b445-64e11000f087","description":"","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}}},{"name":"Products","item":[{"name":"Get All Products","id":"463e939e-6938-4d9d-9445-032465bd81eb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/agent/products","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","products"],"host":["http://localhost:3000"],"query":[],"variable":[]}},"response":[],"_postman_id":"463e939e-6938-4d9d-9445-032465bd81eb"}],"id":"27247bde-e867-457a-be60-7957156290b3","_postman_id":"27247bde-e867-457a-be60-7957156290b3","description":"","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}}},{"name":"Reports","item":[{"name":"Get Win/Loss Report","id":"c5679f89-60b1-4dd3-aa90-d56b96ecb236","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/agent/reports/win-loss?from=2025-07-01&to=2025-07-06&search=","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","reports","win-loss"],"host":["http://localhost:3000"],"query":[{"key":"from","value":"2025-07-01"},{"key":"to","value":"2025-07-06"},{"key":"search","value":""}],"variable":[]}},"response":[],"_postman_id":"c5679f89-60b1-4dd3-aa90-d56b96ecb236"},{"name":"Get Transactions Report","id":"aa7dbf18-32bf-466e-b227-b2872437c7c5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/agent/reports/transactions?from=2025-07-01&to=2025-07-06&search=","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","reports","transactions"],"host":["http://localhost:3000"],"query":[{"key":"from","value":"2025-07-01"},{"key":"to","value":"2025-07-06"},{"key":"search","value":""}],"variable":[]}},"response":[],"_postman_id":"aa7dbf18-32bf-466e-b227-b2872437c7c5"},{"name":"Get Combined Statement","id":"a3b4ea16-940a-429e-bc30-6729d5125342","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/agent/reports/statement?userId=1&from=2025-07-01&to=2025-07-08","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","reports","statement"],"host":["http://localhost:3000"],"query":[{"key":"userId","value":"1"},{"key":"from","value":"2025-07-01"},{"key":"to","value":"2025-07-08"}],"variable":[]}},"response":[],"_postman_id":"a3b4ea16-940a-429e-bc30-6729d5125342"},{"name":"Get Turnover Details Report","id":"88f4c381-04f1-41cf-bddb-5fcf08a8bb39","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/agent/reports/turnover-details?userId=1&from=2025-07-01&to=2025-07-06","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","reports","turnover-details"],"host":["http://localhost:3000"],"query":[{"key":"userId","value":"1"},{"key":"from","value":"2025-07-01"},{"key":"to","value":"2025-07-06"}],"variable":[]}},"response":[],"_postman_id":"88f4c381-04f1-41cf-bddb-5fcf08a8bb39"},{"name":"Get Outstanding Bets Summary","id":"548b1b53-e4dc-4cbb-b527-4379d3cc0b14","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/agent/reports/outstanding?from=2025-07-01&to=2025-07-06","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","reports","outstanding"],"host":["http://localhost:3000"],"query":[{"key":"from","value":"2025-07-01"},{"key":"to","value":"2025-07-06"}],"variable":[]}},"response":[],"_postman_id":"548b1b53-e4dc-4cbb-b527-4379d3cc0b14"},{"name":"Get Outstanding Wager Details","id":"7172de08-5412-4dc9-a96b-7c2de6763226","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:3000/api/agent/reports/outstanding-wagers/1?from=2025-07-01&to=2025-07-08","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}},"urlObject":{"path":["api","agent","reports","outstanding-wagers","1"],"host":["http://localhost:3000"],"query":[{"key":"from","value":"2025-07-01"},{"key":"to","value":"2025-07-08"}],"variable":[]}},"response":[],"_postman_id":"7172de08-5412-4dc9-a96b-7c2de6763226"}],"id":"986ebd47-0372-4b2f-9dd0-11e50f2ddcf1","_postman_id":"986ebd47-0372-4b2f-9dd0-11e50f2ddcf1","description":"","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}}}],"id":"a673921b-f868-4d4c-b6bf-1cd07a3e0362","description":"<p>Endpoints available for external API access with the 'agent' role using HMAC authentication.</p>\n","_postman_id":"a673921b-f868-4d4c-b6bf-1cd07a3e0362","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]},"isInherited":true,"source":{"_postman_id":"d8025f7a-9e97-4337-a577-92d94f70015f","id":"d8025f7a-9e97-4337-a577-92d94f70015f","name":"VAR365 Agent API (Complete & Updated)","type":"collection"}}}],"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"YOUR_AGENT_API_KEY"}]}},"event":[{"listen":"prerequest","script":{"type":"text/javascript","exec":["// Postman Pre-request Script for HMAC Signature Generation","// This script automatically generates the X-Timestamp and X-Signature headers","// required for HMAC authentication before each request is sent.","","// 1. Get current timestamp as a string","const timestamp = Date.now().toString();","pm.collectionVariables.set(\"timestamp\", timestamp);","","// 2. Get the request body. It's important that this matches exactly","//    what the server will receive. For GET/DELETE requests, this will be empty.","let body = '';","if (pm.request.body && pm.request.body.raw) {","    body = pm.request.body.raw;","}","","// 3. Create the string to be signed by concatenating the timestamp and the body","const dataToSign = timestamp + body;","","// 4. Retrieve the API Secret from the collection's variables","const apiSecret = pm.variables.get(\"apiSecret\");","","if (!apiSecret) {","    console.error(\"API Secret is not set in the collection variables. Please add 'apiSecret'.\");","    throw new Error(\"API Secret is missing from collection variables.\");","}","","// 5. Generate the HMAC-SHA256 signature using Postman's built-in CryptoJS library","const signature = CryptoJS.HmacSHA256(dataToSign, apiSecret).toString(CryptoJS.enc.Hex);","    ","// 6. Set the generated signature as a collection variable so it can be used in the header","pm.collectionVariables.set(\"signature\", signature);","","// This part is now handled automatically by Postman's auth helper if you set the type to Bearer Token.","// However, for HMAC, we add them manually.","pm.request.headers.add({ key: 'X-Timestamp', value: timestamp });","pm.request.headers.add({ key: 'X-Signature', value: signature });","","// Optional: Log the generated values to the Postman console for debugging","console.log(\"Generated Timestamp:\", timestamp);","console.log(\"Data to Sign:\", dataToSign);","console.log(\"Generated Signature:\", signature);"],"id":"913c9ce8-f438-4fba-b117-4051864293db"}},{"listen":"test","script":{"type":"text/javascript","exec":[""],"id":"882b3465-68ad-47fc-89f7-9a2879d1b50a"}}],"variable":[{"key":"baseUrl","value":"http://localhost:3000","type":"string"},{"key":"apiKey","value":"YOUR_AGENT_API_KEY","type":"string"},{"key":"apiSecret","value":"YOUR_AGENT_API_SECRET","type":"string"},{"key":"timestamp","value":"","type":"string"},{"key":"signature","value":"","type":"string"},{"key":"userId","value":"1","type":"string"},{"key":"agentId","value":"2","type":"string"},{"key":"masterId","value":"1","type":"string"}]}