Calendar API

Retrieve the calendars of a group

GET /api/v1/groups/:group_id/calendars

Retrieve the calendars on which a service is available

GET /api/v1/groups/:group_id/calendars?intervention_ids[]=:intervention_id

It is also possible to ask the API for calendars associated with several services as the intervention_ids parameter is a "list", e.g. to ask for interventions with ids 21 and 23, use the following query string: ?intervention_ids[]=21&intervention_ids[]=23

List calendars of a calendarset

GET /api/v1/groups/:group_id/calendars?calendarset_ids[]=:calendarset_id

It is also possible to ask the API for calendars associated to many calendarset as the calendarset_ids is a "list", e.g. to ask for calendarset with ids 8 et 12, use the following query string : ?calendarset_ids[]=8&calendarset_ids[]=12

Create a calendar

POST /api/v1/groups/:group_id/calendars?apikey=xxxxxx
{
   "calendar": {
      "group_id": 4,
      "name": "Calendrier de test"
   }
}

Update a calendar

PUT /api/v1/groups/:group_id/calendars/:calendar_id?apikey=xxxxxx
{
   "calendar": {
      "publicname": "Calendar available on Internet"
   }
}

Delete a calendar

DELETE /api/v1/groups/:group_id/calendars/:calendar_id

This operation does not remove the calendar completely! It will change the value of the deleted attribute to true. The calendar can be restored later on:

PUT /api/v1/groups/:group_id/calendars/:calendar_id?apikey=xxxxxx
{
   "calendar": {
      "deleted": false
   }
}

Standard fields:

Field Type Description
group_id integer Group identifier
calendarset_id integer (optional) Calendarset identifier (if any calendar set)
name string(255) Name of the calendar
address string(255) (optional) Address of the calendar, if different from the group's.
zipcode string(16) (optional) Zipcode of the calendar, if different from the group's.
city string(64) (optional) City of the calendar, if different from the group's.
sort integer (optional) Integer to specify the order of the calendars when displayed in the pro interface and the appointment module.

Fields for appointments on the client module:

Field Type Description
publicname string(255) Name as shown on the appointment module. Important If blank, the calendar will not be available on the appointment module.
generate_interval integer Generation interval for the available timeslots on the appointment module (Example: with a value of 15, available timeslots will be generated every 15 minutes on the appointment module: 09:00 / 09:15 / 09:30 a.s.o … ) (default: 15)
mintime_rdv integer Minimum delay (in minutes) before which no available timeslot will be proposed on the appointment module (Example: for a minimum of 3 days before the appointment; on January the 7th, 2010 your clients can make an appointment for January the 10th, 2010 and the days after). Important To allow your clients to make appointments at the last moment before the appointment, the value must be set to 0. (default: 0)
maxrdv_period integer Maximum delay (in minutes) after which no available timeslot will be proposed on the appointment module (Example: up to 1 year before appointment; on January the 10th, 2009 your clients can make an appointment until January the 10th, 2010. The following days will not be proposed on the appointment module.). To allow your clients to make appointments at the last moment before the appointment, the value must be set to 0. (default: 131400 minutes, equals to 3 months)
mintime_annulation integer Minimum delay (in minutes) before which no appointment can be cancelled online via the appointment module. (Example: for a value of 4 days before the appointment, one should compute a value of 4 days x 24 hours x 60 minutes = 5760 minutes) (default: 2880, equals to 2 days)