Authentication
To use the API, you must first authenticate with an admin or teacher account to get your API token.
Use basic auth to secure an API token like so:
curl -u EMAIL:PASSWORD https://www.transparentclassroom.com/api/v1/authenticate.json
That will return something like this:
{"id":4345,
"first_name":"API",
"last_name":"Test",
"email":"apitest@example.com",
"api_token":"abcdefghijklmnopqrst",
"roles":["parent", "teacher"],
"school_id":22}
You can use that "api_token" in all other requests by setting the "X-TransparentClassroomToken" header.
curl -H "X-TransparentClassroomToken: abcdefghijklmnopqrst" \
https://www.transparentclassroom.com/api/v1/classrooms.json
Headers
X-TransparentClassroomToken
Use the user's "api_token" (from the authenticate call above) in all other requests.
X-TransparentClassroomMasqueradeId
As an admin, you can act as another user by setting this header to the user's ID.
X-TransparentClassroomSchoolId
As a network admin, you can act on behalf of a school in your network by setting this header to the school's ID.
Paged Results
Many of our endpoints are paginated. If one is, it will respond to these two parameters:
Params |
- page (default: 1) Changing this will change the page of data you receive.
- per_page (default: 50) You know you are on the last page when you receive less than this number.
|
Activity: List
Method |
GET |
Url |
/api/v1/activity.json |
Params |
-
child_id or classroom_id (required) show observations / presentation / photos for child or
classroom
- only_photos (optional) defaults to false (true/false)
- only_portfolio (optional) defaults to false (true/false)
- date_start (optional) starting at this date (format: 2016-05-01)
- date_end (optional) on or before this date defaults to now (format: 2016-05-01)
|
Returns |
[
{"id":418008,
"html":"...",
"date":"2016-07-18",
"created_at":"2016-07-18T11:58:45.410-07:00",
"text":"I presented #PouringWater, #EaselPainting and cleaning, #LincolnLogs, and #RedRods to @MikaLightsmith ",
"author_id": 123},
...
]
|
Children: List
Method |
GET |
Url |
/api/v1/children.json |
Params |
- classroom_id (required for teachers, optional otherwise) filter by classroom
- session_id (optional) filter by session, uses current session if absent
- only_current (optional) filters out children who have left. defaults to false (true/false)
|
Returns |
[{
"id":5098,
"first_name":"Aavi",
"last_name":"Grey",
"birth_date":"2015-02-03",
"gender":"M",
"parent_ids":[25, 235],
"profile_photo": "https://...",
...
},{
"id":4323,
"first_name":"Abner",
"last_name":"Lucas",
"birth_date":"2008-08-02",
"gender":"M",
"profile_photo": "https://...",
...
},...]
(classroom_ids will be those the child was in during the specified session, or all if no session was
given.)
|
Children: Show
Method |
GET |
Url |
/api/v1/children/<child_id>.json |
Params |
- as_of (optional) if specified, shows child fields as of this date
|
Returns |
{
"id":5098,
"first_name":"Aavi",
"last_name":"Grey",
"birth_date":"2015-02-03",
"gender":"M",
"profile_photo": "https://..."'
"program": "Full Day",
"ethnicity": ["Latino"],
"household_income": "low",
"dominant_language": "English",
"grade": "3rd",
"student_id": "12345",
"hours_string": "9:00AM - 5:00PM M,W,F",
"allergies": "Eggs, Milk",
"notes": "This is a note",
"first_day": "2017-09-03",
"last_day": "2019-12-18",
"exit_notes": "They will be continuing at another Montessori School.",
"exit_reason": "relocated",
"exit_survey_id": 12345,
"parent_ids":[25, 235],
"classroom_ids":[1,2,3]
}
(classroom_ids will be those the child was in during the specified session, or all if no session was
given.)
|
Children: Update
Method |
PUT |
Url |
/api/v1/children/<child_id>.json |
Params |
- first_name (optional)
- last_name (optional)
- birth_date (optional)
- gender (optional)
- program (optional)
- ethnicity (optional) array
- household_income (optional) very_low, low, medium, or high
- dominant_language (optional)
- grade (optional)
- student_id (optional)
- hours_string (optional) needs to be in the form: "8:00AM(9:00AM) - 5:00PM M-F"
- allergies (optional)
- approved_adults_string (optional)
- emergency_contacts_string (optional)
- notes (optional)
|
Classrooms: List
Method |
GET |
Url |
/api/v1/classrooms.json |
Params |
- show_inactive (optional) if present, will show inactive classrooms for admins
|
Returns |
[
{"id":42, "name":"Primary", "lesson_set_id": 128, "level": "1-3", "active": true},
{"id":43, "name":"Elementary", "lesson_set_id": 256, "level": "6-9", "active": true},
]
|
Conference Reports: List
Method |
GET |
Url |
/api/v1/conference_reports.json |
Params |
- child_id (optional) filter by child
- created_after (optional) only show reports created after date (format: 2016-05-01)
- created_before (optional) only show reports created before date (format: 2016-04-01)
|
Returns |
[{
"id": 238871,
"name": "Elementary (6-12) Fall Report",
"child_id": 1234,
"data": [{
"id": 1,
"data": {},
"type": "ReportTitle",
"title": "Elementary Outcomes Report",
"created_at":"2016-07-18T11:58:45.410-07:00",
...
}]
|
Events: Show (Daily Tracking)
Method |
GET |
Url |
/api/v1/events.json |
Params |
- child_id (required) show events (nap, attendance, etc) for child
- date_start (required) starting at this date (format: 2016-04-01)
- date_end (required) on or before this date (format: 2016-05-01)
|
Returns |
[
{"id":55,
"classroom_id":22,
"child_id":9425,
"event_type":"toileting",
"value":"Wet",
"created_by_id":438,
"value2":"Refused",
"created_by_name":"MichaelSmith",
"time":"2016-07-14T10:09:33-06:00"},
{"id":66,
"classroom_id":22,
"child_id":9425,
"event_type":"toileting",
"value":"Wet",
"created_by_id":438,
"value2":"Sat + Dry",
"created_by_name":"Michael Smith",
"time":"2016-07-14T13:05:32-06:00"},
...
]
|
Forms: List
Method |
GET |
Url |
/api/v1/forms.json |
Params |
- form_template_id (optional) filter by form type
- child_id (optional) filter by child
- created_before (optional) filter to only form responses created before a certain date
- created_after (optional) filter to only form responses created after a certain date
|
Returns |
[
{"id":1212,"child_id":333,"fields":{"Classroom":["Marigold"],"Student Name.first":"Ginni","Student Name.last":"Worr","Photo and Documentation Release ":["yes, yes, and yes"],"Parent Name":"Cam Worr","Signature":"Cam Worr on 16 agosto 2016"},"state":"accepted","created_at":"2016-08-16T11:48:05.003-07:00","form_template_id":1},
{"id":4141,"child_id":5555,"fields":{"Classroom":["Sunflower"],"Student Name.first":"Tanner ","Student Name.last":"Garland","Photo and Documentation Release ":["yes, yes, and yes"],"Parent Name":"Marie Garland","Signature":"Marie Garland on December 16, 2016"},"state":"submitted","created_at":"2016-12-06T13:00:42.247-08:00","form_template_id":1}
]
|
Forms: Show
Method |
GET |
Url |
/api/v1/forms/<form_id>.json |
Returns |
{"id":7974,"child_id":9734,"fields":{"Campus":["Sunflower"],"Student Name.first":"Tanner ","Student Name.last":"Garland","Photo and Documentation Release ":["yes, yes, and yes"],"Parent Name":"Marie Garland","Signature":"Marie Garland on December 16, 2016"},"state":"submitted","created_at":"2016-12-06T13:00:42.247-08:00","form_template_id":1}
|
Form Templates: List
Method |
GET |
Url |
/api/v1/form_templates.json |
Returns |
[{"id":1212, "name": "Application Form", "widgets": [{"type":"Select", "title":"Program", "values":["Half-day","Full-day"], "goes_to":"application.program" },{"type":"EmbeddedForm","embedded_form_id":9876}]}, ...]
|
Lesson Sets: Show
Method |
GET |
Url |
/api/v1/lesson_sets/<id>.json |
Params |
- format (optional) long will include photos and descriptions, defaults to short (long | short)
|
Returns |
{"id":141,"name":"Toddler","children":[
{"id":12362,"name":"Practical Life","children":[
{"id":12363,"name":"Care of the Indoor Environment","lessons":[
{"id":64202,"name":"Wiping and Drying a Table","lesson_type":"masterable"},
{"id":64203,"name":"Washing a Table","lesson_type":"masterable"},
{"id":64206,"name":"Mopping","lesson_type":"masterable"}]}]}
...
]}
|
Levels: Show All
Method |
GET |
Url |
/api/v1/levels.json |
Params |
- child_id (required) show levels for child.
- lesson_set_id (optional) filter by lessons in lesson set.
|
Returns |
[
{"child_id":5098,"lesson_id":64216,"planned":true},
{"child_id":5098,"lesson_id":64248,"planned":true},
...
]
|
Levels: Show With Dates
Method |
GET |
Url |
/api/v1/levels/by_date.json |
Params |
- child_id (required) show levels for child
- date_start (required) starting at this date (format: 2016-04-01)
- date_end (required) on or before this date (format: 2016-05-01)
|
Returns |
[
{"proficiency":1,"date":"2016-04-08","child_id":4344,"lesson_id":87935},
{"proficiency":1,"date":"2016-04-08","child_id":4344,"lesson_id":132740},
...
]
|
Online Applications: List
Method |
GET |
Url |
/api/v1/online_applications.json |
Params |
-
created_at (optional)
return applications after this date/time
|
Returns |
[
{id:1460,state:"submitted",first_name:"Test",last_name:"Child",created_at:"2016-02-16T09:53:44.684-08:00"},
...
]
|
Online Applications: Show
Method |
GET |
Url |
/api/v1/online_applications/<id>>.json |
Returns |
{
type:"online_application",
id:1460,
school_id:14,
state:"submitted",
fields:{
program:"Primary (3-6y): Morning (8:30a-12:30p)",
child_name.first":"Test",
child_name.last":"Child",
child_birth_date:"1/1/2012",
child_gender:"M",
mother_email:"pappa@example.com",
session_id:625,
...
}
}
|
Online Applications: Submit
Method |
POST |
Url |
/api/v1/online_applications.json |
Params |
-
fields (required)
hash of the name / value pairs that make up the form. For example:
{
session: 52,
program: "Full Day",
child_name.first: "Billy",
child_name.last: "Bob",
child_birth_date: "5/1/2012",
child_gender: "M",
mother_name.first: "Laura",
...
}
-
template_id (optional) application template to use if school has more than one.
-
silence_notifications (Boolean) whether to mute the email notification that the application was created.
|
Returns |
{id: 52}
The id of the new application.
|
Online Applications: Accept & Create Child (and Parents)
Changes state of application to "Accepted", creates a child, assigns child to classroom, and
attaches application to child.
Method |
POST |
Url |
/api/v1/online_applications/<id>/accept_application.json |
Params |
- classroom_id (required) classroom to which child will be added
|
Returns |
{child_id: 82}
The id of the new child.
|
Schools: List
Shows all schools to which a user has access. If the user is a network admin, this will be all schools
in the network.
Method |
GET |
Url |
/api/v1/schools.json |
Returns |
[
{"id": 5, "name": "myNetwork", "phone": "+0987654321", "address": "123 S East St, Seattle, WA 98105" "type": "Network", "time_zone": "Pacific Time (US & Canada)"},
{"id": 9, "name": "mySchool", "phone": "+1234567890", "address": "123 N West St, Oakland, CA 94609", "type": "School", "time_zone": "Pacific Time (US & Canada)"}
]
|
Sessions: List
Shows all sessions for the school, ordered by start date in descending order. Must be an admin to access this
endpoint.
Method |
GET |
Url |
/api/v1/sessions.json |
Returns |
[
{"id": 1, "name": "Summer 2017", "start_date": "2017-06-01", "stop_date": "2017-08-31", children: 0, current: false, inactive: false }
{"id": 1, "name": "2016-17", "start_date": "2016-09-01", "stop_date": "2017-05-31", children: 42, current: false, inactive: false },
]
|
Users: List
Method |
GET |
Url |
/api/v1/users.json |
Params |
-
classroom_id
(required for teachers) the classroom ID to list users
-
roles[]
(optional) returns users matching any roles provided (teacher, parent, admin, billing_manager, family_member)
|
Returns |
[
{"type":"user","id":42,"inactive":false,"email":"andrew@example.com","first_name":"Andrew","last_name":"Smith","users":["admin","teacher"],
{"type":"user","id":1,"inactive":false,"email":"jeremy@example.com","first_name":"Jeremy","last_name":"Lightsmith","roles":["parent"]},
...
]
|
Users: Show
Method |
GET |
Url |
/api/v1/users/<id>.json |
Returns |
{
"type":"user",
"id":42,
"inactive":false,
"email":"andrew@example.com",
"first_name":"Andrew",
"last_name":"Smith",
"roles":["admin", "teacher"],
"accessible_classroom_ids":[42, 13],
"default_classroom_id":42,
"address":"123 1st St\nSeattle, WA 98177",
"home_number":"111-1111",
"mobile_number":"222-2222",
"work_number":"333-3333"
}
|