Request must be authenticated with a User having the manager
role, and a location_id
may be specified. HTTP response is the same as for show
action.
$ curl -i \ -H "Accept: application/json; version=1" \ -X POST \ -H 'Content-type: application/json' \ -d '{"user": { "username": "[email protected]", "password": "5up3r53kr37", "first_name": "John", "last_name": "Random" }}' \ https://api.record360.com/api/users HTTP/1.1 201 Created Content-Type: application/json; charset=utf-8 Cache-Control: max-age=0, private, must-revalidate { "auth_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIyIiwiaWF0IjoxNDY0MDQxODAzfQ.F33A91GOdYvXfe5fo-Sq3mL-dVGwCyeevd5sceuCLko", "user": { "id": "42", "username": "[email protected]", "first_name": "John", "last_name": "Random", "role": "user", "created_at": "2016-05-23T22:16:43.000Z", "updated_at": "2016-05-23T22:16:43.000Z", "location": { ... } } }
Param name | Description |
---|---|
user
required |
User attributes Validations:
|
user[username]
required |
Username or email address, must be globally unique Validations:
|
user[password]
required |
Password Validations:
|
user[first_name]
required |
First name Validations:
|
user[last_name]
required |
Last name Validations:
|
user[phone_number]
optional |
Phone number Validations:
|
user[active]
optional , nil allowed |
Account enabled? (manager only) Validations:
|
user[location_id]
optional , nil allowed |
Location ID (manager only) Validations:
|
user[external_id]
optional , nil allowed |
External ID (manager only) Validations:
|
user[role]
optional , nil allowed |
Role (manager only) Validations:
|