====== Differences ====== This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
api2:student:student [2017/11/24 15:04] 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 | | + | |
| - | | active || Boolean | Student is enabled or not on API | | + | |
| - | | 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": 26, | + | |
| - | "civil_profile_attributes": { | + | |
| - | "student_infos": {"last_formation": "A74D"} | + | |
| - | } | + | |
| - | } | + | |
| - | </code> | + | |
| - | + | ||
| - | ==Get the response (JSON output example)== | + | |
| - | + | ||
| - | <code> | + | |
| - | { | + | |
| - | "id": 379, | + | |
| - | "student_group_id": 1, | + | |
| - | "created_at": "2017-11-24T13:44:08.034Z", | + | |
| - | "updated_at": "2017-11-24T13:44:08.034Z", | + | |
| - | "uid": "26", | + | |
| - | "active": true, | + | |
| - | "last_activity": null, | + | |
| - | "learning_profile": { | + | |
| - | "capacity": 1 | + | |
| - | }, | + | |
| - | "civil_profile": { | + | |
| - | "student_infos": { | + | |
| - | "formation": "A7D4" | + | |
| - | } | + | |
| - | } | + | |
| - | } | + | |
| - | </code> | + | |
| - | + | ||
| - | ===Fetch (GET)=== | + | |
| - | + | ||
| - | ^ Method | GET| | + | |
| - | ^ URL | /students/{student_id} | | + | |
| - | + | ||
| - | If you do not provide a student_id, you will fetch all the students of your platform. You can choose to filter the response by providing an uid in the parameters. | + | |
| - | + | ||
| - | ==Get the response (JSON output example)== | + | |
| - | + | ||
| - | **With ID provided**\\ | + | |
| - | <code> | + | |
| - | { | + | |
| - | "id": 379, | + | |
| - | "created_at": "2017-11-24T13:44:08.034Z", | + | |
| - | "updated_at": "2017-11-24T13:44:08.034Z", | + | |
| - | "instance_id": 45, | + | |
| - | "uid": "26", | + | |
| - | "active": true, | + | |
| - | "student_group_id": 1, | + | |
| - | "last_activity": null, | + | |
| - | "civil_profile": { | + | |
| - | "student_infos": { | + | |
| - | "formation": "A7D4" | + | |
| - | } | + | |
| - | }, | + | |
| - | "learning_profile": { | + | |
| - | "capacity": 1 | + | |
| - | } | + | |
| - | } | + | |
| - | </code> | + | |
| - | + | ||
| - | **Without ID provided**\\ | + | |
| - | <code> | + | |
| - | [ | + | |
| - | { | + | |
| - | "id": 378, | + | |
| - | "student_group_id": 1, | + | |
| - | "created_at": "2017-11-24T13:42:24.402Z", | + | |
| - | "updated_at": "2017-11-24T13:42:24.402Z", | + | |
| - | "instance_id": 45, | + | |
| - | "uid": "25", | + | |
| - | "active": true, | + | |
| - | "last_activity": null, | + | |
| - | "learning_profile": { | + | |
| - | "capacity": 1 | + | |
| - | }, | + | |
| - | "civil_profile": { | + | |
| - | "student_infos": { | + | |
| - | "formation": "A7D4" | + | |
| - | } | + | |
| - | } | + | |
| - | }, | + | |
| - | { | + | |
| - | "id": 379, | + | |
| - | "student_group_id": 1, | + | |
| - | "created_at": "2017-11-24T13:44:08.034Z", | + | |
| - | "updated_at": "2017-11-24T13:44:08.034Z", | + | |
| - | "instance_id": 45, | + | |
| - | "uid": "26", | + | |
| - | "active": true, | + | |
| - | "last_activity": null, | + | |
| - | "learning_profile": { | + | |
| - | "capacity": 1 | + | |
| - | }, | + | |
| - | "civil_profile": { | + | |
| - | "student_infos": { | + | |
| - | "formation": "A7D4" | + | |
| - | } | + | |
| - | } | + | |
| - | } | + | |
| - | ] | + | |
| - | </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 | | + | |
| - | | active || Boolean | Student is enabled or not on API | | + | |
| - | | 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": 2, | + | |
| - | "civil_profile_attributes": { | + | |
| - | "student_infos": { "formation2": "Z5J8"} | + | |
| - | } | + | |
| - | } | + | |
| - | </code> | + | |
| - | + | ||
| - | ==Get the response (JSON output example)== | + | |
| - | + | ||
| - | <code> | + | |
| - | { | + | |
| - | "id": 379, | + | |
| - | "student_group_id": 2, | + | |
| - | "created_at": "2017-11-24T13:44:08.034Z", | + | |
| - | "updated_at": "2017-11-24T14:03:29.670Z", | + | |
| - | "uid": "26", | + | |
| - | "active": true, | + | |
| - | "last_activity": null, | + | |
| - | "learning_profile": { | + | |
| - | "capacity": 1 | + | |
| - | }, | + | |
| - | "civil_profile": { | + | |
| - | "student_infos": { | + | |
| - | "formation2": "Z5J8" | + | |
| - | } | + | |
| - | } | + | |
| - | } | + | |
| - | </code> | + | |
| - | + | ||