-
Notifications
You must be signed in to change notification settings - Fork 0
Appointments
Vadim Sokoltsov edited this page Apr 19, 2017
·
1 revision
Creates new appointment for direction
-
direction_id- type:integer- direction's id - REQUIRED -
date- type:datetime (with timezone)- appointment's date - REQUIRED -
repeats- type:string- flag for appointment scheduling - REQUIRED -
message- type:string- text for appointment -
available- type:boolean- flag for appointment's availability
-
direction- type:json- direction's object -
date- type:datetime (with timezone)- appointment's date -
repeats- type:string- flag for appointment scheduling -
message- type:string- text for appointment -
available- type:boolean- flag for appointment's availability -
created_at- type:datetime (with timezone)- appointment's date of creation
- direction_id -
Can't be blank - date -
Can't be blank,Cannot be in the past - repeats -
Can't be blank
POST /api/v1/appointments HTTP/1.1
Host: dockerhost:3000
Content-Type: application/json
uprogresstoken: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MX0.DeefNqb69orzcJu8RIq9ClD4ZPTOF1R6yC1ABiBB6BY
Cache-Control: no-cache
{
"appointment": {
"date": "2017-04-21 12:00:00",
"direction_id": "315",
"repeats": "every_day"
}
}{
"appointment": {
"id": 15,
"message": null,
"date": "2017-04-21T12:00:00.000Z",
"created_at": "2017-04-19T22:42:27.741Z",
"repeats": "every_day",
"available": null,
"direction": {
"id": 315,
"title": "Sonsing",
"description": "Try to quantify the HDD microchip, maybe it will compress the back-end transmitter!",
"finished_steps_count": 2,
"percents_result": 40,
"updated_at": "2017-04-10T10:45:14.264Z",
"slug": "zathin"
}
}
}{
"errors": {
"direction_id": [
"can't be blank"
],
"date": [
"can't be blank"
],
"repeats": [
"can't be blank"
]
}
}Updates existent appointment
-
direction_id- type:integer- direction's id - REQUIRED -
date- type:datetime (with timezone)- appointment's date - REQUIRED -
repeats- type:string- flag for appointment scheduling - REQUIRED -
message- type:string- text for appointment -
available- type:boolean- flag for appointment's availability
-
direction- type:json- direction's object -
date- type:datetime (with timezone)- appointment's date -
repeats- type:string- flag for appointment scheduling -
message- type:string- text for appointment -
available- type:boolean- flag for appointment's availability -
created_at- type:datetime (with timezone)- appointment's date of creation
- direction_id -
Can't be blank - date -
Can't be blank,Cannot be in the past - repeats -
Can't be blank
POST /api/v1/appointments/15 HTTP/1.1
Host: dockerhost:3000
Content-Type: application/json
uprogresstoken: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MX0.DeefNqb69orzcJu8RIq9ClD4ZPTOF1R6yC1ABiBB6BY
Cache-Control: no-cache
{
"appointment": {
"date": "2017-04-21 12:00:00",
"direction_id": "315",
"repeats": "every_day"
}
}{
"appointment": {
"id": 15,
"message": null,
"date": "2017-04-21T12:00:00.000Z",
"created_at": "2017-04-19T22:42:27.741Z",
"repeats": "every_day",
"available": null,
"direction": {
"id": 315,
"title": "Sonsing",
"description": "Try to quantify the HDD microchip, maybe it will compress the back-end transmitter!",
"finished_steps_count": 2,
"percents_result": 40,
"updated_at": "2017-04-10T10:45:14.264Z",
"slug": "zathin"
}
}
}{
"errors": {
"direction_id": [
"can't be blank"
],
"date": [
"can't be blank"
],
"repeats": [
"can't be blank"
]
}
}Deletes appointment
DELETE /api/v1/appointments/15 HTTP/1.1
Host: dockerhost:3000
Content-Type: application/json
uprogresstoken: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MX0.DeefNqb69orzcJu8RIq9ClD4ZPTOF1R6yC1ABiBB6BY
Cache-Control: no-cache
{
"appointment": {
"id": 15,
"message": null,
"date": "2017-04-21T12:00:00.000Z",
"created_at": "2017-04-19T22:42:27.741Z",
"repeats": "every_day",
"available": null,
"direction": {
"id": 315,
"title": "Sonsing",
"description": "Try to quantify the HDD microchip, maybe it will compress the back-end transmitter!",
"finished_steps_count": 2,
"percents_result": 40,
"updated_at": "2017-04-10T10:45:14.264Z",
"slug": "zathin"
}
}
}