Skip to content

Instantly share code, notes, and snippets.

@karthickraji
Last active September 1, 2015 14:19
Show Gist options
  • Save karthickraji/b9f79baa9f05bf9c1d43 to your computer and use it in GitHub Desktop.
Save karthickraji/b9f79baa9f05bf9c1d43 to your computer and use it in GitHub Desktop.
PCA Teaher Api

PCA Teacher Api

Authentication

###Sign In #####1.Request: Post #####2.URL: http://128.199.112.162/api/v1/teacher/signin #####3.Params: email : password : device_id : #####4.Response:

         {
           "status": true,
           "message": "Signed in Successfully",
           "user_id": 5,
           "user_role": "teacher"
         }

####Set Token: #####i)set token: Url: http://128.199.112.162/api/v1/teacher/device_id/set_token #####ii)Request: Get #####iii)params: token_id,os_type #####4.Response:

         {
           "status": true,
           "message": "Token Set Successfully"
         }

###Sign Out #####1.Request: Get #####2.URL: http://128.199.112.162/api/v1/teacher/signout #####3.Params: device_id : #####4.Response:

         {
           "status": true,
           "message": "Signed Out Successfully"
         }

###Daily Report ####1.Create a Daily Report #####i)Request: Post #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/reports/create #####iii)Params: reports [ on,category,child_id, media, published, general_info [ id, fun_from, fun_to, slept_from, slept_to,book_name, book_author, supplies, note,report_id, _destroy ], whats_on_the_menu [id, am_snack, lunch, pm_snack, am_category,lunch_category,pm_category,report_id, _destroy ], basic_info [id, responsible, arrival, slept_at, woke_at, bowel_movement, sleep_status, sleeping_hours,comments, ate_night, slept, ate_morning, night_foods, last_fed, last_fed_amount,brought, report_id, reason, _destroy ], today_activity [id, played, outside, also, comments, reminders,favourite, special, need, report_id, _destroy ], feedings [ id, bottles_and_solids, time, amount, comments, initials, report_id, _destroy ], diapering_and_toilets [id, done_at, diaper_status, cream_applied, comments, initials, on_the_toilet, report_id, _destroy ], sleepings [ id, asleep, awake, comments, initials, report_id, _destroy ], report_medias [{ attachment => [] }, report_id, _destroy] ] #####iv)Response: { "status": "Success", "message": "Daily Report Created" } ####2.Update a Daily Report #####i)Request: Put #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/reports/update #####iii)params: report_id and reports [ on,category,child_id, media, published, general_info [ id, fun_from, fun_to, slept_from, slept_to,book_name, book_author, supplies, note,report_id, _destroy ], whats_on_the_menu [id, am_snack, lunch, pm_snack, am_category,lunch_category,pm_category,report_id, _destroy ], basic_info [id, responsible, arrival, slept_at, woke_at, bowel_movement, sleep_status, sleeping_hours,comments, ate_night, slept, ate_morning, night_foods, last_fed, last_fed_amount,brought, report_id, reason, _destroy ], today_activity [id, played, outside, also, comments, reminders,favourite, special, need, report_id, _destroy ], feedings [ id, bottles_and_solids, time, amount, comments, initials, report_id, _destroy ], diapering_and_toilets [id, done_at, diaper_status, cream_applied, comments, initials, on_the_toilet, report_id, _destroy ], sleepings [ id, asleep, awake, comments, initials, report_id, _destroy ], report_medias [{ attachment => [] }, report_id, _destroy] ] #####iv)Response: { "status": "Success", "message": "Daily Report Updated" } ####3.Edit & Index & Show a Daily Report #####i)Request: Get #####ii)URL: Infant: http://128.199.112.162/api/v1/teacher/device_id/reports/infant_report_show Two Year: http://128.199.112.162/api/v1/teacher/device_id/reports/two_year_report_show Four Year: http://128.199.112.162/api/v1/teacher/device_id/reports/four_year_report_show #####iii)Params: Infant & Two Year & Four Year: report_id ####4.Publish and Unpublish a Daily Report #####i)Request: Post #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/reports/pusblish_or_unpublish #####iii)Params: report_id #####iv)Response: { "status": "Success", "message": "Daily Report Published" } ####5.Delete a Daily Report #####i)Request: Delete #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/reports/delete #####iii)Params: report_id #####iv)Response: { "status": "Success", "message": "Daily Report Deleted" } ####6.Infants Children List #####i)Request: Get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/reports/infants #####iii)Response: [ { "id": 47, "first_name": "Sample", "middle_name": "Sample", "last_name": "Sample", "name_to_call": "Sample", "child_address": "Sample", "gender": "Male", "date_of_birth": "2013-02-24T00:00:00.000Z", "student_stage": "Infant", "allow_photo": true, "day_care_id": 1, "created_at": "2015-05-13T08:21:12.951Z", "updated_at": "2015-05-13T08:21:12.951Z", "guardian_id": null, "parent_id": null, "image_file_name": "10603600_1492097274401334_6691062308797789910_n.jpg", "image_content_type": "image/jpeg", "image_file_size": 26054, "image_updated_at": "2015-05-13T08:21:12.051Z", "activated": true, "allergic_to": "", "medical_info": "Sample", "apartment": "sample", "city": "sample", "state": "sample", "zipcode": 93489489, "allergic": false, "is_split_fees": false } ] ####7.Two Years Children List(Toddlers & EarlyLearners) #####i)Request: Get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/reports/two_years #####iii)Response: [ { "id": 14, "first_name": "Jarrod", "middle_name": "Everett", "last_name": "Altenwerth", "name_to_call": "Colin Schoen", "child_address": "12816 Jennie Summit", "gender": "female", "date_of_birth": "2015-01-15T00:00:00.000Z", "student_stage": "EarlyLearners", "allow_photo": null, "day_care_id": 1, "created_at": "2015-04-15T09:27:44.533Z", "updated_at": "2015-05-12T14:30:22.122Z", "guardian_id": null, "parent_id": null, "image_file_name": null, "image_content_type": null, "image_file_size": null, "image_updated_at": null, "activated": true, "allergic_to": "", "medical_info": "", "apartment": "", "city": "Chennai", "state": "Tn", "zipcode": 90450, "allergic": null, "is_split_fees": true } ] ####8.Four Years Children List(PreSchool & PreKindergarten) #####i)Request: Get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/reports/four_years #####iii)Response: [ { "id": 6, "first_name": "Annabell", "middle_name": "Rudy", "last_name": "Borer", "name_to_call": "Alison Zieme", "child_address": "59221 Natalie Turnpike", "gender": "male", "date_of_birth": "2015-01-15T09:27:44.513Z", "student_stage": "PreKindergarten", "allow_photo": null, "day_care_id": 1, "created_at": "2015-04-15T09:27:44.510Z", "updated_at": "2015-04-15T10:02:43.275Z", "guardian_id": null, "parent_id": null, "image_file_name": null, "image_content_type": null, "image_file_size": null, "image_updated_at": null, "activated": true, "allergic_to": null, "medical_info": null, "apartment": null, "city": null, "state": null, "zipcode": null, "allergic": null, "is_split_fees": false } ] ####9.All Infant Daily Reports #####i)Request: get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/reports/infant_daily_reports ####10.All Two Year Daily Reports #####i)Request: get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/reports/two_year_daily_reports ####11.All Four Year Daily Reports #####i)Request: get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/reports/four_year_daily_reports ####12.Rebuild Reports #####i)Request: post #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/reports/rebuild_reports #####iii)Params: child_id ###Weekly Report ####1.Create a Weekly Report #####i)Request: Post #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/weekly_summaries/create #####iii)Params: weekly_summary[from_date, to_date, child_id, comment, media, week_type,published, report_medias [ { attachment => [] }, weekly_summary_id, _destroy ] ] #####iv)Response: { "status": "Success", "message": "Weekly Report Created" } ####2.Update a Weekly Report #####i)Request: Put #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/weekly_summaries/update #####iii)params: weekly_summary_id and weekly_summary[from_date, to_date, child_id, comment, media, week_type,published, report_medias [ { attachment => [] }, weekly_summary_id, _destroy ] ] #####iv)Response: { "status": "Success", "message": "Weekly Report Updated" } ####3.Edit & Index & Show a Weekly Report #####i)Request: Get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/weekly_summaries/show #####iii)Params: weekly_summary_id #####iv)Response: ####4.Publish and Unpublish a Weekly Report #####i)Request: Postabove all incident_reports params. #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/weekly_summaries/pusblish_or_unpublish #####iii)Params: weekly_summary_id #####iv)Response: { "status": "Success", "message": "Weekly Report Published" } ####5.Delete a Weekly Report #####i)Request: Delete #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/weekly_summaries/delete #####iii)Params: weekly_summary_id #####iv)Response: { "status": "Success", "message": "Weekly Report Deleted" } ####6.All Infant Weekly Reports #####i)Request: get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/weekly_summaries/infant_weekly_summaries ####7.All Two Year Weekly Reports #####i)Request: get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/weekly_summaries/two_year_weekly_summaries ####8.All Four Year Weekly Reports #####i)Request: get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/weekly_summaries/four_year_weekly_summaries ####9.Rebuild Weekly Reports #####i)Request: post #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/weekly_summaries/rebuild_weekly_summaries #####iii)Params: child_id ####10.Children List: #####i)Request: Get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/weekly_summaries/children_list ###Incident Report ####1.Create a Incident Report #####i)Request: Post #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/incident_reports/create #####iii)Params: incident_report [on, teacher, accident, health, published, behavior, description, incident_place, place_description, witness, child_id, accident_incidents [id, description, part_of_body_injuried, ems_911, ice_applied, washed, bandaid_applied, other_first_aid_applied, additional_comments, parent_notified, notified_description, time_notified, incident_report_id ], health_incidents [id, description, runny_nose, vomiting, stomachache, headache, trouble_breathing, bruising, diarrhea, rash, sore_throat, earache, bad_coughing, itching, child_temperature, time_temperature_was_taken, additional_comments, parent_notified, notified_description, time_notified, incident_report_id ], behavioral_incidents [id, description, child_seperated_from_class, child_redirected, request_parent_to_pick_child_up, request_conference_with_parent, teacher_comments, parent_notified, notified_description, time_notified, incident_report_id ], report_medias [ { attachment => [] }, incident_report_id ] ] #####iv)Response: { "status": "Success", "message": "Incident Report Created" } ####2.Update a Incident Report #####i)Request: Put #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/incident_reports/update #####iii)params: incident_report_id and incident_report [on, teacher, accident, health, published, behavior, description, incident_place, place_description, witness, child_id, accident_incidents [id, description, part_of_body_injuried, ems_911, ice_applied, washed, bandaid_applied, other_first_aid_applied, additional_comments, parent_notified, notified_description, time_notified, incident_report_id ], health_incidents [id, description, runny_nose, vomiting, stomachache, headache, trouble_breathing, bruising, diarrhea, rash, sore_throat, earache, bad_coughing, itching, child_temperature, time_temperature_was_taken, additional_comments, parent_notified, notified_description, time_notified, incident_report_id ], behavioral_incidents [id, description, child_seperated_from_class, child_redirected, request_parent_to_pick_child_up, request_conference_with_parent, teacher_comments, parent_notified, notified_description, time_notified, incident_report_id ], report_medias [ { attachment => [] }, incident_report_id ] ] #####iv)Response: { "status": "Success", "message": "Incident Report Updated" } ####3.Edit & Index & Show a Incident Report #####i)Request: Get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/incident_reports/show #####iii)Params: incident_report_id #####iv)Response: ####4.Publish and Unpublish a Incident Report #####i)Request: Post #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/incident_reports/pusblish_or_unpublish #####iii)Params: incident_report_id #####iv)Response: { "status": "Success", "message": "Incident Report Published" } ####5.Delete a Incident Report #####i)Request: Delete #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/incident_reports/delete #####iii)Params: incident_report_id #####iv)Response: { "status": "Success", "message": "Incident Report Deleted" } ####6.All Infant Incident Reports #####i)Request: get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/incident_reports/infant_incident_reports ####7.All Two Year Incident Reports #####i)Request: get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/incident_reports/two_year_incident_reports ####8.All Four Year Incident Reports #####i)Request: get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/incident_reports/four_year_incident_reports ####9.Rebuild Incident Reports #####i)Request: post #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/incident_reports/rebuild_incident_reports #####iii)Params: child_id ####10.Children List: #####i)Request: Get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/incident_reports/children_list

Message

  1. All staffs are chat with parents.
  2. Chat between two or more staffs with same conversation.
  3. Director and

Calendar Api: This Api similar to parents calendar api

####1.Get Events based on start time,end time,event type,classroom #####i)Request: Get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/calendar #####iii)Params(all params are optional): starttime,endtime,event_type,classroom #####iv) Response: { "status": true, "fullcalendar_engine_events": [ { "id": 1, "title": "test", "starttime": 1433834100, "endtime": 1433835000, "all_day": false, "description": "test", "untildate": 1433808000, "event_type": "Activity", "classroom": "Pre-kindergarten", "day_care_id": 1, "created_at": 1433835499, "updated_at": 1433835499 }, { "id": 4, "title": "test", "starttime": 1441112400, "endtime": 1441116900, "all_day": true, "description": "test", "untildate": 1441152000, "event_type": "Activity", "classroom": "Toddlers", "day_care_id": 1, "created_at": 1441116598, "updated_at": 1441116598 }, { "id": 5, "title": "test", "starttime": 1441198800, "endtime": 1441203300, "all_day": true, "description": "test", "untildate": 1441152000, "event_type": "Activity", "classroom": "Toddlers", "day_care_id": 1, "created_at": 1441116598, "updated_at": 1441116598 } ] } ####2.Get a event based on event id #####i)Request: Get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/calendarevent #####iii)Params: event_id #####iv) Response: { "status": true, "event": { "id": 2, "title": "test", "starttime": 1440140400, "endtime": 1440141300, "all_day": false, "description": "tset", "untildate": 1440201600, "event_type": "Schedule", "classroom": "DayCare", "day_care_id": 1, "created_at": 1440170551, "updated_at": 1440170551 } } ####3.Calendar sync implemented like in parent calendar api. #####i)Request: Get #####ii)URL: http://128.199.112.162/api/v1/teacher/device_id/calendarsync #####iii)Params: last_synced #####iv) Response: { "status": true, "fullcalendar_engine_events": [ { "id": 2, "title": "test", "all_day": false, "description": "tset", "classroom": "DayCare", "starttime": 1440140400, "endtime": 1440141300 }, { "id": 3, "title": "test", "all_day": false, "description": "tset", "classroom": "DayCare", "starttime": 1440226800, "endtime": 1440227700 }, { "id": 4, "title": "test", "all_day": true, "description": "test", "classroom": "Toddlers", "starttime": 1441112400, "endtime": 1441116900 }, { "id": 5, "title": "test", "all_day": true, "description": "test", "classroom": "Toddlers", "starttime": 1441198800, "endtime": 1441203300 } ] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment