Booked Scheduler Community Support
December 14, 2018, 09:14:11 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Booked is proud to recommend Shift Capsule in the employee shift scheduling space www.ShiftCapsule.com
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: help with API - availableAt  (Read 845 times)
cbrherms
Newbie
*

Karma: 0
Posts: 4


« on: July 13, 2018, 02:13:03 PM »

Hi all!

I've written / mashed together a little php/html webpage that pulls in information regarding a specific schedule we have and plops it in to a table which displays which of our studios are free, when the next booking is, and if they aren't free right now then when the next free start time is.

Problem i've got though is that the returned "availableAt" value for a resource via the API shows the start time of a blocked time for today.
To explain it better, an example:
On a friday we have hourly slots between 9am and 5pm.
We are fully booked in one of our studios today. 2 bookings over the time periods of 0900-1300 and 1300-1700.
A user is unable to place a booking at 5pm as it is the start of the blocked time period (1700-0000).
YET....
a GetAvailability api call on this resource returns an availableAt value of today at 5pm, even when this is not bookable so should not be available......

Anyone else had this issue?
I'm still on 2.6.8 so i'm hoping it may be fixed in 2.7.1 but cannot test at the moment.
If it's not, I may have to see if there's any way I can modify the logic for this call.
Logged
lucap
Newbie
*

Karma: 0
Posts: 15


« Reply #1 on: July 16, 2018, 11:15:28 AM »

Hi
I am not sure if this is a bug or if we are missing something, but I have the same problem. Both on 2.6.8 and 2.7.1.
Here another user http://php.brickhost.com/forums/index.php?topic=15142.0.

When I call reservation API, the timezone is always +0000 in all fields.
However the API description says the timezone is the current timezone of the date parameter or the browser timezone.

I never asked on the forum but I resolve the issue with a little update to the logic, like this:

I changed line 61 in WebServices/Responses/ReservationItemResponse.php
from
$this->startDate = $reservationItemView->StartDate->ToIso();
to
$this->startDate = $reservationItemView->StartDate->ToTimezone($server->GetSession()->Timezone)->ToIso();

You can change it in every model you need it.

LucaP
Logged
cbrherms
Newbie
*

Karma: 0
Posts: 4


« Reply #2 on: July 20, 2018, 10:17:36 AM »

Sadly did not seem to change the availableAt response on a get availability call =/
Logged
lucap
Newbie
*

Karma: 0
Posts: 15


« Reply #3 on: July 23, 2018, 09:39:10 AM »

well...I misunderstood your question!
Maybe you expect to receive 0900 of the next day in your GetAvailability call...it is correct?

I will check my installations, both 2.6.8 and 2.7.1, and let you know...

LucaP
Logged
cbrherms
Newbie
*

Karma: 0
Posts: 4


« Reply #4 on: July 24, 2018, 09:24:52 AM »

No problem.
Apologies for my short reply too, i believe i'd not had enough coffee by that time on that day....
But yes, i'd expect a next availability call to show the first free slot the following day if all of todays were full and all that was left was blocked times.

I've yet to dig deeper in to the code that actually constructs the reply from this API, hoping it was a bug that was fixed between versions first....
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!