[#664] API Error

Migrated from Redmine #664 | Author: Can Cevik
Status: Feedback | Priority: High, I’m very impatient | Created: 2021-03-18


Dear support team, currently we receive this error on the API we receive for MAGRABI;

INFO [hybrisHTTP1] [MagrabiSimplyBookApiServiceImpl] SIMPLY_BOOK-API |PUT: [https://user-api.enterpriseappointments.com/admin/bookings/124124]
INFO [hybrisHTTP1] [MagrabiSimplyBookApiServiceImpl] {“jsonrpc”:“2.0”,“method”:“book”,“params”:[“1”,“1”,“2021-03-22”,“11:30:00”,{“name”:“Harleen ahuja",“email”:"harleen.ahuja90@hybris.com”,“phone”:“7060309479”}],“id”:16}
INFO [hybrisHTTP1] [MagrabiSimplyBookApiServiceImpl] SIMPLY_BOOK-API |[com.itelligence.magrabi.model.simplybook.response.BookingResponse]
INFO [hybrisHTTP1] [MagrabiSimplyBookApiServiceImpl] {“id”:“16”,“jsonrpc”:“2.0”,“error”:{“code”:“-32600”,“message”:“Access denied”,“data”:},“result”:null}
ERROR [hybrisHTTP1] [MagrabiEyeTestBookingFacadeImpl] java.lang.Exception: Access denied

It looks like it works fine for booking, but for cancel and reschedule it responses as “access denied” . Can you check the issue ?

Dmytro Bondarev wrote:

Please check Role of this user.

Can Cevik wrote:

Which user ? i don’t understand the solution

Redmine Admin wrote:

You are calling API with some user credentials and his access level is used. please contact our live help if have any questions.

Can Cevik wrote:

https://user-api.enterpriseappointments.com/admin/bookings/{bookingId}when we use this we are getting access denied, but when we use this according to latest documentation
https://user-api-v2.simplybook.me/admin/bookings/{bookingId}, it gives 404

Redmine Admin wrote:

it means you are passign id which does not exists

Dmytro Bondarev wrote:

When you use JSON -RPC API you must use https://user-api.enterpriseappointments.com/admin URL.
Do not add /bookings/124124 part. It is not REST API.

Can Cevik wrote:

Can we ask how to append booking id, which one has to cancel. you are are saying that not to append the bookings/124124, then how it can send the info that which booking has to be cancelled

Dmytro Bondarev wrote:

If you are using JSON-RPC API then just pass booking id as parameter. ( API documentation | SimplyBook.me Online Scheduling )
If you want to use REST API then yes, you must pass it in URL part. ( API documentation | SimplyBook.me Online Scheduling )

But do not mix 2 types of API.