{ "openapi": "3.0.0", "info": { "contact": { "email": "eloi@abitari.com" }, "description": "Abitari Housekeeping Integration API for Guest Facing", "title": "Abitari Housekeeping Integration API for Guest Facing", "version": "0.1.0", "x-jentic-source-url": "https://api.swaggerhub.com/apis/EloiHernandezTarrago/abitari-housekeeping_integration_api_for_guest_facing/0.1.0/swagger.json" }, "servers": [ { "url": "https://api.abitari.com/" } ], "paths": { "/api/guestpetition": { "post": { "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuestPetitionResponse" } } }, "description": "Created" }, "401": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Unauthorized" }, "403": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Forbidden" }, "409": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Conflict" }, "default": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Unexpected error" } }, "tags": [ "Messaging" ], "description": "Create a petition to the hotel made by a guest", "operationId": "post-api-guestpetition", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GuestPetitionRequest" } } }, "description": "Guest petition object", "required": true }, "summary": "Create a petition to the hotel made by a guest" } }, "/autoinstall/connect": { "post": { "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConnectionResponse" } } }, "description": "Created" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Bad request" }, "401": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Unauthorized" }, "403": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Forbidden" }, "409": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Conflict" }, "default": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Unexpected error" } }, "tags": [ "Setup" ], "description": "Setting up a Connection allows you to establish a bridge (not working until started) between your external application and the hotelier's account that corresponds to your access token. If this account belongs to Abitari (only possibility right now), you should use AbitariService to connect to it. The creation of the Connection will return a list of the available properties to be integrated.\n", "operationId": "post-autoinstall-connect", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ConnectionRequest" } } }, "description": "Connection request", "required": true }, "summary": "Create a new connection to the API" } }, "/autoinstall/connect/start": { "post": { "responses": { "204": { "description": "Started" }, "400": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Bad request" }, "401": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Unauthorized" }, "403": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Forbidden" }, "default": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Unexpected error" } }, "tags": [ "Setup" ], "description": "Starting a Connection activates the connection bridge between the system and your application, for the property_ids provided.\n", "operationId": "post-autoinstall-connect-start", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StartConnectionRequest" } } }, "description": "Start connection request", "required": true }, "summary": "Starts a pending connection" } }, "/webhooks": { "post": { "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookResponse" } } }, "description": "Created" }, "401": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Unauthorized" }, "403": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Forbidden" }, "409": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Conflict" }, "default": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Unexpected error" } }, "tags": [ "Setup" ], "description": "Subscribe to a new webhook with details sent in body. When a webhook is created, it provides a way for your application to be notified when some event occurs. For example, if you are subscribed to room, then each time a room is updated in Abitari, a POST request will be sent to your specified url with a RoomRepair body. Available event notifications are\n - room (RoomResponse) \n - guestpetition (GuestPetitionResponse)\nAn event of type healthcheck will be sent periodically to the endpoint, with empty payload, to check you are alive.\n", "operationId": "post-webhooks", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookRequest" } } }, "description": "Webhook request", "required": true }, "summary": "Subscribe to a new webhook" } }, "/webhooks/{topic}": { "delete": { "parameters": [ { "description": "topic to unsubscribe from", "in": "path", "name": "topic", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "OK" }, "401": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Unauthorized" }, "403": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Forbidden" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Not found" }, "default": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Unexpected error" } }, "tags": [ "Setup" ], "description": "Unsubscribe from an existing webhook\n", "operationId": "delete-webhooks-by-topic", "summary": "Unsubscribe from an existing webhook" }, "put": { "parameters": [ { "description": "topic to unsubscribe from", "in": "path", "name": "topic", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookResponse" } } }, "description": "OK" }, "401": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Unauthorized" }, "403": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Forbidden" }, "404": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Not found" }, "default": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }, "description": "Unexpected error" } }, "tags": [ "Setup" ], "description": "Change webhook url\n", "operationId": "put-webhooks-by-topic", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateWebhookRequest" } } }, "description": "Update webhook request", "required": true }, "summary": "Change webhook url" } } }, "components": { "schemas": { "ConnectionRequest": { "properties": { "code": { "description": "Unique identifier representing a connection", "type": "string" }, "service": { "$ref": "#/components/schemas/ConnectionServiceType" } }, "required": [ "code", "service" ], "type": "object" }, "ConnectionResponse": { "properties": { "code": { "description": "Unique identifier representing a connection", "type": "string" }, "service": { "$ref": "#/components/schemas/ConnectionServiceType" }, "status": { "$ref": "#/components/schemas/ConnectionStatusType" } }, "required": [ "code", "service" ], "type": "object" }, "ConnectionServiceType": { "description": "Service to be used when connecting to the system", "enum": [ "AbitariService" ], "type": "string" }, "ConnectionStatusType": { "description": "Status of the connection", "enum": [ "setup_pending", "setup_auth_ok", "setup_auth_failed", "setup_started", "setup_finished", "online", "offline" ], "type": "string" }, "Error": { "properties": { "code": { "format": "int32", "type": "integer" }, "fields": { "type": "string" }, "message": { "type": "string" } }, "required": [ "code" ], "type": "object" }, "GuestPetitionRequest": { "properties": { "expires_at": { "description": "Datetime in which petition is no longer applied (although optional, mainly used in non disturb).", "type": "string" }, "guest_id": { "description": "Unique identifier representing the guest making the petition.", "type": "string" }, "id": { "description": "Unique identifier representing a specific guest petition.", "type": "string" }, "message": { "description": "Some observations regarding the petition.", "type": "string" }, "place_id": { "description": "The id of your IntegratedProperty where the guest petition originates.", "type": "string" }, "room_id": { "description": "Unique identifier representing the specific room where the request takes place.", "type": "string" }, "starts_at": { "description": "Datetime in which petition starts applying (required for non disturb).", "type": "string" }, "status": { "$ref": "#/components/schemas/GuestPetitionStatus" }, "type": { "$ref": "#/components/schemas/GuestPetitionType" } }, "required": [ "id", "type", "room_id", "place_id" ], "type": "object" }, "GuestPetitionResponse": { "properties": { "expires_at": { "description": "Datetime in which petition is no longer applied (although optional, mainly used in non disturb).", "type": "string" }, "guest_id": { "description": "Unique identifier representing the guest making the petition.", "type": "string" }, "id": { "description": "Unique identifier representing a specific guest petition.", "type": "string" }, "message": { "description": "Some observations regarding the petition.", "type": "string" }, "pms_id": { "description": "Unique identifier representing the pms the property works with.", "type": "string" }, "room_id": { "description": "Unique identifier representing the specific room where the request takes place.", "type": "string" }, "starts_at": { "description": "Datetime in which petition starts applying (required for non disturb).", "type": "string" }, "status": { "$ref": "#/components/schemas/GuestPetitionStatus" }, "type": { "$ref": "#/components/schemas/GuestPetitionType" } }, "required": [ "id", "pms_id", "room_id", "type", "status" ], "type": "object" }, "GuestPetitionStatus": { "description": "Petition done status", "enum": [ "pending", "done" ], "type": "string" }, "GuestPetitionType": { "description": "Type of Petition", "enum": [ "incidence-type", "make-cleaning-type", "notifiable-event-type", "non-disturb-type", "extra-cleaning-type" ], "type": "string" }, "StartConnectionRequest": { "properties": { "code": { "description": "Unique identifier representing a connection", "type": "string" }, "property_callback_url": { "description": "Url to send the notification of a new IntegratedPropertyNotificationType", "type": "string" }, "property_ids": { "items": { "type": "string" }, "type": "array" } }, "required": [ "code", "property_ids" ], "type": "object" }, "UpdateWebhookRequest": { "properties": { "url": { "description": "Consumer endpoint that processes the notification.", "type": "string" } }, "required": [ "url" ], "type": "object" }, "WebhookEventType": { "description": "Topic that triggers the notification", "enum": [ "healthcheck", "guestpetition", "room" ], "type": "string" }, "WebhookRequest": { "properties": { "topic": { "$ref": "#/components/schemas/WebhookEventType" }, "url": { "description": "Consumer endpoint that processes the notification.", "type": "string" } }, "required": [ "topic", "url" ], "type": "object" }, "WebhookResponse": { "properties": { "id": { "type": "string" }, "topic": { "description": "Event that triggers the notification (typicaly resource name, for example room.", "type": "string" }, "url": { "description": "Consumer endpoint that processes the notification.", "type": "string" } }, "required": [ "id", "topic", "url" ], "type": "object" } }, "securitySchemes": { "accessCode": { "flows": { "authorizationCode": { "authorizationUrl": "https://identity.abitari.com/o/token", "scopes": { "read": "allows reading resources", "write": "allows modifying resources" }, "tokenUrl": "https://identity.abitari.com/o/authorize" } }, "type": "oauth2" } } }, "security": [ { "accessCode": [ "read", "write" ] } ], "tags": [ { "name": "Messaging" }, { "name": "Setup" } ] }