[#1299] Access denied error when trying to get the details of a booking

Migrated from Redmine #1299 | Author: Jacques Bouman
Status: Feedback | Priority: Normal | Created: 2024-10-30


Hi,

Since today requesting details of a booking stopped working.

Bellow is a snippet of the code we use. The token can be requested but requesting the booking results in :

DATA {
error: { code: -32600, message: ‘Access denied’, data: },
id: ‘f83c0ed9-285c-40d2-8717-de9e6551564d’,
jsonrpc: ‘2.0’
}

Code :

const booking = {
booking_id: ‘325’,
booking_hash: ‘51736846b35648ba832’,
company: ‘m43’,
notification_type: ‘create’,
webhook_timestamp: 1730296825,
signature_algo: ‘sha256’
}

const loginClient = jayson.Client.https({
protocol: “https:”,
host: “user-api.simplybook.me”,
path: “/login”,
});
const token = loginClient.request(“getToken”, [“m43”, key]);

// token = 546bbec1c34f655c62d20c33178ea0652304c777773de4ee45104b08409a1ebf

const bookingClient = jayson.Client.https({
protocol: “https:”,
host: “user-api.simplybook.me”,
headers: {
“X-Company-Login”: booking.company,
“X-Token”: token,
},
});

const signInput = ${booking.booking_id}${booking.booking_hash}${secret};

const sign = md5(signInput);
const data = await bookingClient.request(“getBookingDetails”, [booking.booking_id, sign]);

Do you know what can be the issue here? As I said earlier this used to work.

Greetings,

Jacques Bouman

Dmytro Bondarev wrote:

Hi, we didn’t make any changes regarding this.
Most probably your secret key has been changed. Please check secret key.

Jacques Bouman wrote:

Dmytro Bondarev wrote:

Hi, we didn’t make any changes regarding this.
Most probably your secret key has been changed. Please check secret key.

Hi Dmytro,

I double checked the secret and that seems to be correct. Furthermore according to the documentation the error I should get when the secret is wrong is 32085

Method return an error with code -32080(Appointment couldn’t be found) if record with specified id not exists.
Methods returns an error with code -32085 (Signature error) if $sign parameter is wrong.

Greetings,

Jacques Bouman

10:51:40.152Z