[#803] Book() function new issue: [-32068] Client authorization required

Migrated from Redmine #803 | Author: Michael K
Status: New | Priority: Immediate, there is BUG! | Created: 2021-10-16


Hello again. A few days now as I see new error rising by your book() function. It appears at my page and at your demo “/en/api/developer-api/tab/explorer_api” page.

Example code is:
var result = client.book(serviceId, performerId, startDate, startTime, clientData, additionalFieldValues, count);

I believe it was result of your recent updates at SimblyBook API. Could you please fix it? Many thanks.

Redmine Admin wrote:

Please prowide RAW HTTP request and responce

Michael K wrote:

Yes, this is pure from chrome incognito demo page “/en/api/developer-api/tab/explorer_api”, the popop error is exactly same:

General:

Request URL: https://user-api.simplybook.me/
Request Method: POST
Status Code: 200
Remote Address: 51.161.122.211:443
Referrer Policy: strict-origin-when-cross-origin

Response headers:

access-control-allow-headers: content-type, x-company-login, x-application-token, x-user-token, x-token, x-requested-with
access-control-allow-methods: POST, GET, OPTIONS
access-control-allow-origin: *
content-length: 102
content-type: application/json; charset=UTF-8
date: Sun, 17 Oct 2021 01:21:07 GMT
server: nginx
x-xss-protection: 1; mode=block

Request headers:

:authority: user-api.simplybook.me
:method: POST
:path: /
:scheme: https
accept: application/json, text/javascript, /; q=0.01
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
content-length: 150
content-type: application/json
origin: https://simplybook.me
referer: https://simplybook.me/
sec-ch-ua: “Chromium”;v=“94”, “Google Chrome”;v=“94”, “;Not A Brand”;v=“99”
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: “Windows”
sec-fetch-dest: empty
sec-fetch-mode: cors
sec-fetch-site: same-site
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36
x-company-login: mib
x-token: b8d095c87ec60c285c60cc4a65ccd71499195c3c247dbdf17a37644d3b4ce88e

Request payload:

{jsonrpc: “2.0”, method: “book”,…}
id: 7
jsonrpc: “2.0”
method: “book”
params: [“1”, “1”, “2021-10-01”, “18:30:00”, {name: “Tester”, email: “miklegene@gmail.com”, phone: “123”}, {},…]
0: “1”
1: “1”
2: “2021-10-01”
3: “18:30:00”
4: {name: “Tester”, email: “miklegene@gmail.com”, phone: “123”}
email: “miklegene@gmail.com
name: “Tester”
phone: “123”
5: {}
6: 1

Error tab:

{
“code”: -32068,
“message”: “Client authorization required”,
“data”:
}

Response tab:

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

Michael K wrote:

Unfortunately there is no feature to assign ticket back.

Redmine Admin wrote:

it seems you enabled client login plugin, please turn it off or use client id to book (you need to add client first)

Michael K wrote:

Redmine Admin wrote:

it seems you enabled client login plugin, please turn it off or use client id to book (you need to add client first)

Wow, big thanks, absolutely didn’t know this could affect. We bought more feature slots to enable Packages we needed, and Client login feature turned on automatically. I checked off “Allow clients to sign up on site” switch in this feature and it works fine now, but strange how it affects your api demo page in incognito mode. Anyway, sorry for disturbing.