[#387] Accessing minimum/maximum allowed time before service booking settings via API

Migrated from Redmine #387 | Author: Andy Butland
Status: Closed | Priority: Normal | Created: 2019-05-24


There are a couple of company level settings: Minimum allowed time before service booking and Maximum allowed time before service booking.

I’d like to retrieve these via the API, but can’t find the right method to call - getCompanyInfo() doesn’t have it.

Could you advise please what method I need to call to get this information back?

Thanks

Andy

Redmine Admin wrote:

Hi, currently changing this settings via API is not allowed.

Redmine Admin wrote:

Can you please tell how you going to use this? Normally such settings are set during registration and not changed very often.

Andy Butland wrote:

I’ve already got some logic calling the API to generate a set of “sessions” - basically instances of a service at given times. So for example, if I’ve got a 60 minute service, available between 14:00 and 18:00 I’m generating 4 sessions for display on a website.

I’d like to indicate which sessions are bookable. Say I set 2 hours as the “minimum allowed time before service booking” and the user is browsing at 13:00. In that case, the first session wouldn’t be bookable, but the following three would be.

I don’t need to change these settings via the API - just read them.

Additionally - I’ll also need I think the timezone (already found from getCompanyTimezoneOffset) and the date format setting. If you could advise where I can read the date format too, that would be useful.

Thanks

Redmine Admin wrote:

you can call this method Company public service methods - Company public service methods - SimplyBook.me
to get bookable slots. It will take in account all settings, existing bookings, google calendar busy slots

Andy Butland wrote:

OK, I’m doing that, but unless I’m missing something I’m getting back available time slots that are earlier in the day.

For example requesting (at 14:40 UK time):

{“jsonppc”:“2.0”,“method”:“getAvailableTimeIntervals”,“params”:[“2019-05-24”,“2020-05-24”,3,[4]],“id”:“1474652f-89be-4a3e-9cd7-bfc0f2424738”}

Is returning:

{
“result”:{
“2019-05-24”:{
“4”:[
{
“from”:“09:00:00”,
“to”:“13:00:00”
}
]
},

},
“id”:“1474652f-89be-4a3e-9cd7-bfc0f2424738”
}

I’m on testsubsystem1.secure.electroluxbookings.com if you need to check any settings.

Redmine Admin wrote:

you need to check company timezone in settings

Andy Butland wrote:

Timezone is set to Europe/London.

Redmine Admin wrote:

ok, yes, please use this one Company public service methods - Company public service methods - SimplyBook.me

Redmine Admin wrote:

actually getAvailableTimeIntervals should also work. Please provide raw http request for investigation

Andy Butland wrote:

See comment #5. Is there more I can usefully provide here?

Redmine Admin wrote:

yes, we also need headers to see company login

Redmine Admin wrote:

btw, this function is limited to provide data for max 30 days. Please do not call it for 1 year interval

Andy Butland wrote:

Method: POST, RequestUri: ‘/’, Version: 2.0, Headers:
{
X-Company-Login: testsubsystem1
X-Token: 2ecf9fa51ef81f289d9f8f74020dcd08a1b9b33683fed721d92eeb1d3e4acaf8
Content-Type: application/json; charset=utf-8
}

Content: {“jsonppc”:“2.0”,“method”:“getAvailableTimeIntervals”,“params”:[“2019-05-24”,“2020-05-24”,3,[4]],“id”:“1474652f-89be-4a3e-9cd7-bfc0f2424738”}

Redmine Admin wrote:

which API endpoint you have?

Redmine Admin wrote:

getAvailableTimeIntervals do not take in account min/max time before booking and current time
getStartTimeMatrix taking in account min/max time before booking and current time

Andy Butland wrote:

I’m calling https://user-api.enterpriseappointments.com

Andy Butland wrote:

Just going back to my original question too - is it possible to retrieve these values via the API? If so, I could do the filtering myself and continue using getAvailableTimeIntervals

Redmine Admin wrote:

No, it is currently not possible

Redmine Admin wrote:

This method can be added on request. You may discuss it directly with Ingvar@simplybook.me