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.
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.
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.
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.
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"
> GET /api/hotel/v0/hotels/100004 HTTP/1.1
> User-Agent: curl/7.35.0
> Host: api.hetras-certification.net
> Accept: /
< 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
“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”,
“phone”: “+49 (0) 89 716 718 510”,