[#1113] Signature error on getClientBookings

Migrated from Redmine #1113 | Author: Marc Bernet
Status: New | Priority: High, I’m very impatient | Created: 2023-10-05


Hello,

I’m experiencing issues with the getClientBookings call from your API. It’s returning a signature error, and I’m making the request just as outlined in the documentation.

I’m sending you some details about the request:

Headers:
[“X-Company-Login: [company_login]”,“X-Token: [APIKEY]”,“Content-Type: application/json”]

Payload:
{“jsonrpc”:“2.0”,“id”:1,“method”:“getClientBookings”,“params”:[“11”,“74206a3d8b026dcb32bdb1b633521fde”]}

Response:
{“error”:{“code”:-32085,“message”:“Signature error”,“data”:},“id”:“1”,“jsonrpc”:“2.0”}

I calculate the signature in the following manner:

$signature = md5($clientId . $clientHash . $this->api_Key);

I can provide more details (client_login, api_key) if you need it to inspect the request.

Thank you very much.

Redmine Admin wrote:

hi,

  1. Please make sure you are using “X-Token: [APIKEY]” token you got from loginClient.getToken
  2. $sign = md5($booking->id . $booking->hash . YOUR_API_SECRET_KEY); not client hash

Marc Bernet wrote:

Redmine Admin wrote:

hi,

  1. Please make sure you are using “X-Token: [APIKEY]” token you got from loginClient.getToken
  2. $sign = md5($booking->id . $booking->hash . YOUR_API_SECRET_KEY); not client hash

I’m trying to get ALL the bookings from a client so I don’t know any booking->id or booking->hash. In your documentation, the first parameter is the clientId and the second one the signature.

Thanks!

Redmine Admin wrote:

this is not possible by such API, please use REST API API documentation | SimplyBook.me Online Scheduling

Dmytro Bondarev wrote:

Hi,

Please use client->id, client->hash instead booking->id, booking->hash.
You received it when you made booking, or when you get client by login/password.

Marc Bernet wrote:

Dmytro Bondarev wrote:

Hi,

Please use client->id, client->hash instead booking->id, booking->hash.
You received it when you made booking, or when you get client by login/password.

Thanks Dmytro,

This what I did in first instance and I got the signature error:

Those are the following details:

ClientId: 11
ClientHash: 2c10dde211c48a5db4cb1c1f22bdf7bc
Signature: 74206a3d8b026dcb32bdb1b633521fde

Thanks

Dmytro Bondarev wrote:

Hi,
It seems you are using wrong Secret key or something wrong with signature calculations.
Please double check your secret key.

Marc Bernet wrote:

Dmytro Bondarev wrote:

Hi,
It seems you are using wrong Secret key or something wrong with signature calculations.
Please double check your secret key.

I was using the ApiKey instead. Now it works.

Thanks