====== Differences ====== This shows you the differences between two versions of the page.
api1:student:student_group [2017/10/07 14:57] 127.0.0.1 external edit |
api1:student:student_group [2017/10/17 12:28] (current) maries |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | A good way to manage your students is to gather them into groups on our API. Il will provide you some convenient method to get aggregated results on a group.\\ | ||
+ | A group can represent a class, or a formation session.\\ | ||
+ | |||
+ | {{ :api1:student:student_group_v1.png?600 | Student Group example }} | ||
+ | |||
+ | |||
+ | ===Object resources=== | ||
+ | ^ Property ^ Type ^ Description ^ | ||
+ | | name | String | Custom data | | ||
+ | | instance_id | Integer | The instance this student group belongs to | | ||
+ | | student_cluster_id | Integer | The student cluster this student group belongs to | | ||
+ | | created_at | Timestamp | The creation date of the object | | ||
+ | | updated_at | Timestamp | The last update date of the object | | ||
+ | |||
+ | ===Create (POST)=== | ||
+ | |||
+ | ^ Method | POST | | ||
+ | ^ URL | /student_groups | | ||
+ | |||
+ | ==Parameters (*Requiered parameters)== | ||
+ | |||
+ | ^ Property ^ Type ^ Description ^ | ||
+ | | name | String | Custom data | | ||
+ | | student_cluster_id | Integer | The student cluster this student group belongs to | | ||
+ | |||
+ | ==Send the request (JSON input example)== | ||
+ | |||
+ | <code> | ||
+ | { | ||
+ | name: "2nd year associates financial services", | ||
+ | student_cluster_id: 1 | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | ==Get the response (JSON output example)== | ||
+ | |||
+ | <code> | ||
+ | { | ||
+ | id : 1, | ||
+ | name : "2nd year associates financial services", | ||
+ | student_cluster_id : 1, | ||
+ | instance_id : 1, | ||
+ | created_at : 2014-09-17 09:21:03, | ||
+ | updated_at : 2014-09-17 09:21:03 | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | ===Fetch (GET)=== | ||
+ | |||
+ | ^ Method | GET| | ||
+ | ^ URL | /student_groups/{student_group_id} | | ||
+ | |||
+ | If no student_group_id is provided it will fetch all the Student Groups for your instance. | ||
+ | |||
+ | ==Get the response (JSON output example)== | ||
+ | |||
+ | **With ID provided**\\ | ||
+ | |||
+ | <code> | ||
+ | { | ||
+ | id : 1, | ||
+ | name : "2nd year associates financial services", | ||
+ | student_cluster_id : 1, | ||
+ | instance_id : 1, | ||
+ | created_at : 2014-09-17 09:21:03, | ||
+ | updated_at : 2014-09-17 09:21:03 | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | **Without ID provided**\\ | ||
+ | <code> | ||
+ | [{ | ||
+ | id : 1, | ||
+ | name : « 2nd year associates financial services », | ||
+ | student_cluster_id : 1, | ||
+ | instance_id : 1, | ||
+ | created_at : 2014-09-17 09:21:03, | ||
+ | updated_at : 2014-09-17 09:21:03 | ||
+ | }, | ||
+ | { | ||
+ | id : 2, | ||
+ | name : « senior associates financial services », | ||
+ | student_cluster_id : 1, | ||
+ | instance_id : 1, | ||
+ | created_at : 2014-09-17 09:21:03, | ||
+ | updated_at : 2014-09-17 09:21:03 | ||
+ | }] | ||
+ | </code> | ||
+ | |||
+ | |||
+ | ===EDIT (PUT)=== | ||
+ | |||
+ | ^ Method | PUT | | ||
+ | ^ URL | /student_groups/{student_group_id} | | ||
+ | |||
+ | ==Editable parameters== | ||
+ | |||
+ | ^ Property ^ Type ^ Description/expected values | | ||
+ | | name | String | Custom data (<255 chars) | | ||
+ | | student_cluster_id | Integer | The student cluster this student group belongs to | | ||
+ | |||
+ | ==Send the request (JSON input example)== | ||
+ | |||
+ | <code> | ||
+ | { | ||
+ | name : "No more 2nd year associates financial services" | ||
+ | } | ||
+ | </code> | ||
+ | |||
+ | ==Get the response (JSON output example)== | ||
+ | { | ||
+ | id : 1, | ||
+ | name : "No more 2nd year associates financial services", | ||
+ | student_cluster_id : 1, | ||
+ | instance_id : 1, | ||
+ | created_at : 2014-09-17 09:21:03, | ||
+ | updated_at : 2014-09-20 09:21:03 | ||
+ | } | ||
+ | </code> | ||
+ | |||