====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
api2:student:student [2017/11/24 12:27] maries |
api2:student:student [2017/11/28 10:07] (current) maries |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | As a new student is created on your application, you would have to declare a new student on our API as well. \\ | + | ====Student Management==== |
- | {{ :api2:student:student.png?400 |Student}} | + | [[api2:student:students|Student]]\\ |
- | + | [[api2:student:student_group|Student Group]]\\ | |
- | ===Object resources=== | + | [[api2:student:student_cluster|Student Cluster]]\\ |
- | ^ Property ^ Sub-property ^ Type ^ Description ^ | + | [[api2:student:student_cluster_membership|Student Cluster Membership]]\\ |
- | | 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> | + | |
- | + |