Skip to content

Instantly share code, notes, and snippets.

@gabrielgilini
Created October 15, 2014 21:01
Show Gist options
  • Save gabrielgilini/71b4b7babcfd1819ed6f to your computer and use it in GitHub Desktop.
Save gabrielgilini/71b4b7babcfd1819ed6f 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:
{
"manager": {
"id": 1,
"first_name": "John",
"last_name": "Doe"
}
}
ManagersController#destroy
DELETE /api/v1/managers/{id}.json
In:
-
Out:
{
"manager": {
"id": 1,
"first_name": "John",
"last_name": "Doe"
}
}
AppointmentsController#index
GET /api/v1/appointments.json
In:
[optional] starts_at=yyyy-mm-ddThh:mm:ss[,yyyy-mm-ddThh:mm:ss] (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": [
{
"days_before": 0,
"send_at": "10:00 am"
},
{
"days_before": 1,
"send_at": "02:00 pm"
}
]
},
{
"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}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment