User Tools

Site Tools


api1:student:student

====== Differences ====== This shows you the differences between two versions of the page.

Link to this comparison view

api1:student:student [2017/10/07 14:57]
127.0.0.1 external edit
api1:student:student [2017/10/17 12:21] (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. \\
 +
 +{{ :​api1:​student:​student.png?​600 | Student }}
 +
 +===Object resources===
 +^ Property ​ ^ Sub-property ​ ^ Type      ^ Description ​        ^
 +| instance_id || Integer | The instance the student belongs to |
 +| uid || String | The ID of this student in your Database (must be unique) |
 +| student_group_id || Integer | The group this student belongs to |
 +| last_activty || Timestamp | Date of the last event record for that student |
 +| active || Boolean | Student is enabled or not on API |
 +| 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 |
 +| learning_profile_attributes || | |
 +|  | forgetting_parameters | String |  |
 +
 +
 +===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 || |  |
 +|  | 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 |
 +| learning_profile_attributes || | |
 +|  | forgetting_parameters | String |  |
 +
 +As a convenience we let you declare in the same time a student, his/her civil profile and his/her learning profile:
 +
 +==Send the request (JSON input example)==
 +
 +<​code>​
 +{
 + student_group_id:​ 1,
 + civil_profile_attributes:​ {
 + name: "​Student1",​
 + sexe: "​male",​
 + day_of_birth:​ Date.today, ​
 + place_of_birth:​ "​FR",​
 + country_of_residence:​ "​FR",​
 + city_of_residence:​ "​Paris"​
 + },
 + learning_profile_attributes:​ {
 + forgetting_parmeters:​ "​[1,​2,​3,​4]"​
 + }
 +}
 +</​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",​
 +        },
 +       ​ learning_profile_attributes:​ {
 + forgetting_parmeters:​ "​[1,​2,​3,​4]"​
 + }
 +    }
 +</​code>​
 +
 +===Fetch (GET)===
 +
 +^ Method | GET|
 +^ URL | /​students/​{student_id %%||%% uid} |
 +
 +==Get the response (JSON output example)==
 +
 +
 +<​code>​
 +{
 + id : 2,
 + student_group_id:​ 1,
 + name: "​Student1",​
 + sexe: "​male",​
 + day_of_birth:​ 1986-09-17 09:​21:​03, ​
 + place_of_birth:​ "​FR",​
 + country_of_residence:​ "​FR",​
 + city_of_residence:​ "​Paris",​
 + forgetting_parmeters:​ "​[1,​2,​3,​4]",​
 + 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 | /​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 |
 +| learning_profile_attributes || | |
 +|  | forgetting_parameters | String |  |
 +
 +==Send the request (JSON input example)==
 +
 +<​code>​
 +{
 + student_group_id:​ 1,
 + civil_profile_attributes:​ {
 + name: "​Student with new name",
 + city_of_residence:​ "​Lyon"​
 + }
 +}
 +</​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":​ "​Student with new name",
 +            "​sexe":​ "​male",​
 +            "​country_of_residence":​ "​FR",​
 +            "​city_of_residence":​ "​Lyon",​
 +        },
 +       ​ learning_profile_attributes:​ {
 + forgetting_parmeters:​ "​[1,​2,​3,​4]"​
 + }
 +    }
 +</​code>​
 +
  
api1/student/student.1507381075.txt.gz · Last modified: 2017/10/07 14:57 by 127.0.0.1