V1::UsersController
User resources
index
View list of all students or collaborators. This list is paginated and filtered if needed.
URL
GET /students or /collaboratorsParâmetros opcionais
Nome | Tipo | Descrição |
---|---|---|
school_product_id | Array<Integer> | Student filter. Filter by school_product_id. Only users that have relations with some object with the id passed in the |
course_class_id | Array<Integer> | Student filter. Filter by course_class_id. Only users that have relations with some object with the id passed in the |
uninitiated_lesson_id | Array<Integer> | Student filter. Filter by uninitiated_leson_id. Only users that have relations with some object with the id passed in the |
course_id | Array<Integer> | Student filter. Filter by course_id. Only users that have relations with some object with the id passed in the |
enrollment_status | Array<String> | Student filter. Filter by enrollmen_status. The available statuses are pending, active, expired, deactivated and canceled. |
status | Array<String> | Student filter. Filter by status |
progress | Float | Student filter. Filter by progress. If used together with |
progress>= | Float | Student filter. Filter students that have progress equal or greater than the progress given. If used together with |
progress<= | Float | Student filter. Filter students that have progress equal or less than the progress given. If used together with |
completed_progress_at>= | DateTime | Student filter. Filter students that have completed the progress at the given DateTime or after that. If used together with |
completed_progress_at<= | DateTime | Student filter. Filter students that have completed the progress at the given DateTime or before that. If used together with |
enrolled_at>= | DateTime | Student filter. Filter students that have activated an enrollment at the given DateTime or after that. If used together with |
enrolled_at<= | DateTime | Student filter. Filter students that have activated an enrollment at the given DateTime or before that. If used together with |
last_progress_updated_at>= | DateTime | Student filter. Filter students that have did some progress at the given DateTime or after that. ps: Some school's actions does not generate progress. If used together with |
last_progress_updated_at<= | DateTime | Student filter. Filter students that have did some progress at the given DateTime or before that. ps: Some school's actions does not generate progress. If used together with |
ids | String | Filter by id. Return the users with the passed ids. |
full_name | String | Filter by full_name. This is an espcial filter, with it you can pass any group of chars, the filter will select the users that the fullname or the email includes those chars. |
sort | String | Filter to sort the users by an attribute |
direction | String | Filter to indicate the sort direction. It can be asc ou desc |
Response Fields
Nome | Tipo | Descrição |
---|---|---|
students | Array<{Student}> | List of students if |
collaborators | Array<{Collaborator}> | List of collaborators if |
show
View a student or collaborator
URL
GET /students/:id or /collaborators/:idParâmetros obrigatórios
Nome | Tipo | Descrição |
---|---|---|
id | Integer | Identifier the student or collaborator |
Objeto resposta
{Student} | The requested student with its role, address and registrations if |
create
Create student or collaborator
URL
POST /students/ or /collaborators/Parâmetros obrigatórios
Nome | Tipo | Descrição |
---|---|---|
user | Hash | The user to create |
user[first_name] | String | User first name |
user[email] | String | User email that should be uniq |
user[password] | String | Should be greater than 6 chars |
user[password_confirmation] | String | Should be equal the password |
Parâmetros opcionais
Nome | Tipo | Descrição |
---|---|---|
user[last_name] | String | User last name |
user[username] | String | Nickname |
user[cpf] | String | CPF |
user[rg] | String | RG |
user[phone] | String | |
user[extra_phone] | String | |
user[skype] | String | |
user[twitter] | String | |
user[facebook] | String | |
user[company_name] | String | |
user[company_position] | String | |
user[born_at] | DateTime | |
user[biography] | String | |
user[cover_image_url] | String | |
user[created_at] | DateTime | Exists only for Student. It overwrites the default created_at, normally used to migrate old students. |
user[last_sign_in_at] | DateTime | Exists only for Student |
user[role_ids] | Array<Integer> | Roles to associate to the User |
user[address_attributes] | Hash | |
user[address_attributes][id] | Integer | If not present it will create a new address |
user[address_attributes][street] | String | It will update the attribute if the user[address_attributes][id] is present |
user[address_attributes][number] | Integer | It will update the attribute if the user[address_attributes][id] is present |
user[address_attributes][complement] | String | It will update the attribute if the user[address_attributes][id] is present |
user[address_attributes][city] | String | It will update the attribute if the user[address_attributes][id] is present |
user[address_attributes][state] | String | It will update the attribute if the user[address_attributes][id] is present |
user[address_attributes][zip_code] | String | It will update the attribute if the user[address_attributes][id] is present |
user[address_attributes][district] | String | It will update the attribute if the user[address_attributes][id] is present |
Objeto resposta
User | The created user or a list of errors |
update
Update student or collaborator
URL
PATCH /students/:id or /collaborators/:idParâmetros obrigatórios
Nome | Tipo | Descrição |
---|---|---|
user | Hash | The user to update |
user[first_name] | String | User first name |
user[email] | String | User email that should be uniq |
user[password] | String | Should be greater than 6 chars |
user[password_confirmation] | String | Should be equal the password |
Parâmetros opcionais
Nome | Tipo | Descrição |
---|---|---|
user[last_name] | String | User last name |
user[username] | String | Nickname |
user[cpf] | String | CPF |
user[rg] | String | RG |
user[phone] | String | |
user[extra_phone] | String | |
user[skype] | String | |
user[twitter] | String | |
user[facebook] | String | |
user[company_name] | String | |
user[company_position] | String | |
user[born_at] | DateTime | |
user[biography] | String | |
user[cover_image_url] | String | |
user[created_at] | DateTime | Exists only for Student. It overwrites the default created_at, normally used to migrate old students. |
user[last_sign_in_at] | DateTime | Exists only for Student |
user[role_ids] | Array<Integer> | Roles to associate to the User |
user[address_attributes] | Hash | |
user[address_attributes][id] | Integer | If not present it will create a new address |
user[address_attributes][street] | String | It will update the attribute if the user[address_attributes][id] is present |
user[address_attributes][number] | Integer | It will update the attribute if the user[address_attributes][id] is present |
user[address_attributes][complement] | String | It will update the attribute if the user[address_attributes][id] is present |
user[address_attributes][city] | String | It will update the attribute if the user[address_attributes][id] is present |
user[address_attributes][state] | String | It will update the attribute if the user[address_attributes][id] is present |
user[address_attributes][zip_code] | String | It will update the attribute if the user[address_attributes][id] is present |
user[address_attributes][district] | String | It will update the attribute if the user[address_attributes][id] is present |
Objeto resposta
User | The updated user or a list of errors |
destroy
Destroy a student or collaborator