[#235] How to obtain Clienthash

Migrated from Redmine #235 | Author: Robin Tang
Status: Resolved | Priority: High, I’m very impatient | Created: 2018-09-12


Hi,

I have trouble trying to obtain clienthash, to create client_sign ( md5(clilentId . clientHash . yourSecretKey) ).

I have no idea how to obtain this, nor is this documented.

I read in a different thread that it is obtained via the addClient method, however, the API now only returns an integer for the clientid.

Can someone please help?

Thanks

P.S. My goal is to create bookings that aren’t automatically confirmed - the only way is to book via the client API.

Dmytro Bondarev wrote:

Hi! Sorry for mistake in documentation.
Please use addClient method of public service or signUpClient method of public service.
It will return client object.

Robin Tang wrote:

Actually this doesn’t answer my question.

Can you give an example of how I can use the book() method of the client service? Specifically, what do I need to specify for the clientData?

AFAIK, the addClient method only return a clientId but not a clientHash.

Dmytro Bondarev wrote:

As i mentioned before - addClient or signUpClient of public service will return client object with client hash.

Can you give an example of how I can use the book() method of the client service? Specifically, what do I need to specify for the clientData?

In case you are using Client Login custom feature then you need to pass client_id and client_sign to clientData.
In case you are not using Client Login then you need to pass name, phone and email.

Robin Tang wrote:

From my usage of addClient, it has only returned a clientId and not a clientHash.

This is also consistent with the documentation, which says that the method returns an Integer only.

Dmytro Bondarev wrote:

As i said before to add client and get client info with hash please use https://user-api.simplybook.me/ instead of https://user-api.simplybook.me/admin