===== 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%%?gb_summary=1&absences=1&user=1'' === Sample Output === [ { "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 } } ] 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/%%absences?StudentID=Student_user_id'' === 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/%%absences_list?StudentID=Student_user_id'' ^ 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 | absent_type_icon is image file name which been uploaded by Administrator URL Example: %%http://example.com/assets/uploads/absent_type_icon%% ===== Absences Types ===== Calling absences_types method is GET action & must be [[api:main#authentication|Authenticated]]. **URL Example** ''%%http://example.com/api/v1/%%absences_types'' ^ 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/%%contacts'' **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/%%create_contact'' **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** { "success": "Contact been successfully created." } **Validation response error** { "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 } ==== Update Contact ==== update_contact Method is POST and is required contact id. **API URL** ''%%http://example.com/api/v1/%%update_contact'' **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** { "success": "Contact been successfully updated." } **Validation response error** { "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 } ==== Delete Contact ==== Calling delete_contact method is GET & required contact id. **URL Example** ''%%http://example.com/api/v1/%%contact_delete?id=contact_id'' **Success example response** { "success": "Contact been successfully deleted." } **Error example response ** { "error": "This contact is may already deleted or invalid ID", "code": 1060 } ==== 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/%%relationships'' **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/%%gb_summary?StudentID=Student_user_id'' **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/%%gradebook?GroupID=ID&StudentID=Student_user_id'' 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** 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' **Response Example** { "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" }