AvailableTimeSlots API

Retrieve the available timeslots

GET /api/v1/groups/:group_id/availabletimeslots?\
                intervention_ids[]=:intervention_id&\
                calendar_id=:calendar_id&\
                start=:start&\
                apikey=:apikey
Parameter Type Description
group_id integer Group identifier
intervention_ids array of integers Service identifiers
calendarset_ids array of integers (optional) List of selected category of calendars identifiers
calendar_id integer Calendar identifier, or empty if 'No preference'
calendar_ids array of integers (optional) List of selected calendar identifiers
resource_id integer (optional) Filter availabilities according to an identifier of agenda resource
start datetime Start date and time of the available timeslots algorithm
end datetime End date and time of the available timeslots algorithm
nDays integer Number of days after start for the available timeslots algorithm (cannot be used with end)
cal_qty integer (optionall) Filter availabilities which has given minimum number of agendas (default = 1)
min_capacity integer (optionnel) Filter availabilities which has given minimum capacity of appointements (par défaut=1)

If the "end" parameter is not specified, the result will be the availability of the "start" period + 7 days.


Response format


Parameter Type Description
group_id integer Group identifier
firstSlot datetime First available timeslot
intervention_ids array of integers Service identifiers
calendar_id integer Calendar identifier, or empty if 'No preference'
calendar_ids array of integers List of calendar identifiers
availabletimeslots array List of available timeslots, each timeslot contain a date of start (start), capacity of appointements (capacity) and concerned agendas (calendar_ids) for this timeslot

Example of request

$ curl "https://sandbox.clicrdv.com/api/v1/groups/4/availabletimeslots.json?apikey=xxxxxx&\
               intervention_ids[]=1026&\
               cal_qty=3&\"

Example of response

{
  "group_id":4,
  "firstSlot":"2017-02-28 11:35:00",
  "calendar_id":null,
  "calendar_ids":[314681,314682,627149,314683],
  "intervention_ids":[1026],
  "availabletimeslots":[
    {"start":"2017-02-28 11:35:00","capacity":2,"calendar_ids":[314681,314682,627149]},
    {"start":"2017-02-28 12:15:00","capacity":1,"calendar_ids":[627149]},
    ...
    {"start":"2017-03-06 21:50:00","capacity":1,"calendar_ids":[627149]}
  ]
}