[#567] Adding a comment to the booking

Migrated from Redmine #567 | Author: Luke Lewandowski
Status: New | Priority: Normal | Created: 2020-09-07


Hi all,

I’m trying to get Zoom integration working with the Simply Book Me through Zapier.

So far so good, I was able to get most of it done through Zapier. However, I still want to get the Zoom link being added as a comment to the booking itself.

I have identified following methods that I will need in order to get the comment added for a booking.

  1. Call getUserToken in order to authenticate.
  2. Call getBookings or getBooking << – this is where I run into issues.
  3. Add a comment to the booking with a Zoom URL.
curl --request POST \
  --url https://user-api.simplybook.me/login \
  --header 'content-type: application/json' \
  --header 'x-company-login: babyologyexperts' \
  --header 'x-token: f95959a2d02695efe82da29e2eaf51554a7cdf0bf22bf007babd92245b286f34' \
  --data '{
	"jsonrpc": "2.0",
	"method": "getUserToken",
	"params": [
		"mycompanylogin",
		"admin",
		"super-secret"
	],
	"id": 1
}'

I get a good response from that and I can use the token.

curl --request POST \
  --url https://user-api.simplybook.me/admin \
  --header 'content-type: application/json' \
  --header 'x-company-login: mycompanylogin' \
  --header 'x-token: 22116f7e9085a41f9e959237aad303c27d29a2bdc3ad290c6ea5a85dd2175515' \
  --data '{
	"jsonrpc": "2.0",
	"method": "getBookings",
	"params": [],
	"id": 1
}'

I use the token that was returned. However I keep getting

{
  "error": {
    "code": -32600,
    "message": "Access denied",
    "data": []
  },
  "id": "1",
  "jsonrpc": "2.0"
}

Any ideas what I’m doing wrong?

Redmine Admin wrote:

Please follow this docs API documentation | SimplyBook.me Online Scheduling
you should pass ‘X-User-Token’ for Admin API

Luke Lewandowski wrote:

Ok, that’s amazing that has worked. However, I’m not getting. I thought that according to JSONRPC 2.0 you can omit the parameters. JSON-RPC 2.0 Specification - can you confirm?

{
  "error": {
    "code": -32011,
    "message": "Params is not array",
    "data": []
  },
  "id": "1",
  "jsonrpc": "2.0"
}
curl --request POST \
  --url https://user-api.simplybook.me/admin \
  --header 'content-type: application/json' \
  --header 'x-company-login: mycompanylogin' \
  --header 'x-user-token: 22116f7e9085a41f9e959237aad303c27d29a2bdc3ad290c6ea5a85dd2175515' \
  --data '{
	"jsonrpc": "2.0",
	"method": "getBookings",
	"id": 1
}'

Redmine Admin wrote:

you need to pass an array of soem search params there

Luke Lewandowski wrote:

Yup. Got it all working. Thank you for all your help!