Skip to content

Instantly share code, notes, and snippets.

@gabrielgilini
Created October 17, 2014 19:06
Show Gist options
  • Save gabrielgilini/fb3e286bd9e35b3dfdae to your computer and use it in GitHub Desktop.
Save gabrielgilini/fb3e286bd9e35b3dfdae to your computer and use it in GitHub Desktop.
ManagersController#index
GET /api/v1/managers.json
In:
-
Out:
{
"managers": [
{"id": 1, "first_name": "John", "last_name": "Doe"},
{"id": 2, "first_name": "Jane", "last_name": "Doe"}
],
"meta": {"next_page": null}
}
ManagersController#create
POST /api/v1/managers.json
In:
{
"user_id": null,
"first_name": "John",
"last_name": "Doe"
}
* If user_id is not set, creates a Doctor with given name
Out:
{
"managers": {
"id": 1,
"first_name": "John",
"last_name": "Doe"
}
}
ManagersController#destroy
DELETE /api/v1/managers/{id}.json
In:
-
Out:
{
"managers": {
"id": 1,
"first_name": "John",
"last_name": "Doe"
}
}
AppointmentsController#index
GET /api/v1/appointments.json
In:
[optional] starts_at=yyyy-mm-dd[,yyyy-mm-dd] (accepts date range or single date)
[optional] patient_name="John"
[optional] manager_id=1
Out:
{
"appointments": [
{
"id": 1,
"user_id": 42,
"manager_id": null,
"medical_record_number": "0000003347",
"address": "Some address",
"phone": "5555555555",
"starts_at": "2014-10-15T12:00:00",
"attended": false,
"state": "active",
"type": "voice",
"duration": 120,
"template_id": null,
"rsvp": "No Answer",
"reminders": [
{
"id": 1
"length": 0,
"state": "completed",
"immediate": true,
"rsvp": true,
"content_text": {
"English": "Content in english",
"Spanish": "Content in spanish"
},
"send_date": nil
},
{
"id": 2,
"length": 1,
"state": "active",
"immediate": false,
"rsvp": false,
"content_text": {
"English": "Content in english",
"Spanish": "Content in spanish"
},
"send_date": "2015-08-12T09:00:00+04:00"
}
]
},
{
"id": 2,
"user_id": 84,
"manager_id": null,
"medical_record_number": "0000003347",
"starts_at": "2014-10-17T10:00:00",
"attended": false,
"state": "active",
"type": "sms",
"duration": 60,
"template_id": 2,
"rsvp": "Going"
}
],
"meta": {"next_page": null}
}
AppointmentTemplatesController#index
GET /api/v1/appointments/templates.json
In:
-
Out:
{
"appointment_templates": [
{
"id": 1,
"title": "My Appointment Template",
"duration": 60,
"reminders": [
{
"id": 1,
"length": 1,
"state": "active",
"immediate": false,
"rsvp": true,
"content_text": {
"English": "Content in english",
"Spanish": "Content in spanish"
},
"send_date": "2015-08-12T09:00:00+04:00"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment