[#103] issue with "book" ('https://user-api.simplybook.me/admin' enpoint)

Migrated from Redmine #103 | Author: Ihor Bokatov
Status: Rejected | Priority: High, I’m very impatient | Created: 2018-02-01


There is still have an issue with “book” (‘https://user-api.simplybook.me/admin’ enpoint)

“getReservedTime” method with parameters:
{“jsonrpc”:“2.0”,“method”:“getReservedTime”,“params”:[‘2018-02-12’, ‘2018-02-12’, 2, 12],“id”:3}
returned
{
“events”: ,
“type”: “reserved_time”,
“dd”:
},

“getReservedTime” method with parameters:
{“jsonrpc”:“2.0”,“method”:“getWorkDaysInfo”,“params”:[‘2018-02-12’, ‘2018-02-12’, 2,12],“id”:3}
returned:
{
“2018-02-12”: [
{
“from”: “05:00:00”,
“to”: “24:00:00”
}
]
},

“book” method with parameters:
{“jsonrpc”:“2.0”,“method”:“book”,“params”: [2, 12, 1, 2018-02-12, 16:00:00, 2018-02-12, 17:15:00, 0, {“0db3e7523ba2ad3424742eb1f56826c4”:“Bernhardt Jensens Bouleveard 89, st tv”}],“id”:7}
returned
{id=7, error={code=-32054, data=, message=Selected time start is not available}, jsonrpc=2.0}

Can you please help me to check why “Selected time start is not available” if it is working time and there is no reserved time for this day
(Company name: “RaskRask.dk”, email: “info@raskrask.dk”)

Dmytro Bondarev wrote:

Please pass full raw request.

Ihor Bokatov wrote:

I use Google Apps Script to access the API so it looks like this:

{headers={charset=UTF-8, X-User-Token=xxx, Accept=application/json, X-Company-Login=raskrask}, method=post, payload={“jsonrpc”:“2.0”,“method”:“book”,“params”:[2,12,1,“2018-02-12”,“16:00:00”,“2018-02-12”,“17:15:00”,0,{“0db3e7523ba2ad3424742eb1f56826c4”:“Bernhardt Jensens Bouleveard 89, st tv”}],“id”:7}, followRedirects=true, validateHttpsCertificates=true, useIntranet=false, contentType=application/json;charset=utf-8, url=https://user-api.simplybook.me/admin}

Dmytro Bondarev wrote:

Your provider does not have free time on 2018-02-12.

Ihor Bokatov wrote:

The same via “Postman”

POST /admin HTTP/1.1
Host: user-api.simplybook.me
Content-Type: application/json
Accept: application/json
charset: UTF-8
X-User-Token: xxx
X-Company-Login: raskrask
Cache-Control: no-cache

{
“jsonrpc”:“2.0”,
“method”:“book”,
“params”:[
2,
12,
1,
“2018-02-12”,
“16:00:00”,
“2018-02-12”,
“17:15:00”,
0,
{
“0db3e7523ba2ad3424742eb1f56826c4”:“Bernhardt Jensens Bouleveard 89, st tv”
}
],
“id”:7
}

Result the same:
{“error”:{“code”:-32054,“message”:“Selected time start is not available”,“data”:},“id”:“7”,“jsonrpc”:“2.0”}

Redmine Admin wrote:

You passing “2018-02-12” but your provider HAS NOT SLOTS this day.

Ihor Bokatov wrote:

“Your provider does not have free time on 2018-02-12.”

But there are no reserved time for this date according to “getReservedTime”…

Redmine Admin wrote:

time is not reserved. He just do not work at this day. Check your schedule

Ihor Bokatov wrote:

There is no custom “Service provider schedule” or custom “Service provider’s special days” for this provider (id 12)
So the schedule have to be the same as for the company (every day “from”: “05:00:00”,“to”: “24:00:00” ).

Plus “getWorkDaysInfo” {“jsonrpc”:“2.0”,“method”:“getWorkDaysInfo”,“params”:[‘2018-02-12’, ‘2018-02-12’, 2,12],“id”:3} return
{
“2018-02-12”: [ {
“from”: “05:00:00”,
“to”: “24:00:00”
}
]
},

Dmytro Bondarev wrote:

You passed wrong parameters to getWorkDaysInfo