User Synchronisation for Multi-property Cases
Characteristics
As in many cases companies are not operating on an independent level, but rather in a more complex network structure, it is required to distribute the employees upon the different levels accordingly.
With hotelkit it is possible to establish a multi-property network based on the structure of your company. Usually there is always a headquarter, optional regional / sub levels & the base level of the specific properties (hotels, clinics, companies..).The headquartern, sub levels and each base property gets activated with the integration and has an individual customer-key.
Therefore, in order to make sure that the users are distributed upon different networks, as needed it is important to follow the given process shown below.
Functionality
The functionality will be described based on the following example. Please note that every client’s network structure can be built differently, nevertheless this example aims to tackle the most common workflows.
Demo structure for hotelkit API
As soon as you are ready to test hotelkit will provide you with the following network structure to assure your developments meet the expected workflows.
The highest level is always the customer with the active user synchronisation. From this network the user distribution should originate. Eventhough it is possible that users should not be activated in the HQ (user 2 & 3 of this example).
Get all users
To receive the list of users execute GET /users, you’ll be given all users from this level and lower.
In the examples, “europe” is used in the header of the query as it is the highest level.
GET /users
curl -H "x-hotelkit-api-version: 3.0" -H "x-hotelkit-api-public-key: api-usersync" -H "x-hotelkit-api-nonce: [generated nonce]" -H "x-hotelkit-api-signature:[generated signature]" -H "x-hotelkit-api-customer-key: europe" -H "Date: 2024-06-21T19:00:13.239Z" -H "Accept: /*" -H "Content-Type: application/json" -X GET -d '[]' -i https://api.hotelkit.net/users
"userList": {
"1": {
"clientID": "clientID1",
"customerList": [
"europe",
"austria",
"germany",
"vienna",
"dresden",
"valencia"
],
// [...]
},
"2": {
"clientID": "clientID2",
"customerList": [
"austria",
"germany"
],
// [...]
},
"3": {
"clientID": "clientID3",
"customerList": [
"germany",
"dresden"
],
// [...]
},
"4": {
"clientID": "clientID4",
"customerList": [
"europe",
"vienna"
],
// [...]
},
"5": {
"clientID": "clientID5",
"customerList": [
"valencia"
],
// [...]
},
"6": {
"clientID":"clientID6",
"customerList": [
"europe"
],
}
}
Retrieve single user
To get a single User use GET /users/{ID} from the highest-level “customer-key: europe”
Complete
GET /users/{ID}
curl -H "x-hotelkit-api-version: 3.0" -H "x-hotelkit-api-public-key: api-usersync" -H "x-hotelkit-api-nonce: [generated nonce]" -H "x-hotelkit-api-signature: [generated signature]" -H "x-hotelkit-api-customer-key: europe" -H "Date: Mon, 09 Mar 2020 08:13:24 GMT" -H "Accept: application/json" -X GET -d '[]' -i https://api.hotelkit.net/users/4
{
"ID":"4",
"givenName":"Yasmin",
"surName":"Yellow",
"gender":"female",
"birthDate":"06.01.2000",
"position":"Kitchen temp",
"loginName":"Yasmin Yellow",
"clientID":"clientID4",
"customerList": ["europe", "vienna"]
}
Shortened
GET /users/{ID}
{
"ID":"3",
"givenName":"Bob",
"surName":"Blue",
// [...]
"customerList": ["germany","dresden"]
}
Creating a new user
When a new user is created in the partner the new user shall be transmitted to hotelkit.
Run POST /users to create the user while using “customer-key: europe” in the header and set all needed properties and administration-levels in the customerList.
Example to create a 7th user
In the response you get the identifier of the newly created user “hotelkitID”:”7”
Updating a user
Updating a user follows the same principles. Use the customer-key from the highest level “europe” and use PUT /users/{ID}.
Given our newly created user 7 is not assigned to Valencia anymore, but still in Europe and Germany the Update can shortened look like this
General information for creating and updating users are found in User Synchronization.