[#1169] getStartTimeMatrix returns wrong Start time

Migrated from Redmine #1169 | Author: Ngoc Phung
Status: Rejected | Priority: High, I’m very impatient | Created: 2024-02-19


Our account url https://magnettest3.secure.simplybook.pro/

I have unit id 1 and 7 having schedule/ bookings like this (pls check url attached for the image) Screenshot by Lightshot

When trying to use SBM function getStartTimeMatrix to get the Start time of UnitId 1 and 7 for date 2024-03-08, service id 12 , below data is returned

“2024-03-08”: [
“08:00:00”,
“10:00:00”,
“11:30:00”,
“14:00:00”,
“15:30:00”,
“17:00:00”,
“18:30:00”
]

You could notice that the start time generated after 11:30:00 is 14:00:00 but not 13:00:00.

However, when looking at SBM admin ui calendar of those providers, I don’t see any reason why 13:00:00 is unavailable.

Pls advise why Start time 13:00:00 was not generated

Redmine Admin wrote:

hi, what is result of API documentation | SimplyBook.me Online Scheduling
better to use this method because it is docummented and supported.

getStartTimeMatrix - is low level method we do not support officially

Ngoc Phung wrote:

getAvailableTimeIntervals will return start time/ end time for each unitId, but I want to have the data to reflect the combination of all provided unitId’s availability. I couldnt see any other api beside getStartTimeMatrix that could serve out purpose. Or is there any other api could do that?

Val Komarov wrote:

Could you please provide the full request you are making?

Ngoc Phung wrote:

POST https://user-api.simplybook.pro
Content-Type: application/json
X-Company-Login: magnettest3
X-Token: ***

{
“jsonrpc”: “2.0”,
“method”: “getStartTimeMatrix”,
“params”: [“2024-03-08”, “2024-03-08”, 12, [1, 7], 1],
“id”: “1234”
}

Val Komarov wrote:

This happens due to optimizations: we do not combine working time of every provider, but instead combine their available slots skipping the improper ones.
Please use this method only with one provider given

Ngoc Phung wrote:

what do you mean by ‘improper one’? Can I ask, in my example, how exactly 13:00:00 is considered as improper to be skipped?
Also, do you have any other endpoint that could provide the combination of multiple providers’ availability? Since we have several providers under a same location, we need to have the combination, but not availability of a single provider.

Val Komarov wrote:

You don’t have any slot at 13:00

One provider has these:

array (
      0 => '10:00:00',
      1 => '11:30:00',
      2 => '15:00:00',
      3 => '16:30:00',
    ),

The other one these:

array (
      0 => '08:00:00',
      1 => '11:00:00',
      2 => '12:30:00',
      3 => '14:00:00',
      4 => '15:30:00',
      5 => '17:00:00',
      6 => '18:30:00',
    ),

Val Komarov wrote:

Seems we do not have such method for several providers in the meaning you require.
The closest way is to get the schedule of both, then combine it, and split by service duration.

Ngoc Phung wrote:

So, the start time is not generated by increment of duration, but only take the proper one for the lists of start time of each provider?
Like, I expect if the first start time is 10:00, the 2nd will be 11:30 then 13:00 then 14:30 and so on. But seems like it will only look into the list of each provider, and get the time that is proper?