Show pageBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ===== Parent Dashboard ===== In Parent dashboard is act the same as [[api:student#dashboard|Student Dashboard]] but is included in Children array with extra children information for further queries, to use this method your must be [[api:main#authentication|Authenticated]]. Dashboard action is GET, and parameters value is boolean 0 for false & 1 for TRUE. ^ Paramater ^ Description ^ Default ^ | user | User Information | 0 | | gb_summary | Student gradebook summary | 0 | | absences | Student number of absences | 0 | **URL Example** ''%%http://example.com/api/v1/dashboard%%?<fc #ff0000>gb_summary=1&absences=1&user=1</fc>'' === Sample Output === <code javascript> [ { "user": { "user_id": 109, "email": "student@scl.education", "full_name": "Scl Student", "group": 4, "student_code": "100000-2", "secondary_code": "" }, "absences": { "max_absences": 17, "total_absences": 2 } }, { "user": { "user_id": 112, "email": "student2@scl.education", "full_name": "Student Demo", "group": 4, "student_code": "100000-3", "secondary_code": "" }, "absences": { "max_absences": 17, "total_absences": 4 } } ] </code> You can understand gb_summary parameter from [[api:student#gradebook_summary|Student Gradebook Summary]]. ===== Absences ===== Calling student absences method is GET action & must be [[:api:main#authentication|Authenticated]]. **URL Example** ''%%http://example.com/api/v1/%%<fc #ff0000>absences?StudentID=Student_user_id</fc>'' === Absences Response === ^ Parameter ^ Description ^ Type ^ | max_absences | School configured maximum allowed absences | Integer | | total_absences | Student Total absences in current academic year | Integer | ===== Absences List ===== Calling student absences list method is GET action & must be [[api:main#authentication|Authenticated]]. **URL Example** ''%%http://example.com/api/v1/%%<fc #ff0000>absences_list?StudentID=Student_user_id</fc>'' ^ Name ^ Description ^ Type ^ | absent_date | Student's absence date | Date | | absent_type | Absence type id | Integer | | absent_type_name | Absence type which configured by Administrator | String | | absent_type_icon | The icon path of absence type | String | | created_by | Full name of the user who created this absence entry | String | <WRAP center round info> absent_type_icon is image file name which been uploaded by Administrator URL Example: %%http://example.com/assets/uploads/absent_type_icon%% </WRAP> ===== Absences Types ===== Calling absences_types method is GET action & must be [[api:main#authentication|Authenticated]]. **URL Example** ''%%http://example.com/api/v1/%%<fc #ff0000>absences_types</fc>'' ^ Name ^ Description ^ Type ^ | id | absence type id | Integer | | name | absence type name | String | | icon | absence type icon file name | String | ===== Contacts ===== Managing parent contact must be [[api:main#authentication|Authenticated]] and this feature restricted to parent group only. Calling contacts method is GET and results are in array for each contact. **URL Example** ''%%http://example.com/api/v1/%%<fc #ff0000>contacts</fc>'' **Result of each contact** ^ NAME ^ DESCRIPTION ^ TYPE ^ | id | Contact ID | Integer | | relationship | Relationship ID, you will need to use relationships method to translate id to name | Integer | | name | Contact Name | String | | nationality | Contact Nationality | String | | occupation | Contact Occupation | String | | address | Contact address | String | | email | Contact Email address | String | | phone | Contact Home/work phone number | String | | mobile | Contact Mobile number | String | ==== Create Contact ==== create_contact Method is POST. **API URL** ''%%http://example.com/api/v1/%%<fc #ff0000>create_contact</fc>'' **All Following POST parameters are required** ^ NAME ^ DESCRIPTION ^ TYPE ^ | relationship | Contact relationship type | Integer | | name | Contact Full Name | String | | nationality | Contact nationality this field only accept alphabetic input | String | | occupation | Contact Occupation | String | | address | Contact Address | String | | email | Contact email, must be valid email address | String | | phone | Contact Telephone number | String | | mobile | Contact mobile number this field length must be atleast 10 numbers and character + only | String | **Success response Example** <code javascript> { "success": "Contact been successfully created." } </code> **Validation response error** <code javascript> { "error": { "nationality": "The nationality field may only contain alphabetical characters.", "email": "The email field must contain a valid email address.", "mobile": "The mobile field must be at least 10 characters in length." }, "code": 1030 } </code> ==== Update Contact ==== update_contact Method is POST and is required contact id. **API URL** ''%%http://example.com/api/v1/%%<fc #ff0000>update_contact</fc>'' **POST Parameters** ^ NAME ^ DESCRIPTION ^ TYPE ^ | id | This contact id which is required to know which contact you want to update | Integer | | relationship | Contact relationship type | Integer | | name | Contact Full Name | String | | nationality | Contact nationality this field only accept alphabetic input | String | | occupation | Contact Occupation | String | | address | Contact Address | String | | email | Contact email, must be valid email address | String | | phone | Contact Telephone number | String | | mobile | Contact mobile number this field length must be atleast 10 numbers and character + only | String | **Success Output Example** <code javascript> { "success": "Contact been successfully updated." } </code> **Validation response error** <code javascript> { "error": { "nationality": "The nationality field may only contain alphabetical characters.", "email": "The email field must contain a valid email address.", "mobile": "The mobile field must be at least 10 characters in length." }, "code": 1030 } </code> ==== Delete Contact ==== Calling delete_contact method is GET & required contact id. **URL Example** ''%%http://example.com/api/v1/%%<fc #ff0000>contact_delete?id=contact_id</fc>'' **Success example response** <code javascript> { "success": "Contact been successfully deleted." } </code> **Error example response ** <code javascript> { "error": "This contact is may already deleted or invalid ID", "code": 1060 } </code> ==== Relationships ==== This Method is very important to get the relationship list including id & name which will help you to translate the relationship which shown in contacts as id to name, the method results are in arrays for each relationship been configured by Administrator. **URL Example** ''%%http://example.com/api/v1/%%<fc #ff0000>relationships</fc>'' **Result of each array** ^ NAME ^ DESCRIPTION ^ TYPE ^ | id | Relationship ID | Integer | | name | Relationship display name such as Father, Mother or guardian | String | ===== Gradebook Summary ===== Calling gb_summary method is GET action & must be [[api:main#authentication|Authenticated]]. **URL Example** ''%%http://example.com/api/v1/%%<fc #ff0000>gb_summary?StudentID=Student_user_id</fc>'' **Response** This method output is same exactly as in [[api:student&#gradebook_summary|Student Gradebook Summary]]. ===== Gradebook ===== Calling gradebook method is GET action & must be [[api:main#authentication|Authenticated]]. **Parameters** ^ Name ^ Type ^ Description ^ | GroupID | Integer | The Group ID which been obtained from gb_summary | | QuarterID | Integer | Default QuarterID is current active quarter, set this to fetch data of another Quarter | | StudentID | Integer | Parent Children user_id | **URL Example** ''%%http://example.com/api/v1/%%<fc #ff0000>gradebook?GroupID=ID&StudentID=Student_user_id</fc>'' This method output is identical to [[api:student&#gradebook|Student Gradebook]] so for full information [[api:student&#gradebook|click here]]. ===== Login as Student ===== If you parent and want to fetch any student API by his behalf like reading or creating messages all you will need to do is adding header name "LOGIN-AS-STUDENT" this header parameter value equal Student ID. **Curl Example** <code bash> curl -X GET -H "ACCESS-CODE: user_accessCode" -H "LOGIN-AS-STUDENT: STUDENT_ID" -H "Cache-Control: no-cache" 'http://example.com/api/v1/user' </code> **Response Example** <code javascript> { "user_id": STUDENT_USER_ID, "email": "student@scl.education", "full_name": "Scl Student", "group": 4, "student_code": "10000-2", "secondary_code": "", "accessCode": STUDENT_USER_accessCode, "avatar": "http://example.com/assets/uploads/avatar/unknown_130x130.png", "grade_name": "Grade 12", "class_name": "A", "class_description": "Grade 12 - Classroom A" } </code>