Authentication

Access to the Online Booking API uses partner credentials issued by HMS. The login endpoint exchanges apiKey and apiSecret for a token, which is sent as Authorization: Bearer on every other request. See the Authentication guide for details.

Log in and get a token#

POST/external/public/login

No authentication required · Body: application/x-www-form-urlencoded or multipart/form-data

Validates the partner credentials and issues a token if the partner is authorised for the hotel. The token is bound to one hotel; log in separately for each hotel.

Form fields

apiKeystringrequired
Partner key issued by HMS.
apiSecretstringrequired
Partner secret. Keep it server-side only.
hotelCodeintegerrequired
The hotel’s HMS ID (hotelID). The partner must be authorised for this hotel.
hotelSeoUrlstring
The hotel’s SEO slug in HMS. Used instead of hotelCode only by HMS’s own booking engine; third-party integrations should send hotelCode.

Response

200 Token and hotel details. The token is valid for 7 days; renew it by logging in again before it expires.

successboolean
Result flag.
hotelCodestring
Hotel ID the token is bound to.
tokenstring
Bearer token. Treat it as opaque; do not parse it.
hotelSeoUrlstring | null
The hotel’s SEO slug.

Error responses

  • 200 partner_is_not_found — key pair did not match; hotel_is_not_found — no hotel for hotelSeoUrl; hotel_permission_is_not_found — the partner is not authorised for this hotel or the authorisation is inactive.
Request
curl "https://test.hms.gen.tr/external/public/login" \
  -d "apiKey=5y94tLmALIKDyUVdEPlAAjg5xWGQNgQtnALlV4+Am7Q=" \
  -d "apiSecret=a143d6408634696b811def06d236682950cacb9761aa8ad5827da4015bda4b19" \
  -d "hotelCode=1000"
Response · 200
{
    "success": true,
    "hotelCode": "1000",
    "token": "eyJlbmREYXRlIjp7ImRhdGUiOiIyMDI2LTA5LTE1IDEwOjI0OjMxLjAwMDAwMCIsInRpbWV6b25lX3R5cGUiOjMsInRpbWV6b25lIjoiRXVyb3BlL0lzdGFuYnVsIn0sInRva2VuIjoiM2tkOXNscTJwbTh2eHI0dHp5Nm53YjFoYzdmajVnYTAiLCJob3RlbElEIjoxMDAwLCJ1c2VySUQiOjQyLCJkYXRlIjp7ImRhdGUiOiIyMDI2LTA5LTA4IDEwOjI0OjMxLjAwMDAwMCJ9fQ==",
    "hotelSeoUrl": "demo-otel"
}
Response · 200 (failure)
{
    "success": false,
    "token": null,
    "message": "hotel_permission_is_not_found"
}
Last updated: 8 September 2026Found a mistake? Let us know