[#762] getBookingStatus gives "access denied"

Migrated from Redmine #762 | Author: Harleen Ahuja
Status: Closed | Priority: High, I’m very impatient | Created: 2021-08-23


the service getBookingStatus which lies in company administration services gives “access denied” when made a call through jsonrpc
in Headers i have set companyLogin and Token from admin Token url and in Parameter have set bookingID

below is the error code -;

error Code :-32600 “access denied”

Dmytro Bondarev wrote:

Please provide raw HTTP request with headers.

Harleen Ahuja wrote:

This is the log , have attached screen shot as well

] SIMPLY_BOOK-API |POST: [https://user-api.enterpriseappointments.com/login]
INFO | jvm 1 | main | 2021/08/23 13:12:01.626 | INFO [hybrisHTTP12] [MagrabiSimplyBookApiServiceImpl] {“jsonrpc”:“2.0”,“method”:“getToken”,“params”:[“dxbdubaimall”,“faf958ae90bde8af12a35fec72d79539bbec94d2e1050c9eea045bcea4471989”],“id”:2}
INFO | jvm 1 | main | 2021/08/23 13:12:01.627 | INFO [hybrisHTTP12] [MagrabiSimplyBookApiServiceImpl] SIMPLY_BOOK-API |[com.itelligence.magrabi.model.simplybook.response.TokenResponse]
INFO | jvm 1 | main | 2021/08/23 13:12:01.627 | INFO [hybrisHTTP12] [MagrabiSimplyBookApiServiceImpl] {“result”:“b4e7dd7243e854944f32e0b44d7818ba31aec0e7cd82ddf427e58a52f98882c6”,“id”:“2”,“jsonrpc”:“2.0”,“error”:null}
INFO | jvm 1 | main | 2021/08/23 13:12:01.627 | INFO [hybrisHTTP12] [MagrabiSimplyBookApiServiceImpl] Company LOgin is dxbdubaimall
INFO | jvm 1 | main | 2021/08/23 13:12:01.627 | INFO [hybrisHTTP12] [MagrabiSimplyBookApiServiceImpl] Token is b4e7dd7243e854944f32e0b44d7818ba31aec0e7cd82ddf427e58a52f98882c6
INFO | jvm 1 | main | 2021/08/23 13:12:01.959 | INFO [hybrisHTTP12] [MagrabiSimplyBookApiServiceImpl] SIMPLY_BOOK-API |POST: [https://user-api.enterpriseappointments.com]
INFO | jvm 1 | main | 2021/08/23 13:12:01.959 | INFO [hybrisHTTP12] [MagrabiSimplyBookApiServiceImpl] {“jsonrpc”:“2.0”,“method”:“getBookingStatus”,“params”:[“892”],“id”:16}
INFO | jvm 1 | main | 2021/08/23 13:12:01.960 | INFO [hybrisHTTP12] [MagrabiSimplyBookApiServiceImpl] SIMPLY_BOOK-API |[com.itelligence.magrabi.model.simplybook.response.BookingResponse]
INFO | jvm 1 | main | 2021/08/23 13:12:01.960 | INFO [hybrisHTTP12] [MagrabiSimplyBookApiServiceImpl] {“id”:“16”,“jsonrpc”:“2.0”,“error”:{“code”:“-32600”,“message”:“Access denied”,“data”:},“result”:null}
INFO | jvm 1 | main | 2021/08/23 13:12:01.960 | INFO [hybrisHTTP12] [MagrabiEyeTestBookingFacadeImpl] response from simplybook is error : Access denied error Code :-32600
INFO | jvm 1 | main | 2021/08/23 13:12:01.960 | INFO [hybrisHTTP12] [BookingPageController] status in controller error : Access denied error Code :-32600

Dmytro Bondarev wrote:

getBookingStatus is admin API.
You have to use https://user-api.enterpriseappointments.com/admin URL and use Admin Authorization: API documentation | SimplyBook.me Online Scheduling.

Harleen Ahuja wrote:

Have used Admin Url as well but didnt work , and what is meant by admin authorization , do we need to set those as params?
or headers , currently i am sending companylogin and token

Dmytro Bondarev wrote:

Please see link that i sent you above. And this one: API documentation | SimplyBook.me Online Scheduling
You can find User/Admin API (Company administration service) authorization

Harleen Ahuja wrote:

Have read the doc and we are using username companylogin and password for authentication , still it says access denied , all the go i noticed that in the getBookingStatus api , it says that if the status plugin is not activated it will not work so i made a call to “isPluginActivated” api setting “status” as a parameter , so it returned false , that means plugin is not enabled so the api says access denied is that so? does that have something related to plugin?

Harleen Ahuja wrote:

Dmitry Bondarev wrote:

Please see link that i sent you above. And this one: API documentation | SimplyBook.me Online Scheduling
You can find User/Admin API (Company administration service) authorization

any idea about the status plugin stuff? is it mandatory for it to be enabled as stated in “getBookingStatus”
API link to that -:

Dmytro Bondarev wrote:

Yes, it is mandatory to enable status plugin.
If you have any issues please provide raw HTTP request with headers.

Harleen Ahuja wrote:

Dmitry Bondarev wrote:

Yes, it is mandatory to enable status plugin.
If you have any issues please provide raw HTTP request with headers.

getBooking status gives access denied below is raw http request headers -

Company LOgin is dxbdubaimall

Token is e00ebec4d7b74d8f48c6a742f76870a2931cb6dc925486c57aabb332474c3128

in headers we are sending companyLogin and Token recieved from admin url

|POST: [https://user-api.enterpriseappointments.com/admin]

request- {“jsonrpc”:“2.0”,“method”:“getBookingStatus”,“params”:{“params”:[“892”]},“id”:18}

response- {“error”:{“code”:-32600,“message”:“Access denied”,“data”:},“id”:“18”,“jsonrpc”:“2.0”}

Dmytro Bondarev wrote:

It seems that you are passing token in wrong header, please make sure you are passing it to X-User-Token.
I asked raw HTTP request to check it.

Harleen Ahuja wrote:

Dmitry Bondarev wrote:

It seems that you are passing token in wrong header, please make sure you are passing it to X-User-Token.
I asked raw HTTP request to check it.

Oh that X-User-Token worked Thanks , i was using X-Token