API Guides

Booking

Familiarise yourself with the particulars of the booking endpoint.

Description

A booking represents a reservation of one or more workspaces. Booking data can be pushed to the BuildingMinds Platform via this API.


Create bookings

POST Request: {{BASE_URL}}/booking

Field attributes

FieldTypeDescription
bookingDatestringDate booking was created in yyyy-mm-ddThh:mm:ssZ form (conform to ISO 8061)
minLength: 20 (mandatory)
bookingIdstringUnique identifier; must either originate from the previous system or be explicitly defined
minLength: 1; maxLength: 50 (mandatory)
cancelledbooleanHas the reservation been cancelled? (Y/N)
checkInTimestringCheck-in time in yyyy-mm-ddThh:mm:ssZ form (conform to ISO 8061)
minLength: 20 (mandatory)
checkOutTimestringCheck-out time in yyyy-mm-ddThh:mm:ssZ form (conform to ISO 8061)
minLength: 20 (mandatory)
eventTypestringType of the event as specific domain event

Options: WorkspaceBookingCompleted, WorkspaceBookingCheckedIn, WorkspaceBookingCheckedOut, WorkspaceBookingCancelled
extensionDatajsonExtension data for storing any custom data
validFromstringThe records can be used from this date onwards in yyyy-mm-ddThh:mm:ssZ form (conform to ISO 8061)
minLength: 20 (mandatory)
validUntilstringThe records can be used until this date in yyyy-mm-ddThh:mm:ssZ form (conform to ISO 8061)
minLength: 20 (mandatory)
workspaceIdsstring, arrayArray of workspace IDs
minLength: 1; maxLength: 50
[
  {
    "bookingDate": "stringstringstringst",
    "bookingId": "string",
    "cancelled": true,
    "checkInTime": "stringstringstringst",
    "checkOutTime": "stringstringstringst",
    "eventType": "WorkspaceBookingCompleted",
    "extensionData": {
      "additionalProp1": {}
    },
    "validFrom": "stringstringstringst",
    "validUntil": "stringstringstringst",
    "workspaceIds": [
      "string"
    ]
  }
]

Check in or out of bookings

The only change will be in the eventType: WorkspaceBookingCheckedIn/WorkspaceBookingCheckedOut.

POST Request:{{BASE_URL}}/booking

[
  {
    "bookingDate": "string",
    "bookingId": "string",
    "cancelled": true,
    "checkInTime": "string",
    "checkOutTime": "string",
    "eventType": "WorkspaceBookingCheckedIn",
    "extensionData": {},
    "validFrom": "string",
    "validUntil": "string",
    "workspaceIds": [
      "string"
    ]
  }
]

[
  {
    "bookingDate": "string",
    "bookingId": "string",
    "cancelled": true,
    "checkInTime": "string",
    "checkOutTime": "string",
    "eventType": "WorkspaceBookingCheckedOut",
    "extensionData": {},
    "validFrom": "string",
    "validUntil": "string",
    "workspaceIds": [
      "string"
    ]
  }
]


Cancel booking

The only change will be in the eventType: WorkspaceBookingCancelled.

POST Request:{{BASE_URL}}/booking

[
  {
    "bookingDate": "string",
    "bookingId": "string",
    "cancelled": true,
    "checkInTime": "string",
    "checkOutTime": "string",
    "eventType": "WorkspaceBookingCancelled",
    "extensionData": {},
    "validFrom": "string",
    "validUntil": "string",
    "workspaceIds": [
      "string"
    ]
  }
]


View status of bookings

Based on the batchID generated you can GET the batch of the on-boarded bookings with the below mentioned request. This will be the same for Check-In, Check-Out and Cancel.

GET Request:{{BASE_URL}}/batch/{id}/inbound

Please refer to Batch page for more details.