Authentication

Authentication API allow you for getting your userId and authToken associated with your Roomonitor login credentials: username and password.

Login

API Server: any Roomonitor API Server or https://bookings.roomonitor.com

Endpoint: /login

HTTP Method: POST

Parameters:

The parameters must be coded as raw body payload.

  • username The Roomonitor username login credentials

or

  • email Your Roomonitor login email.

and

  • password The login password credential in text plain

Body Paypload:

username=my_username&password=my_text_plain_password

or in Body JSON

{
    "email": "your_email",
    "password": "my_text_plain_password"
}

Success Response

Note: Tokens hasn’t an expiration date but it is possible that in one moment the authToken would be cleaned and you need to call to login API for to generate a new token.

Code: 200 Response:

{ 
    status: "success", 
    data: {
        authToken: "wiiz1sadfdszcHbXJEOxs4-gRp2jNPH6ifxXtAX_Zz",
        userId: "vDSCybTdsdWCopT5A"
    } 
}

Error Response

Code: 401 Response:

{ status: 401, message: 'Unauthorized' }

Logout

API Server: any Roomonitor API Server or https://bookings.roomonitor.com

Endpoint: /logout

HTTP Method: POST

Authenticated: true

Auth headers:

  • X-User-Id:{userId} (required) The userId must be the same as the before userId parameter example X-User-Id: 9yOHMi8fDXsweQ21
  • X-Auth-Token:{authToken} (required) The authToken obtained with the Authentication Login API Call example X-Auth-Token: wiiz1oKVwxemzcHbXJEOxs4-gRp2jNPH6ifxXtAX_Zz

Body Paypload: None

Success Response

Code: 200 Response:

{
    "status": "success",
    "data": {
        "message": "You've been logged out!"
    }
}

Error Response

Code: 401 Response:

{ status: 401, message: 'Unauthorized' }