[#669] Have activated API Token custom feature in our simplybook.vip site, but saying ‘invalid token’ when connecting to API

Migrated from Redmine #669 | Author: Michelle Thomas
Status: Closed | Priority: High, I’m very impatient | Created: 2021-03-22


I’ve activated the API custom feature in our simplybook.vip site and retrieved both API Token & Private Key.
When trying to connect to the API on the Appointment booking service and free online booking service site with our company name and API Token, i get the following error:
{
“code”: -32000,
“message”: “Wrong API key”
}

I need assistance in connecting to the API asap, and make sure that we’re connecting to the API correctly considering we’re on the “simplybook.vip” site and not a “simplybook.me” site as we are setup on a cluster structure.

Redmine Admin wrote:

what is your booking site url?

Michelle Thomas wrote:

Booking site URL is michaelhillau.simplybook.vip

Michelle Thomas wrote:

We can now run Get AUTH token method using https://user-api.simplybook.vip/login endpoint ..

Response from getToken
StatusCode : 200
StatusDescription : OK
Content : {“result”:“f8012f77483fd16eb25626d53f2635abc2592de9e9a0f415ce4ca43bb74####”,“id”:“7d3c2276-64b5-4eb7-bf93-7abef552###”,“jsonrpc”:“2.0”}
RawContent : HTTP/1.1 200 OK

Using details from getAuth set X-Company-Login and X-Token variable in theory we should be able to call methods to download data that we require… but we get error ACCESS DENIED ;-

Response from getClientList method
StatusCode : 200
StatusDescription : OK
Content : {“error”:{“code”:-32600,“message”:“Access denied”,“data”:},“id”:“2”,“jsonrpc”:“2.0”}
RawContent : HTTP/1.1 200 OK

Asked Aaron to HELP and he still gets same error message … copy examples from API documentation | SimplyBook.me Online Scheduling but all fail .. with error Access denied

Are you able to please advise??

Michelle Thomas wrote:

Michelle Thomas wrote:

We can now run Get AUTH token method using https://user-api.simplybook.vip/login endpoint ..

Response from getToken
StatusCode : 200
StatusDescription : OK
Content : {“result”:“f8012f77483fd16eb25626d53f2635abc2592de9e9a0f415ce4ca43########”,“id”:“7d3c2276-64b5-4eb7-bf93-7abe#######”,“jsonrpc”:“2.0”}
RawContent : HTTP/1.1 200 OK

Using details from getAuth set X-Company-Login and X-Token variable in theory we should be able to call methods to download data that we require… but we get error ACCESS DENIED ;-

Response from getClientList method
StatusCode : 200
StatusDescription : OK
Content : {“error”:{“code”:-32600,“message”:“Access denied”,“data”:},“id”:“2”,“jsonrpc”:“2.0”}
RawContent : HTTP/1.1 200 OK

Asked Aaron to HELP and he still gets same error message … copy examples from API documentation | SimplyBook.me Online Scheduling but all fail .. with error Access denied

Are you able to please advise??

Redmine Admin wrote:

you need to use User/Admin API not client API you are trying to use for that
Please check docs here API documentation | SimplyBook.me Online Scheduling

Michelle Thomas wrote:

We are still getting access denied when using client/Admin API, it only works when we used the client API which is not sufficient. If there is no other suggestions can we have a meeting arranged to have this issue fixed please?

Redmine Admin wrote:

Please follow instructions by link above. There are examples for all APIs

Michelle Thomas wrote:

Hi,

Can we get auth token for admin api using API Key? The only example in your docs you shared above is using login/password

Example from docs

POST https://user-api-v2.simplybook.me/admin/auth
Content-Type: application/json

{
“company”: “”,
“login”: “”,
“password”: “”
}

Michelle Thomas wrote:

Michelle Thomas wrote:

Hi,

Can we get auth token for admin api using API Key? The only example in your docs you shared above is using login/password

Example from docs

POST https://user-api-v2.simplybook.me/admin/auth
Content-Type: application/json

{
“company”: “”,
“login”: “”,
“password”: “”
}

Want to reiterate that we are vip customer. Does this change the url we need to target?

Dmytro Bondarev wrote:

You have to use user credentials to get admin token.
You have to use https://user-api-v2.simplybook.vip/admin/auth url.