[#694] Two rest calls give me trouble

Migrated from Redmine #694 | Author: Marco Deppe
Status: Feedback | Priority: High, I’m very impatient | Created: 2021-05-05


Hello,
could I please get your help one more time?

Below are 4 different calls. 2 work fine, 2 don’t.

  1. Can you tell me why I can’t logout?
  2. Can you tell me why I don’t get available appointments for today? Is that a timezone issue (we are in PST and that’s how our calendar is also set)?

Thanks!
Marco

Auth works
$ curl -d '{"company":"bartellcentral","login":"test@example.com","password":"testing0987"}' -H "Content-Type: application/json" https://user-api-v2.simplybook.pro/admin/auth
{"token":"8ad76f6ab0a6850292db3f844568e815a39f3e85326c8faa18711c09d0610c1e","company":"bartellcentral","login":"automation@example.com","refresh_token":"415eec9957d6b04609f4cebef1a34d7d3888d1227d5fb29a3835dbbdb1e0073d","domain":"simplybook.pro","require2fa":false,"allowed2fa_providers":[],"auth_session_id":"","id":null}

Logoff doesn't work
$ curl -d '{"auth_token":  "8ad76f6ab0a6850292db3f844568e815a39f3e85326c8faa18711c09d0610c1e"}' -H "Content-Type: application/json" https://user-api-v2.simplybook.me/admin/auth/logout
{"code":401,"message":"Unauthorized","data":[],"message_data":[]}

Available slots for today always empty
$ curl -H "Content-Type: application/json" -H "X-Company-Login: bartellcentral" -H "X-Token: 8ad76f6ab0a6850292db3f844568e815a39f3e85326c8faa18711c09d0610c1e" "https://user-api-v2.simplybook.pro/admin/schedule/available-slots?date=2021-05-05&provider_id=1&service_id=3"
[]

Available slots for tomorrow works
$ curl -H "Content-Type: application/json" -H "X-Company-Login: bartellcentral" -H "X-Token: 8ad76f6ab0a6850292db3f844568e815a39f3e85326c8faa18711c09d0610c1e" "https://user-api-v2.simplybook.pro/admin/schedule/available-slots?date=2021-05-06&provider_id=1&service_id=3"
[{"id":"2021-05-06 09:30:00","date":"2021-05-06","time":"09:30:00"},{"id":"2021-05-06 09:45:00","date":"2021-05-06","time":"09:45:00"},{"id":"2021-05-06 10:15:00","date":"2021-05-06","time":"10:15:00"},{"id":"2021-05-06 10:30:00","date":"2021-05-06","time":"10:30:00"},{"id":"2021-05-06 10:45:00","date":"2021-05-06","time":"10:45:00"},{"id":"2021-05-06 11:00:00","date":"2021-05-06","time":"11:00:00"},{"id":"2021-05-06 11:15:00","date":"2021-05-06","time":"11:15:00"},{"id":"2021-05-06 11:30:00","date":"2021-05-06","time":"11:30:00"},{"id":"2021-05-06 11:45:00","date":"2021-05-06","time":"11:45:00"},{"id":"2021-05-06 13:00:00","date":"2021-05-06","time":"13:00:00"},{"id":"2021-05-06 13:15:00","date":"2021-05-06","time":"13:15:00"},{"id":"2021-05-06 13:30:00","date":"2021-05-06","time":"13:30:00"},{"id":"2021-05-06 13:45:00","date":"2021-05-06","time":"13:45:00"},{"id":"2021-05-06 14:00:00","date":"2021-05-06","time":"14:00:00"},{"id":"2021-05-06 14:15:00","date":"2021-05-06","time":"14:15:00"},{"id":"2021-05-06 14:30:00","date":"2021-05-06","time":"14:30:00"},{"id":"2021-05-06 14:45:00","date":"2021-05-06","time":"14:45:00"},{"id":"2021-05-06 15:00:00","date":"2021-05-06","time":"15:00:00"}]

Redmine Admin wrote:

  1. you can always delete auth token from device to logout
  2. It seems you have min time before booking set to 24 hours or something like that

Dmytro Bondarev wrote:

Headers:

X-Company-Login: {{ company }}
X-Token: {{ token }}

are required for logout

Marco Deppe wrote:

Dmitry Bondarev, Company is NOT in the documentation.

Marco Deppe wrote:

Redmine Admin wrote:

  1. It seems you have min time before booking set to 24 hours or something like that
    Yes, we do - thanks for the explanation!

Dmytro Bondarev wrote:

Sorry for that we will update documentation.
All operations require token and company headers, except login.