[#660] Slot booking issue

Fayaz Ahamed PA wrote:

In the sample website, we are able to get slots for both providers, so whenever a user books its automatically picks one of the provider and booking the slot. But the API allowing us to send only one provider ID. Following is the request that we send.

Fayaz Ahamed PA wrote:

URL:https://user-api.simplybook.me/
METHOD: POST
BODY: {“jsonrpc”:“2.0”,“method”:“getStartTimeMatrix”,“params”:[“2021-04-16”,“2021-04-16”,5,1,1,null,[4]],“id”:1}

Dmytro Bondarev wrote:

Hi! Feel free to pas array or providers:
[“2021-04-16”,“2021-04-16”,5,[1,2,3,4],1,null,[4]]

Fayaz Ahamed PA wrote:

At first, thank you for the response. I have tried to get slots for the service with multiple providers,
It responded with slots but how would I get slots for each provider.

URL: https://user-api-v2.simplybook.me/admin/schedule/available-slots?date=2021-04-20&service_id=5&provider_id=1,2
METHOD: GET
RESPONSE: [
{
“id”: “2021-04-20 10:00:00”,
“date”: “2021-04-20”,
“time”: “10:00:00”
},
{
“id”: “2021-04-20 13:00:00”,
“date”: “2021-04-20”,
“time”: “13:00:00”
}
]

Redmine Admin wrote:

the only way to get it is to call this method for each provider

Fayaz Ahamed PA wrote:

In sample website, provider is not passed separately but we can able to book the same slots with different providers.

Fayaz Ahamed PA wrote:

Redmine Admin wrote:

there is only 2 options with API: get available slots per list of providers and get slots just per one provider. If you need not merged slots per many providers then you need to call method above with different provider id many times

Fayaz Ahamed PA wrote:

We tried getting available slots for both providers in our system by sending them in an array and we also get available slots
@/api/schedule/available-slots?service_id=2&date=2021-04-24&provider_id=1,2@

We pick 23 Apr as the date and book a time 7 AM (returned in API response), we again try 23 Apr as the date, but the 7 AM slot is not returned by API, it should return, right? because the other provider is available at that time and we send the provider ID in the request.

Dmytro Bondarev wrote:

It is not clear what method you are using.
Here Bug #660: Slot booking issue - API - Simplybook.me support for developers you mentioned JSON RPC API,
and then you mentioned REST API.

In case you use REST API you have to use correct GET params to pass array for example provider_id=1&provider_id=2 , provider_id=1,2 - incorrect format.

I am closing this thread. Please make separate ticket for each issue.