**This is an old revision of the document!** ----
As a new student is created on your application, you would have to declare a new student on our API as well. \\ {{ :api2:student:student.png?400 |Student}} ===Object resources=== ^ Property ^ Sub-property ^ Type ^ Description ^ | id || Integer | Identifier for the database of Domoscio's API | | uid || String | The ID of this student in your Database (must be unique) | | student_group_id || Integer | The group this student belongs to (for example a class or a session) | | active || Boolean | Student is enabled or not on API | | last_activity || DateTime | Last event made by that student | | created_at || DateTime | Date time of creation of the object | | updated_at || DateTime | Date time of the last update of the object | | civil_profile_attributes || | | | | student_infos | jsonb | Custom data that can be used to do clustering | | learning_profile_attributes || | | | | capacity | Float | Average memory compared to others (1 being the mean) | ===Create (POST)=== ^ Method | POST | ^ URL | /students | ==Parameters (*Requiered parameters)== ^ Property ^ Sub-property ^ Type ^ Description ^ | uid || String | The ID of this student in your Database (must be unique) | | student_group_id || Integer | The group this student belongs to | | civil_profile_attributes || | | | | student_infos | jsonb | Custom data that can be used to do clustering | ==Send the request (JSON input example)== <code> { student_group_id: 1, uid: 1, civil_profile_attributes: { student_infos: {last_formation: "A74D"} } } </code> ==Get the response (JSON output example)== <code> [ { "id": 29, "student_group_id": 1, "created_at": "2017-03-01T10:06:24.371Z", "updated_at": "2017-03-01T10:06:24.371Z", "instance_id": 3, "uid": null, "active": true, "last_activity": "2017-03-01T10:10:43.301Z", "civil_profile": { "date_of_birth": "2017-03-01T10:06:24.371Z", "place_of_birth": "FR", "name": "Student1", "sexe": "male", "country_of_residence": "FR", "city_of_residence": "Paris", "student_infos": null } } ] </code> ===Fetch (GET)=== ^ Method | GET| ^ URL | /students/{student_id %%||%% uid} | ==Get the response (JSON output example)== <code> { "id": 29, "student_group_id": 1, "created_at": "2017-03-01T10:06:24.371Z", "updated_at": "2017-03-01T10:06:24.371Z", "instance_id": 3, "uid": null, "active": true, "last_activity": "2017-03-01T10:10:43.301Z", "civil_profile": { "date_of_birth": "2017-03-01T10:06:24.371Z", "place_of_birth": "FR", "name": "Student1", "sexe": "male", "country_of_residence": "FR", "city_of_residence": "Paris", "student_infos": null } } </code> ===EDIT (PUT)=== ^ Method | PUT | ^ URL | /students/{student_id} | ==Editable parameters== ^ Property ^ Sub-property ^ Type ^ Description/expected values | | student_group_id || Integer | The group this student belongs to | | civil_profile_attributes || | | | | name | String | Custom data | | | sexe | String | Amongst (‘male’, ’female’, ‘undefined’) | | | date_of_birth | Timestamp | The date of birth of the student | | | place_of_birth | String | The place of birth of the student | | | country_of_residence | String | The country of residence of the student | | | city_of_residence | String | The city of residence of the student | ==Send the request (JSON input example)== <code> { student_group_id: 1, civil_profile_attributes: { name: "Student with new name", sexe: "female", }, } </code> ==Get the response (JSON output example)== <code> { "id": 29, "student_group_id": 1, "created_at": "2017-03-01T10:06:24.371Z", "updated_at": "2017-03-01T10:06:24.371Z", "instance_id": 3, "uid": null, "active": true, "last_activity": "2017-03-01T10:10:43.301Z", "civil_profile": { "date_of_birth": "2017-03-01T10:06:24.371Z", "place_of_birth": "FR", "name": "Student1", "sexe": "male", "country_of_residence": "FR", "city_of_residence": "Paris", "student_infos": null } } </code>