[#504] Company opening hours on website and API are different...

Migrated from Redmine #504 | Author: Sajid Shah
Status: New | Priority: Immediate, there is BUG! | Created: 2020-03-31


This is how my company opening hours looking on simplybook.me Screenshot by Lightshot
It’s available 07:00 - 23:00 every day.

However when i fetch the hours from API using getWorkDaysInfo(‘2020-03-30’, ‘2020-04-05’), this is what i get

2020-03-30: [
	{from: "08:55:00", to: "09:00:00"},
	{from: "10:30:00", to: "11:00:00"},
	{from: "13:25:00", to: "13:30:00"},
	{from: "14:00:00", to: "19:00:00"},
	{from: "19:25:00", to: "19:30:00"},
	{from: "19:55:00", to: "21:00:00"}
],
2020-03-31: [{from: "14:00:00", to: "20:00:00"}],
2020-04-01: [{from: "07:00:00", to: "23:00:00"}],
2020-04-02: [{from: "09:00:00", to: "20:00:00"}],
2020-04-03: [{from: "07:00:00", to: "23:00:00"}],
2020-04-04: [{from: "07:00:00", to: "23:00:00"}],
2020-04-05: [{from: "07:00:00", to: "23:00:00"}]

Now surprisingly when I tried using a second account it had monday messed up. Shouldn’t getWorkDaysInfo send me regular hours of my company when I pass only start and end date? What is going on here?

Thanks

Redmine Admin wrote:

it seems you have special work date settings on 2020-03-30
but we can’t check it without your company login and raw API http request

Sajid Shah wrote:

This is how my company special screen is looking: Screenshot by Lightshot
Nothing special setup for these dates…

Company subdomain is enkidsco
Request is sent to https://user-api.simplybook.me/admin

These are the json requests i could generate

validate		{"method":"getUserToken","params":["enkidsco","*****","*****"],"id":1}
Company	{"method":"getWorkDaysInfo","params":["2020-03-30","2020-04-05"],"id":1}
Get user		{"method":"getWorkDaysInfo","params":["2020-03-30","2020-04-05","18"],"id":2}

You think it can do it? or i can email you the logins
Thanks

Sajid Shah wrote:

Array
(
[http] => Array
(
[method] => POST
[header] => Content-type: application/json
[content] => {“method”:“getUserToken”,“params”:[“enkidsco”,““,””],“id”:1}
)

)
Array
(
    [http] => Array
        (
            [method] => POST
            [header] => Content-type: application/json
X-Company-Login: enkidsco
X-User-Token: 1726c2d5d22ac68d2ce3f7ea19d9008b3a73117870f6bce69172e213cfad4181

            [content] => {"method":"getWorkDaysInfo","params":["2020-03-30","2020-04-05"],"id":1}
        )

)
Array
(
    [http] => Array
        (
            [method] => POST
            [header] => Content-type: application/json
X-Company-Login: enkidsco
X-User-Token: 1726c2d5d22ac68d2ce3f7ea19d9008b3a73117870f6bce69172e213cfad4181

            [content] => {"method":"getWorkDaysInfo","params":["2020-03-30","2020-04-05","18"],"id":2}
        )

)

Sajid Shah wrote:

The issue is consistent, see below 2 weeks data from 2 different years.. Definitly I have NO special days setup, the data is same and not correct. I notice the company hours does change without us doing any thing. This is a very serious bug it’s stopping all our teachers from updating their availibility…

I am trying to get regular weekly hours of company EXACTLY THIS screen which is NOT affected by special days Screenshot by Lightshot : of course WITH break timings..
Based on this data, I will setup REGULAR weekly schedule for my service providers… EXACTLY LIKE THIS: Screenshot by Lightshot of course with breaktimes… If you can suggest something more reliable on this.

2021-01-04: [{from: "14:00:00", to: "19:00:00"}]
2021-01-05: [{from: "14:00:00", to: "20:00:00"}]
2021-01-06: [{from: "07:00:00", to: "23:00:00"}]
2021-01-07: [{from: "09:00:00", to: "20:00:00"}]
2021-01-08: [{from: "07:00:00", to: "23:00:00"}]
2021-01-09: [{from: "07:00:00", to: "23:00:00"}]
2021-01-10: [{from: "07:00:00", to: "23:00:00"}]

2020-01-06: [{from: "14:00:00", to: "19:00:00"}]
2020-01-07: [{from: "14:00:00", to: "20:00:00"}]
2020-01-08: [{from: "07:00:00", to: "23:00:00"}]
2020-01-09: [{from: "09:00:00", to: "20:00:00"}]
2020-01-10: [{from: "07:00:00", to: "23:00:00"}]
2020-01-11: [{from: "07:00:00", to: "23:00:00"}]
2020-01-12: [{from: "07:00:00", to: "23:00:00"}]

Redmine Admin wrote:

Hi,

From API documentation

getWorkDaysInfo ($from, $to, $unitId, $eventId, $count, $productIds)
Returns an information about working hours and break times for specified service and performer for a period
between two dates. If only service specified then information about performer (or performers) will be taken from

service configuration. Method returns a list of objects for each date in specified period. Count of objects in
list depends on break times. For example if performer works from 9:00 till 19:00 with one hour break at 13:00 method
returns:

This method will not provide company schedule if no performer id passed. It will calculate union schedule for all providers.

Sajid Shah wrote:

Hmm. I am not very clear with above explanation but if you can help me with this below please…

On simplybook.me, this is what I see
Company Weekly Schedule looks like this: Screenshot by Lightshot
Then the provider looks like this: Screenshot by Lightshot

Now this is regular time for every week. Nothing special is setup here… How can I get exact this data using your API?

Thank you

Redmine Admin wrote:

There is no way to get this data exactly by API. API can provide you available times by date which is intersaction of weekly and special day schedule.

Sajid Shah wrote:

Redmine Admin wrote:

There is no way to get this data exactly by API. API can provide you available times by date which is intersaction of weekly and special day schedule.

Does it return break time as well? How do i get it?

Redmine Admin wrote:

we do not provide full API to manage availability yet. So, there is no way to get breaktime settings. You can only get available slots/intervals using API.