Skip to main content

Rainbow Hospitality Gateway Python Client (rbh-builder-python)

Thin Python wrapper around the Rainbow Hospitality Gateway REST and WebSocket APIs (Edition 07 of the guide). It supports login, core reservation flows, guest management, wake-up calls, and the GraphQL WebSocket feed for call logs.

Installation

pip install -e .             # from this repo
pip install rbh-builder-python[ws]     # if published, includes optional websocket support

Quickstart

from rbh_builder import RainbowClient

client = (
    RainbowClient.builder(base_url="https://red-rhg.openrainbow.io/provisioningapi/api")
    .with_credentials(username="api_user", password="api_password")
    .build()
)

# Rooms
rooms = client.get_rooms(page_number=1, page_size=20)

# Check-in
client.checkin(
    room_id="101",
    checkout_date="2025-12-31",
    first_name="John",
    last_name="Doe",
    barring="local",  # local | nat_local | int_nat_local
)

# Wake-up call
client.create_wakeup_call(
    room_id="101",
    alarm_time="2025-12-24T07:00:00",
    followup_time="2025-12-24T07:10:00",
    frequency="Once",
)

WebSocket call logs (GraphQL)

import asyncio
from rbh_builder.ws import RainbowWebSocketClient

async def stream_logs():
    ws = RainbowWebSocketClient(
        access_token=client.access_token,
        app_key="your-app-key",
        company_id=client.company_id,
    )
    async for event in ws.subscribe_call_logs():
        print(event)

asyncio.run(stream_logs())

Endpoints covered

  • POST /Login to obtain JWT + company ID.
  • GET /GetRooms
  • GET /GetGuests
  • GET /GetCallLogs
  • POST /Checkin, POST /Checkout, POST /MoveRoom
  • POST /CreateGuest, PUT /UpdateGuest, DELETE /DeleteGuest
  • POST /CreateWakeupCall, PUT /UpdateWakeupCall, DELETE /DeleteWakeupCall, GET /GetWakeupCalls
  • WebSocket wss://rhg.openrainbow.io/provisioningapi/graphql subscription for call logs.

Notes from the API guide

  • Base URL: https://red-rhg.openrainbow.io/provisioningapi/api (update as needed for your environment)
  • Auth: POST /Login with JSON {Username, Password} returns AccessToken (JWT) and CompanyID.
  • Subsequent calls use header Authorization: Bearer <jwt>.
  • Pagination params: pageNumber, pageSize; most list endpoints require CompanyID and return { Code, Data: { Data, TotalCount, PageNumber, PageSize, TotalPages }, Status }.
  • Checkin requires CompanyID, RoomId, CheckoutDate, FirstName, LastName, Barring (one of local|nat_local|int_nat_local), optional GuestId.
  • Checkout requires CompanyID, RoomId, optional DeleteGuest flag.
  • MoveRoom requires CompanyID, RoomId (old), NewRoomId.
  • Guest create/update payloads include contact details; delete uses GuestId + CompanyID.
  • Wakeup calls: create {CompanyId, RoomId, AlarmTime, FollowupTime, Frequency}, update {Id, AlarmTime, FollowupTime}, delete {Id}, list requires CompanyID.
  • WebSocket uses GraphQL graphql-transport-ws subprotocol; connection init includes Authorization and x-app-key, then a subscription to logsArrived(companyId: $companyId); keep alive via {"type":"ping"}.

Auth refresh

  • When instantiated via the Builder (i.e., with credentials), the client will retry once on 401 by re-running POST /Login and refreshing the bearer token, then re-issuing the original request. If constructed with an access token only, refresh is not possible.

License

MIT (placeholder).

Metadata

Release files for rbh-builder-python 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rbh-builder-python 0.1.0
File Size Uploaded Provenance Actions
rbh_builder_python-0.1.0.tar.gz 7.0 kB Without provenance Details for rbh_builder_python-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rbh-builder-python 0.1.0
File Interpreter ABI Platform Actions
rbh_builder_python-0.1.0-py3-none-any.whl Python 3 none any Details for rbh_builder_python-0.1.0-py3-none-any.whl

Total release size: 18.7 kB

Release files / rbh_builder_python-0.1.0.tar.gz

Download URL rbh_builder_python-0.1.0.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
97784791d79e0e68aae9114f7ac9dafabb9804f50df730fcd839483d6367e356
BLAKE2b-256 checksum
How to use checksums
0675c7e6bb1bfb118a3642f3a4e4e837fdb67089de91868c8fc905c6bde8335f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Release files / rbh_builder_python-0.1.0-py3-none-any.whl

Download URL rbh_builder_python-0.1.0-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b7e8cfb3e7dc5e7c2cbab8af0bd48c983d9ccd478109e15a190c5f984768e48
BLAKE2b-256 checksum
How to use checksums
864ef74d5f748efcb98af33e6ff02aaf5eff3e0fd156b4c6de46b1ea8583d5ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Security for rbh-builder-python 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page