Skip to content

Instantly share code, notes, and snippets.

@nandha-dev
Forked from karthickraji/pca_teacher_api.md
Last active August 29, 2015 14:20
Show Gist options
  • Save nandha-dev/568ec12301dd1e22a782 to your computer and use it in GitHub Desktop.
Save nandha-dev/568ec12301dd1e22a782 to your computer and use it in GitHub Desktop.

PCA Teacher Api

Authentication

###Sign In #####1.Request:

        Post

#####2.URL:

        https://128.199.112.162/api/v1/teacher/signin

#####3.Params: #####Eg.,:

        {
                "email"       : "nandha21.2@gmail.com",
                "password"    : "password",
                "device_id"   : "112233"
        }
    email       : <email id of teacher>
    password    : <password of teacher>
    device_id   : <mobile device id of teacher>

#####4.Response:

         {
           "status": "Success",
           "message": "Signed in Successfully"
         }

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

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

###Daily Report ####1.Create a Daily Report #####i)Request: Post #####ii)URL: https://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: https://128.199.112.162/api/v1/teacher/device_id/reports/update #####iii)params: report_id and above all report params. #####iv)Response:

          {
           "status": "Success",
           "message": "Daily Report Updated"
          }

####3.Edit & Index & Show a Daily Report #####i)Request: Get #####ii)URL: Infant: https://128.199.112.162/api/v1/teacher/device_id/reports/infant_report_show Two Year: https://128.199.112.162/api/v1/teacher/device_id/reports/two_year_report_show Four Year: https://128.199.112.162/api/v1/teacher/device_id/reports/four_year_report_show #####iii)Params: Infant: infant_report_id Two Year: two_report_id Four Year: four_report_id ####4.Publish and Unpublish a Daily Report #####i)Request: Post #####ii)URL: https://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: https://128.199.112.162/api/v1/teacher/device_id/reports/delete #####iii)Params: report_id #####iv)Response:

          {
           "status": "Success",
           "message": "Daily Report Deleted"
          }

###Weekly Report ####1.Create a Weekly Report #####i)Request: Post #####ii)URL: https://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: https://128.199.112.162/api/v1/teacher/device_id/weekly_summaries/update #####iii)params: weekly_summary_id and above all weekly_summaries params. #####iv)Response:

          {
           "status": "Success",
           "message": "Weekly Report Updated"
          }

####3.Edit & Index & Show a Weekly Report #####i)Request: Get #####ii)URL: https://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: Post #####ii)URL: https://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: https://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"
          }

###Incident Report ####1.Create a Incident Report #####i)Request: Post #####ii)URL: https://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: https://128.199.112.162/api/v1/teacher/device_id/incident_reports/update #####iii)params: incident_report_id and above all incident_reports params. #####iv)Response:

          {
           "status": "Success",
           "message": "Incident Report Updated"
          }

####3.Edit & Index & Show a Incident Report #####i)Request: Get #####ii)URL: https://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: https://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: https://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"
          }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment