[#427] How to use the private API key?

Migrated from Redmine #427 | Author: Anonymous
Status: New | Priority: High, I’m very impatient | Created: 2019-09-20


Hi, I find it difficult to translate the PHP example in User API guide - User API guide - SimplyBook.me into a JSON RPC payload.

Can you give an example of a JSON RPC payload with the private key is included?

I’m sending this JSON RPC request:
{“jsonrpc”:“2.0”,“method”:“getBookings”,“params”:[{“code”:“kzor234”},{“my_hidden_private_key”:“value1”}],“id”:1568974847104}

But I receive this response: “code”: -32600,
“message”: “Access denied”,

Redmine Admin wrote:

private key is only needed to confirm payments. For the rest methods you need API key

Anonymous wrote:

Thanks. What’s the proper way to call getBookings?

Anonymous wrote:

I now receive [ { “error”: { “code”: -32600, “message”: “Access denied”, “data”: null }, “id”: “1568977123640”, “jsonrpc”: “2.0” } ], even though I’m using the same API key that works on other resources.

Anonymous wrote:

It seems that I have to use a User Token API documentation | SimplyBook.me Online Scheduling

Redmine Admin wrote:

You can try this API Explorer with your company login and API token API documentation | SimplyBook.me Online Scheduling
It can help to see which requests needs to be sent

Anonymous wrote:

The API Explorer does not seem to include an example of an admin method invocation.

I’m now calling the getBookings method with a token that I received from getUserToken, but I still receive “code”: -32600, “message”: “Access denied”.

Any suggestions on what should I look into next?

Anonymous wrote:

My problem was that I sent the header X-Token instead of X-User-Token.