====== Differences ====== This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
api2:student:student_group [2017/10/07 14:50] 127.0.0.1 external edit |
api2:student:student_group [2017/11/24 18:07] (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.\\ | ||
| + | |||
| + | {{ :api2:student:student_group.png?600 |Student Groups}} | ||
| + | |||
| + | |||
| + | ===Object resources=== | ||
| + | ^ Property ^ Type ^ Description ^ | ||
| + | | id | Integer | identifier for the database of Domoscio's API | | ||
| + | | name | String | Custom data | | ||
| + | | created_at | DateTime | Date of creation of the object | | ||
| + | | updated_at | DateTime | Last time the object has been modified | | ||
| + | |||
| + | ===Create (POST)=== | ||
| + | |||
| + | ^ Method | POST | | ||
| + | ^ URL | /student_groups | | ||
| + | |||
| + | ==Parameters (*Requiered parameters)== | ||
| + | |||
| + | ^ Property ^ Type ^ Description ^ | ||
| + | | name | String | Custom data | | ||
| + | |||
| + | ==Send the request (JSON input example)== | ||
| + | |||
| + | <code> | ||
| + | { | ||
| + | "name": "2nd year associates financial services" | ||
| + | } | ||
| + | </code> | ||
| + | |||
| + | ==Get the response (JSON output example)== | ||
| + | |||
| + | <code> | ||
| + | { | ||
| + | "id": 31, | ||
| + | "name": "2nd year associates financial services", | ||
| + | "created_at": "2017-11-24T17:01:39.016Z", | ||
| + | "updated_at": "2017-11-24T17:01:39.016Z" | ||
| + | } | ||
| + | </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": 31, | ||
| + | "name": "2nd year associates financial services", | ||
| + | "created_at": "2017-11-24T17:01:39.016Z", | ||
| + | "updated_at": "2017-11-24T17:01:39.016Z" | ||
| + | } | ||
| + | </code> | ||
| + | |||
| + | **Without ID provided**\\ | ||
| + | <code> | ||
| + | [ | ||
| + | { | ||
| + | "id": 29, | ||
| + | "name": "test", | ||
| + | "created_at": "2017-11-21T16:25:29.409Z", | ||
| + | "updated_at": "2017-11-21T16:25:29.409Z" | ||
| + | }, | ||
| + | { | ||
| + | "id": 30, | ||
| + | "name": "test", | ||
| + | "created_at": "2017-11-21T16:25:57.926Z", | ||
| + | "updated_at": "2017-11-21T16:25:57.926Z" | ||
| + | }, | ||
| + | { | ||
| + | "id": 31, | ||
| + | "name": "2nd year associates financial services", | ||
| + | "created_at": "2017-11-24T17:01:39.016Z", | ||
| + | "updated_at": "2017-11-24T17:01:39.016Z" | ||
| + | } | ||
| + | ] | ||
| + | </code> | ||
| + | |||
| + | |||
| + | ===EDIT (PUT)=== | ||
| + | |||
| + | ^ Method | PUT | | ||
| + | ^ URL | /student_groups/{student_group_id} | | ||
| + | |||
| + | ==Editable parameters== | ||
| + | |||
| + | ^ Property ^ Type ^ Description/expected values | | ||
| + | | name | String | Custom data (<255 chars) | | ||
| + | |||
| + | ==Send the request (JSON input example)== | ||
| + | |||
| + | <code> | ||
| + | { | ||
| + | "name": "3nd year associates financial services" | ||
| + | } | ||
| + | </code> | ||
| + | |||
| + | ==Get the response (JSON output example)== | ||
| + | |||
| + | <code> | ||
| + | { | ||
| + | "id": 31, | ||
| + | "name": "3nd year associates financial services", | ||
| + | "created_at": "2017-11-24T17:01:39.016Z", | ||
| + | "updated_at": "2017-11-24T17:05:55.390Z" | ||
| + | } | ||
| + | </code> | ||
| + | |||