POST /api/v1/groups/:group_id/appointments?apikey=xxxxxx
{
"appointment": {
"date": "2016-01-18 10:30:00",
"calendar_id": 15,
"intervention_ids": [21],
"comments": "",
"fiche": {
"id": 48,
"group_id": 4,
"firstphone": "06 12 34 56 78"
}
}
}
| Field | Type | Description |
|---|---|---|
| fiche | object | Customer Data - If this object contains the id attribute, it will update the existing customer with the other given attributes. Otherwise, a new customer will be created with the attributes.Refer to the Fiche resource for more information. |
| date | datetime | Date and time of the appointment ( ex: 2010-01-22 15:00:00 ) |
| intervention_ids | array of integers | Array of services (interventions) identifiers |
| calendar_id | integer | (optional) Calendar identifier. If this parameter is not specified, an agenda will be assigned randomly from those available. |
| comments | text | (optional) User comments for this appointment |
| websource | string (255) | (optional) "Source" of the appointment ( ex: "our iPhone application" ). Used for statistics only. |
| from_web | boolean | (optional) "Origin" of the appointment ( ex: 1 if the appointment is taken from an web page and 0 if taken from the backend ). Used for statistics and display. If this parameter is not specified, from_web = 1 |
The HTTP code 201 is sent if the creation succeeded. If an error occured, a 400 code is returned, with one of the following error codes :
| Numerical Code | Code | Message |
| 6 | MaxRdvNumber | The user has reached the maximum number of upcoming appointments |
| 7 | MintimeBetween | Another appointment is too close to this one |
| 8 | MaxRdvPeriod | This appointment is too far away |
| 9 | MintimeRdv | This appointment is too soon |
| NotAvailable | This time slot is not available anymore | |
| 11 | EmailAlreadyExists | This email address is already user by another registered user. |
| 12 | SameTimeRdv | The user already has an appointment at this time |
| 13 | EmailNotFound | This email address does not exists. |
GET /api/v1/groups/:group_id/appointments
Important:
By default, only future appointments are returned.
To get past events too, add the parameter include_past=1
In the API return, is located the state of appointment. There is represented asstate=1.
The corresponding values for this parameter are : 0 = In progress, 1 = Came, 2 = Not Came, 3 = Pending.
Beyond the standard HTTP error codes, this methods can return specific error codes :
| Numerical Code | Code | Message |
| 1 | Unauthorized | You are not granted for this action. |
| 2 | InvalidParameter | Parameters are not valid. |
| 3 | NoResult | No Results. |
| 4 | ServerError | Server Error not identified. |
| 5 | LoginFailed | Authentification failed. |
DELETE /api/v1/groups/:group_id/appointments/:id
Beyond the standard HTTP error codes, this methods can return specific error codes :
| Numerical Code | Code | Message |
| 10 | MintimeAnnulation | This appointment is too close to be cancelled |