{"openapi":"3.0.3","info":{"title":"AI Call Center Dashboard Integration Contract","version":"1.0.1","contact":{"name":"Lam","email":"lam@emct.ai"},"description":"Server-to-server API contract that the **AI Call Center Dashboard** uses\nto resolve parking-lot / vehicle data and to issue automated gate\ncommands as part of the AI call flow.\n\nAll endpoints in this document are called **Dashboard -> BDPark Core**\nover HTTP and are secured with the `x-api-key` header (a pre-shared\nsecret, rotatable through configuration on both sides).\n\n---\n\n## Endpoint routing convention\n\nAll endpoints in this contract are namespaced under `/api/AIC/...` so\nthat BDPark Core can route them to a dedicated controller dealing\nexclusively with AI Call Center Dashboard traffic, separate from the\nexisting `/api/Gate`, `/api/Auth`, `/api/Command` controllers used by\nthe rest of the BDPark suite.\n\n---\n\n### SSO & Auth Configuration (Pending Mr. Taeo Kim's Decision)\n\nAs I don't know the exact internal code structure or the existing SSO configuration, I have left the following fields as [TBD] (To Be Determined). Please feel free to modify this document as needed or let me know the correct parameters so I can update the Dashboard side.\n\n* Client ID: `[TBD]`\n* Authority URL: `[TBD]`\n* Supported Redirect URIs: `[TBD]`\n* Required Roles/Claims: `[Please confirm if 'SystemAdmin' or another claim is needed for access]`\n"},"servers":[{"url":"http://emct.ddns.net:10007","description":"BDPark Core - on-prem dev instance"},{"url":"https://core.bdpark.example.com","description":"BDPark Core - production (placeholder; Auth team to confirm)"}],"security":[{"ApiKeyAuth":[]}],"tags":[{"name":"ParkingLot","description":"Parking-lot lookup endpoints."},{"name":"Vehicle","description":"License-plate -> location resolution."},{"name":"Gate","description":"Automated, AI-driven gate command endpoint (server-to-server only)."}],"paths":{"/api/AIC/getParkingLotNameList":{"get":{"tags":["ParkingLot"],"operationId":"getParkingLotNameList","summary":"List all parking lots currently registered in BDPark Core.","description":"Returns the full set of parking lots known to BDPark Core\n\nNo parameters - the endpoint always returns the current,\ncomplete list. The Dashboard is expected to refresh this list\nperiodically rather than per call.\n","responses":{"200":{"description":"Array of parking lots currently available in the system.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ParkingLotSummary"},"example":[{"parkingLotId":12,"parkingLotName":"강남제1주차장"},{"parkingLotId":13,"parkingLotName":"강남제2주차장"}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"500":{"$ref":"#/components/responses/InternalError"}}}},"/api/AIC/vehicle/location":{"get":{"tags":["Vehicle"],"operationId":"findVehicleByLicensePlate","summary":"Locate a vehicle by license plate.","description":"Returns the parking-lot and gate the vehicle is currently\nassociated with. Called immediately after the customer states\ntheir license plate so the Dashboard can pre-fill ticket fields\nand decide which gate the AI flow should auto-open.\n","parameters":[{"in":"query","name":"licensePlate","required":true,"description":"Korean license plate\n","schema":{"type":"string","example":"12가 3456"}}],"responses":{"200":{"description":"Vehicle resolved successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VehicleLocationResult"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"License plate not found in BDPark Core.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/InternalError"}}}},"/api/AIC/gate/SetCommand":{"post":{"tags":["Gate"],"operationId":"setGateCommand","summary":"Issue an automated gate command (AI-driven, server-to-server only).","description":"**Authentication is handled entirely by the `x-api-key` header.**\nNo human identity, no OIDC cookie, no role claim, and no\n`SystemAdmin` check are involved on this path.\n\nThe command is fire-and-forget from the Dashboard's perspective -\nBDPark Core is expected to acknowledge synchronously whether the\ncommand was accepted and forwarded to the gate hardware.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GateCommandRequest"}}}},"responses":{"200":{"description":"Command accepted and forwarded to the gate.","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"True when the gate hardware acknowledged the command.","example":true},"message":{"type":"string","nullable":true,"description":"Optional human-readable detail.","example":"Gate opened"}}}}}},"400":{"description":"Malformed request body or unsupported command.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Parking lot or gate not found for the supplied ids.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/InternalError"}}}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Pre-shared API key for server-to-server traffic between the\nAI Call Center Dashboard and BDPark Core. Distributed out-of-band\nand rotatable through configuration on both sides.\n"}},"responses":{"Unauthorized":{"description":"Missing or invalid `x-api-key` header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"unauthorized","message":"x-api-key is missing or invalid."}}}},"InternalError":{"description":"Unexpected server error inside BDPark Core.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"internal_error","message":"An unexpected error occurred."}}}}},"schemas":{"ParkingLotSummary":{"type":"object","description":"Minimal parking-lot descriptor returned by `getParkingLotNameList`.","required":["parkingLotId","parkingLotName"],"properties":{"parkingLotId":{"type":"integer","format":"int32","description":"Numeric identifier of the parking lot.","example":12},"parkingLotName":{"type":"string","description":"Canonical parking-lot name as registered in BDPark Core.","example":"강남제1주차장"}}},"VehicleLocationResult":{"type":"object","description":"Result of a license-plate -> location lookup.","required":["parkingLotId","parkingLotName","gateId","gateName"],"properties":{"parkingLotId":{"type":"integer","format":"int32","description":"Numeric identifier of the parking lot.","example":12},"parkingLotName":{"type":"string","description":"Canonical parking-lot name (same value space as `getParkingLotNameList`).","example":"강남제1주차장"},"gateId":{"type":"integer","format":"int32","description":"Numeric identifier of the gate the vehicle is associated with.","example":7},"gateName":{"type":"string","description":"Display name of the gate (e.g. `\"입구1\"` / `\"Entrance 1\"`).","example":"입구1"}}},"GateCommandRequest":{"type":"object","description":"Command payload accepted by `POST /api/AIC/gate/SetCommand`.\n\nMirrors the BDPark Core `BDPark.Common.Packet.GateCommandRequest`\ncontract, with `type` carrying a value of the `CommandTypes`\nenum (`BDPark.Common.Enum.CommandTypes`).\n","required":["parkingLotId","gateId","type"],"properties":{"parkingLotId":{"type":"integer","format":"int32","description":"Numeric identifier of the parking lot the gate belongs to.","example":1},"gateId":{"type":"integer","format":"int32","description":"Numeric identifier of the gate to act on.","example":5},"type":{"type":"string","description":"Command verb. Values mirror the `CommandTypes` enum in\n`BDPark.Common.Enum.CommandTypes`:\n  - `Open`           - open once, auto-close (한번 열고 자동 닫힘)\n  - `OpenFix`        - lock gate in the open position (열림 고정)\n  - `CloseFix`       - lock gate in the closed position (닫힘 고정)\n  - `ReleaseFix`     - release any *Fix* lock (고정 해제)\n  - `Reset`          - reset the gate after an error (오류 초기화)\n  - `Close`          - close the gate\n  - `ClearDetection` - clear the loop / vehicle-detection state\n  - `Status`         - report current gate status (no state change)\n","enum":["Open","OpenFix","CloseFix","ReleaseFix","Reset","Close","ClearDetection","Status"],"example":"Open"}}},"Error":{"type":"object","description":"Standard error envelope returned by BDPark Core.","required":["code","message"],"properties":{"code":{"type":"string","description":"Machine-readable error code (snake_case).","example":"vehicle_not_found"},"message":{"type":"string","description":"Human-readable error message (English; no PII).","example":"License plate '12가 3456' was not found."},"details":{"type":"object","additionalProperties":true,"nullable":true,"description":"Optional structured context."}}}}}}