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