Users API

User represents the teacher and students in the system.

Creating an user by admin

POST /v1/users

Parameters

Name Description
user[name] The name of the user
user[email] The email of user
user[description] The user description
user[password] The password of user
user[password_confirmation] The password confirmation of user
user[terms_of_service] Checks if user agreed with terms of service
user[avatar] The user avatar

Request

Headers

Accept: application/json
Content-Type: application/json
Access-Token: uTBvgfpzsTAfsPkKiB4r9g
Client: iZS4SEH4jxJEr_Dcw3AerA
Uid: cleora@feeney.com
Host: example.org
Cookie: 

Route

POST /v1/users

Body

{"user":{"name":"Daniel Santos","email":"ismael_runolfsdottir@schroeder.name","description":"Eius perferendis porro quasi quis quia et unde.","password":"12345678","password_confirmation":"12345678","terms_of_service":true,"avatar":""}}

cURL

curl "https://api.portalmec.c3sl.ufpr.br/v1/users" -d '{"user":{"name":"Daniel Santos","email":"ismael_runolfsdottir@schroeder.name","description":"Eius perferendis porro quasi quis quia et unde.","password":"12345678","password_confirmation":"12345678","terms_of_service":true,"avatar":""}}' -X POST \
	-H "Accept: application/json" \
	-H "Content-Type: application/json" \
	-H "Access-Token: uTBvgfpzsTAfsPkKiB4r9g" \
	-H "Client: iZS4SEH4jxJEr_Dcw3AerA" \
	-H "Uid: cleora@feeney.com"

Response

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Content-Type: application/json; charset=utf-8
Set-Cookie: _session_id=YkZCT2hENmZOZ1V0ZDhUN1pRWEN1M3B4c3BlR3d1bjdramg4TXFzSmhtZUNZc1RvYnBxZ2Y3VC80NVM2ZzZFSVgzMU1lRWpKV2hKQjhTZlpSVWtUYnBCcDRWOUxWYW5GeWN5UWpTMlkrNTJtVURnRFpQZlBoWHU5dU0zZ0MrTzVJVWJsWXpmK2Z5M09xOEVaaDc5eWJ1MUFBODlKMW1GNDh3Qy9Dbm55RVlGRXY1NEM2RTA4bXJkWlV0cUxRaUhGLS0zRFNLalB2dldZSWVGTUpBVURLTzh3PT0%3D--8c034c6676027fe074d789ac9b159ec07acac8c9; path=/; HttpOnly
Vary: Origin
ETag: W/"4d2bcc6d03712976bde2c4dc823db074"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 4087f0d3-9ecd-4201-af96-db9a25ac1464
X-Runtime: 0.130933
Content-Length: 716

Status

201 Created

Body

{
  "id": 9202,
  "email": "ismael_runolfsdottir@schroeder.name",
  "provider": "email",
  "cpf": null,
  "name": "Daniel Santos",
  "description": "Eius perferendis porro quasi quis quia et unde.",
  "submitter_request": "default",
  "education": null,
  "score": 0.0,
  "cover": "",
  "role_ids": [
    1
  ],
  "institution_ids": [

  ],
  "avatar": "",
  "dspace_url": null,
  "dspace_handle": null,
  "dspace_sets": [

  ],
  "likes_count": 0,
  "followed": false,
  "complained": false,
  "follows_count": 0,
  "learning_objects_count": 0,
  "collections_count": 0,
  "created_at": "2019-03-08T13:49:16.270Z",
  "updated_at": "2019-03-08T13:49:16.270Z",
  "terms_accepted_at": null,
  "school": null,
  "subjects": [

  ],
  "roles": [
    {
      "id": 1,
      "name": "teacher",
      "description": "This role represents a Teacher in Portal MEC."
    }
  ],
  "institutions": [

  ]
}