{
  "info": {
    "name": "EntryLuma API v1",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Fictional data only. Disable automatic redirect following. Device token and upload grant values are intentionally blank; use local secret values, never export filled credentials. Photo requests must occur BEFORE the first attendance submission."
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://www.entryluma.com/api/v1/attendance"
    },
    {
      "key": "device_token",
      "value": ""
    },
    {
      "key": "upload_url",
      "value": ""
    },
    {
      "key": "photo_grant",
      "value": ""
    },
    {
      "key": "logo_url",
      "value": ""
    },
    {
      "key": "camera_token",
      "value": ""
    },
    {
      "key": "camera_event_key",
      "value": ""
    },
    {
      "key": "camera_occurred_at",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Entry Device",
      "item": [
        {
          "name": "1. Submit attendance (may send real notifications)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Device-Token",
                "value": "{{device_token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/webhook.php",
            "description": "Replace fictional reader/person/time. Any recorded event can trigger real notifications; 200 is not delivery confirmation.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"event_id\": \"8a3b9a1ce16a3e8ae2390b6e936f40bfca289c5dbe00884d8db7b3b50b32aa11\",\n  \"device_serial\": \"ACME-READER-001\",\n  \"macAddress\": \"02:00:00:00:00:01\",\n  \"person_id\": \"00000001\",\n  \"occurred_at\": \"2026-10-27T10:00:00+08:00\",\n  \"event_type\": \"check_in\",\n  \"method\": \"fingerprint\",\n  \"verified\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "2. Heartbeat",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Device-Token",
                "value": "{{device_token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/heartbeat.php",
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"device_serial\": \"ACME-READER-001\",\n  \"connector_version\": \"acme-1.0.0\",\n  \"reader_state\": \"connected\",\n  \"pending\": 0,\n  \"blocked\": 0,\n  \"review\": 0,\n  \"oldest_pending_age\": 0,\n  \"installation_id\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "3. Photo policy BEFORE attendance",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Device-Token",
                "value": "{{device_token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": "{{base_url}}/photo-policy.php",
            "description": "Inspect policy enabled/mode/grant/upload_url. Manually set upload_url/photo_grant only after operator-approved HTTPS validation.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"event_id\": \"8a3b9a1ce16a3e8ae2390b6e936f40bfca289c5dbe00884d8db7b3b50b32aa11\",\n  \"device_serial\": \"ACME-READER-001\",\n  \"macAddress\": \"02:00:00:00:00:01\",\n  \"person_id\": \"00000001\",\n  \"occurred_at\": \"2026-10-27T10:00:00+08:00\",\n  \"event_type\": \"check_in\",\n  \"method\": \"fingerprint\",\n  \"verified\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "4. Branch logo (same portal origin)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Device-Token",
                "value": "{{device_token}}"
              }
            ],
            "url": "{{logo_url}}",
            "description": "Copy logo_url from the photo policy. Verify its HTTPS origin before sending the device token."
          }
        },
        {
          "name": "5. Optional JPEG upload to policy-provided media host",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{photo_grant}}"
              },
              {
                "key": "Content-Type",
                "value": "image/jpeg"
              }
            ],
            "url": "{{upload_url}}",
            "body": {
              "mode": "file",
              "file": {}
            },
            "description": "Choose event JPEG file. Do NOT add X-Device-Token. Verify approved HTTPS destination, no redirects. Copy returned receipt into event.photo_receipt before attendance POST."
          }
        }
      ]
    },
    {
      "name": "CCTV",
      "item": [
        {
          "name": "Read camera configuration",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/zones.php",
            "header": [
              {
                "key": "X-Camera-Token",
                "value": "{{camera_token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_version\": 1,\n  \"operation\": \"configuration\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Use a registered camera token. This request reads the enabled state and configuration."
          }
        },
        {
          "name": "Submit live CCTV alert (may send real notifications)",
          "request": {
            "method": "POST",
            "url": "{{base_url}}/zones.php",
            "header": [
              {
                "key": "X-Camera-Token",
                "value": "{{camera_token}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_version\": 1,\n  \"operation\": \"live_event\",\n  \"event_key\": \"{{camera_event_key}}\",\n  \"kind\": \"alert\",\n  \"occurred_at\": {{camera_occurred_at}}\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "description": "Use an authorised test camera. Set a unique 32-character lowercase hexadecimal event key and current Unix timestamp before sending."
          }
        }
      ]
    }
  ]
}
