[#1325] New booking

Migrated from Redmine #1325 | Author: soniya james
Status: Feedback | Priority: High, I’m very impatient | Created: 2024-12-03


New booking getting
{
“error”: {
“code”: -32068,
“message”: “Client authorization required”,
“data”:
},
“id”: “1”,
“jsonrpc”: “2.0”
}

This error how i can fix this

Dmytro Bondarev wrote:

Hi,
If you use client login custom feature, you should pass client_id and client_sign to $clientData parameter.
Where
client_id - is client id
client_sign - is md5(clientId + clientHash + secretKey) ,
clientHash - you will receive when client is created.
secretKey - your secret key

soniya james wrote:

{
“jsonrpc”: “2.0”,
“method”: “book”,
“params”: [
“1”, // User ID (or entity ID)
“2”, // Service ID (or service identifier)
“2024-12-04”, // Booking Date (YYYY-MM-DD)
“09:00:00”, // Booking Time (HH:mm:ss)
{
“name”: “rinu”, // Client’s name
“email”: “rinu62@gmail.com”,// Client’s email
“phone”: “9488567900” // Client’s phone number
},
{}, // Additional parameters (empty object here)
1 // Integer (could represent confirmation or a status code)
],
“id”: 1
}
this will not work?
“name”: “rinu”, // Client’s name
“email”: “rinu62@gmail.com”,// Client’s email
“phone”: “9488567900”

we need to pass like this?

client_id - is client id
client_sign - is md5(clientId + clientHash + secretKey) ,
clientHash - you will receive when client is created.
secretKey - your secret key

Dmytro Bondarev wrote:

If you are using client login, then it will not work, please use client_id, client_sign as described above.

soniya james wrote:

hello sir,

{
“jsonrpc”: “2.0”,
“method”: “book”,
“params”: {
“eventId”:6,
“unitId”: 2,
“date”: “2024-12-04”,
“time”: “14:00:00”,
“clientData”: [“6”,
“cfcd208495d565ef66e7dff9f98764da”],
“additional”: ,
“count”: 1,
“batchId”: null,
“recurringData”: {
“recurrenceType”: “weekly”,
“duration”: 10
}
},
“id”: 1
}

if i am passing client_id, client_sign as described above.

now also getting

{
“error”: {
“code”: -32068,
“message”: “Client authorization required”,
“data”:
},
“id”: “1”,
“jsonrpc”: “2.0”
}

Give a proper solution

Dmytro Bondarev wrote:

As we explained already, you should not use named parameters.
Your request should look like:

{
“jsonrpc”: “2.0”,
“method”: “book”,
“params”: {
6, 2, “2024-12-04”, “14:00:00”, {“client_id”: 6, “client_sign”: “cfcd208495d565ef66e7dff9f98764da”}, {}, 1, null, {
“recurrenceType”: “weekly”,
“duration”: 10
}
},
“id”: 1
}

soniya james wrote:

Then also same issue.

{
“jsonrpc”: “2.0”,
“method”: “book”,
“params”: [“6”,“2”,“2024-12-04”, “14:00:00”, [“6”, “cfcd208495d565ef66e7dff9f98764da”], {}, 1, null, {
“recurrenceType”: “weekly”,
“duration”: 10
}
],
“id”: 1
}

{
“error”: {
“code”: -32068,
“message”: “Client authorization required”,
“data”:
},
“id”: “1”,
“jsonrpc”: “2.0”
}

Dmytro Bondarev wrote:

Please provide full http request and response.

soniya james wrote:

https://user-api.simplybook.me/

X-Company-Login:airportvipservice
X-Token:39f47c1d7ab479b3fc34f89cf3a162dc2a2d81fbccf1d61df1089c0fbba7f78b

{
“jsonrpc”: “2.0”,
“method”: “book”,
“params”: [6,2,“2024-12-04”, “14:00:00”, [“6”, “cfcd208495d565ef66e7dff9f98764da”], {}, 1, null, {
“recurrenceType”: “weekly”,
“duration”: 10
}
],
“id”: 1
}

{
“error”: {
“code”: -32068,
“message”: “Client authorization required”,
“data”:
},
“id”: “1”,
“jsonrpc”: “2.0”
}

Dmytro Bondarev wrote:

Including endpoint and method.

soniya james wrote:

method POST
end point https://user-api.simplybook.me/

Header
X-Company-Login:airportvipservice
X-Token:39f47c1d7ab479b3fc34f89cf3a162dc2a2d81fbccf1d61df1089c0fbba7f78b

Request
{
“jsonrpc”: “2.0”,
“method”: “book”,
“params”: [6,2,“2024-12-04”, “14:00:00”, [“6”, “cfcd208495d565ef66e7dff9f98764da”], {}, 1, null, {
“recurrenceType”: “weekly”,
“duration”: 10
}
],
“id”: 1
}

Response

{
“error”: {
“code”: -32068,
“message”: “Client authorization required”,
“data”:
},
“id”: “1”,
“jsonrpc”: “2.0”
}

Dmytro Bondarev wrote:

Please check your parameters:

In example i provided oobject with client_id, client_sign, you pass array in this parameter.

6, 2, “2024-12-04”, “14:00:00”, {“client_id”: 6, “client_sign”: “cfcd208495d565ef66e7dff9f98764da”}, {}, 1, null, {

soniya james wrote:

{
“jsonrpc”: “2.0”,
“method”: “book”,
“params”:[
“6”, “2”, “2024-12-04”, “14:00:00”, {“client_id”: 6, “client_sign”: “cfcd208495d565ef66e7dff9f98764da”}, {}, 1, null, {
“recurrenceType”: “weekly”,
“duration”: 10
}
],
“id”: 1
}

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

If i am giving your example 500 error getting

Dmytro Bondarev wrote:

Signature error is not 500n error.
it means that you generated client_sign in a wrong way. Please make sure that you generate it correctly.

soniya james wrote:

I tried with different Ids then also same issue.

Dmytro Bondarev wrote:

Just try with correct id, correct client_hash, and correct secret key.
Please provide client id, client_hash and your result of client_sign.

soniya james wrote:

{
“jsonrpc”: “2.0”,
“method”: “book”,
“params”: {
“eventId”: 6,
“unitId”: 2,
“date”: “2024-12-04”,
“time”: “14:00:00”,
“clientData”: {“client_login":"FrancesTPerez@gmail.com”, “client_password” :“ValidPassword123”},
“additional”: {},
“count”: 1,
“batchId”: null,
“recurringData”: {
“recurrenceType”: “weekly”,
“duration”: 10
}
},
“id”: 1
}
this way I given its working now