3 Authentication/Authorization for accessing Cruise REST API
The Oracle Hospitality Cruise Property Management REST API accept an OAuth2 token for authentication. Currently, we are only supporting client Credential flow.
To call a REST API, a token is needed.
Obtaining a Token
Obtain the token as a POST request using the URL:
https://<hostname>/<contextpath>/access/token
Provide a basic authentication header. The header is a base64-encoded combination of your clientID and clientSecret. For example, if your clientID is clientid and your clientSecret is client-secret, the HTTP header appears as follows:
x-www-from-url
encoded format:
Table 3-1 Parameter
Parameter | Value | Description |
---|---|---|
grant_type |
Password |
Indicates the type of OAUTH grant required |
Username |
<username> |
Your user name for the service |
Password |
<password> |
Your password for the service |
Table 3-2 Token Fields
Field | Description |
---|---|
access_token |
Enables access to the SPMS Platform |
expires_in |
Number of seconds the token is valid |
token_type |
Bearer |
refresh_token |
Enable access to SPMS Platform |
Scope |
Scope of token |
Using the Access Token
After you obtain the access token, use the token to access the SPMS platform at the following URL:
https://<host><port>/contextpath/<serviceURL>/
-
Content-Type: application/json
-
Authorization: Bearer <access token>
The access token is valid until it expires. You can determine
when the token expires based on the expires_in
claim
found in the access token.