[#56] Get client and Booking information using API

Migrated from Redmine #56 | Author: Egor Timofeev
Status: New | Priority: Normal | Created: 2017-10-17


Hello,

Can you please advice if we have any way to get booking information/ client information from the system using API?
We plan to use simplybook in one of our pojects and need to build some extra functions on top of it. To be able to do that we need to have ability to get booking infromation and client information and do some search in that.

Do you have anyway for that? If no may be this could be implmented?

Let me know and thank you in advance.

Egor

Egor Timofeev wrote:

I found 2 pages on the web:

Those page a bit different. Can you advice which one I can use as a base?

Also question do we have any ability to do SSO with simplybook? Do you have any plans to support it?

Thank you again.

Dmytro Bondarev wrote:

Hi! You can use API methods

to get information about bookings.
Also you can use API Webhook to be notified whenever booking is created/changed/deleted.

Egor Timofeev wrote:

Do you have more information about hooks? Can you please share a link where I can check it.

Also API call getClientByLoginHash - can you please advice how can I get that hash for a client? Is it coming from getClientInfoByLoginPassword when I sign in using client email and password.
And for the last getClientInfoByLoginPassword call - can I user phone as a login instaed of email?

Thank you!

Dmytro Bondarev wrote:

In the settings of API plugin you can find info about hooks.
The callback data will be presented in the raw post data in JSON format. The following fields are available:
booking_id - Booking ID
booking_hash - Booking hash
company - Your company login
notification_type - Notification type. Can be ‘create’, ‘cancel’, ‘notify’, ‘change’

You can use getClientByLoginHash or getClientInfoByLoginPassword.
It is better to use getClientByLoginHash in case you have your own clients store and do not want to store passwords in plain text.
getClientInfoByLoginPassword you can use when your clients login directly and you do not store clients at your end.

There is no option to use phone instead email as a login.

Egor Timofeev wrote:

Dmitriy,

Can you explain how can I get that clientHash? Since even knowing client ID I still need to give sign parameter and it is based on clientHash.

Thank you in advance.
Egor

Dmytro Bondarev wrote:

When you create client via signUpClient or addClient method you will get client information with client hash.
The difference between methods is that signUpClient method sends signup email.

Egor Timofeev wrote:

Do we have any way to get hash for existing client?

Redmine Admin wrote:

There is no way to get client hash. But you can use admin side API to book without it Company administration service methods - Company administration service methods - SimplyBook.me

Egor Timofeev wrote:

When I do getClientInfoByLoginPassword I get some client_hash. But seems I can’t get client infromation based on that. Can you clarify what is it in this case?

Thank you!

Egor Timofeev wrote:

ACtually I can.. but it is not quite clear about getClientByLoginHash call. What is login_hash there?
I thought may be I can get it by getClientInfoByLoginPassword and save and then get client information based on the hash so I do not need to store username and password.