[#296] unclear API throwing "Signature error" on getBooking

Migrated from Redmine #296 | Author: Kay Bucksch
Status: New | Priority: High, I’m very impatient | Created: 2018-11-30


Hello,

currently I am struggling using the API “getBooking”.

I was able to understand the login mechanism therefore I have successfully get a token. But since I am using Kotlin to access your API from documentation point of view its totally unclear how to access the API.

As far as I have seen I need to request: https://user-api.simplybook.me/
I am doing so with the following JSON:

{
  "id" : 293,
  "sign" : "c0c958aa8f95fef439...",
  "jsonrpc" : "2.0",
  "method" : "getBooking",
  "params" : [ 293, "c0c958aa8f95fef439..." ]
}

I would expect this is working since I build the sign as described here: API documentation | SimplyBook.me Online Scheduling

my code to build the MD5 is like: DigestUtils.md5Hex(“$bookingId$bookingHash$apiKey”) → sure its kotlin but at least the string conctination is the same as PHP. So is there any difference in generating md5 or is there an unknown secret?

Redmine Admin wrote:

Are you able to call any other function, e.g. this one API documentation | SimplyBook.me Online Scheduling
?

Kay Bucksch wrote:

Not sure which parameters to pass to get a result but I am getting at least HTTP 200 code even if response is empty.

Redmine Admin wrote:

Please provide your raw http request and response you got

Kay Bucksch wrote:

Okay finally I was able to get a result. The reason is somehow related to readings but perhaps a hint for improving the documentation.

I did not get that I need to use the “secret API key” to pass to the md5 function instead of the “normal” api key. therefore the hashed string was wrong. So your API gave me the right response and everythign is working great.

But as I said as a suggestion of improvement it would be great having this more understandable in the documentation. This will save all of us a lot of time.

Thanks for your help