Skip to content

Instantly share code, notes, and snippets.

@mrfyda
Last active November 21, 2024 12:13
Show Gist options
  • Save mrfyda/6052da5279c59c5a2bab4bd381882e20 to your computer and use it in GitHub Desktop.
Save mrfyda/6052da5279c59c5a2bab4bd381882e20 to your computer and use it in GitHub Desktop.
openapi: "3.0.0"
info:
title: "Bounce API"
description: "API documentation for Bounce locker events integration."
version: "1.0.0"
servers:
- url: "https://bounce-api-preview-deploy-test.onrender.com"
description: "Bounce API preview environment"
components:
securitySchemes:
basicAuth:
type: http
scheme: basic
paths:
/wib-machine-hooks/door-status:
post:
summary: "Listen to locker door events"
description: "This endpoint receives events when a locker door opens or closes."
security:
- basicAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: "Unique identifier for the event"
example: "4c7c573c-5cfe-4ef7-ba0d-77d4160c3208"
type:
type: string
description: "Type of event occurring with the locker"
enum:
- "door_opened"
- "door_closed"
example: "door_opened"
data:
type: object
description: "Details of the event including success, reservation, and machine information"
properties:
reservation_id:
type: integer
description: "Unique identifier for the reservation"
example: 42
machine_id:
type: integer
description: "Unique identifier for the locker machine"
example: 42
successful:
type: boolean
description: "Whether the triggering event was completed without errors"
failure_reason:
type: string
description: "Description of the cause that led to the unsuccessful execution"
example: "door_jammed"
is_empty:
type: boolean
description: "Whether the sensor detected nothing"
example: true
required:
- reservation_id
- machine_id
- successful
required:
- id
- type
- data
responses:
'200':
description: "Event logged successfully"
'500':
description: "Server error while processing the event"
security:
- basicAuth: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment