Authentication

Getting Started / Authentication

The hetras API authenticates client applications based on the application ID and the application key. Every application is then authorized to access the data of one specific hotel chain for either the certification or the production environment.

hetras API authentication

When you are invited to an account of a hotel chain you will get access to an application authorized for the certification environment first. More details on how to get access to an account and manage your applications can be found in the section Access Control.

Please note:
You need to ensure that at least the App-Key is always kept secret and is never exposed to the public as it is the password for accessing our API. If an unauthorized party got access to your App-Key, you can create a new one on the Developer Portal.

hetras registered a demo application for the certification environment which is authorized for a chain setup with two hotels. You can use the following api credentials when exploring the hetras API using our API documentation even if you haven´t been invited to an existing account.

Demo Credentials
App-Id 4a939f04
App-Key 1e0a955a6b03781bd601e693b0ba6f4d

To ease the use of the demo application you can find a link in the left upper corner of the active documentation when not logged in. It allows you to fill in the demo credentials to the headers of all API calls available. You can then just fill out the other parameters and click the “Try it out!” button.

hetras API demo credentials

Whenever you make a call to our API, you need to put the application ID and the application key to the headers of your request. The API will validate the credentials and check if you have access to the requested API resource. On success the request will be forwarded to our backend system in the context of the hotel chain your application is authorized for.

The following example shows how you could request info for a specific hotel using our example api credentials using curl on the command line.

Get info for a specific hotel

$ curl -v -X GET -H "App-Id:4a939f04" -H "App-Key:1e0a955a6b03781bd601e693b0ba6f4d" "https://api.hetras-certification.net/api/hotel/v0/hotels/100004"

Request

> GET /api/hotel/v0/hotels/100004 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: api.hetras-certification.net
> Accept: /
> App-Id:4a939f04
> App-Key:1e0a955a6b03781bd601e693b0ba6f4d

Response

< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Cache-Control: no-cache
< Content-Type: application/json; charset=utf-8
< Date: Tue, 31 May 2016 14:20:50 GMT
< Expires: -1
< Hetras-Processing-Time: 5161ms
< Hetras-Tracking-Id: 8a539eeec0a346ca88c81ce8e5d9dd7e
< Pragma: no-cache
< Content-Length: 496
< Connection: keep-alive

{
“hotel_id”: 100004,
“code”: “SHO01”,
“name”: “Show Hotel München”,
“desc”: “The Show Hotel Munich is situated in the heart of Munich, next to the river Isar and within walking distance to the ‘Deutsche Museum’.”,
“street”: “Tassiloplatz 27, RGB”,
“city”: “Munich”,
“postal_code”: “81541”,
“country”: “DE”,
“phone”: “+49 (0) 89 716 718 510”,
“email”: “support@hetras.com”,
“url”: “http://www.hetras.com”,
“latitude”: “48.127383”,
“longitude”: “11.592459”,
“utc_offset”: “UTC+02:00”,
“current_business_day”: “2016-04-11”
}