User¶
Regular users can be created and updated through the REST API.
POST /user/new¶
Creates a new user with the given details. A password must be provided and it must be at least 8 characters long.
Accepted parameters are:
email
(required, string, maximum 255 characters) the user’s emailpassword
(required, string, maximum 255 characters) the user’s passwordfirstName
(optional, string, maximum 64 characters) the user’s first namelastName
(optional, string, maximum 64 characters) the user’s last namephone
(optional, string, maximum 32 characters) the user’s mobile number
Note
Admin users cannot be created through these REST API.
Example request:
POST /user/new
{
"firstName": "Giovanni",
"lastName": "Satellite",
"email": "giovanni@example.com",
"phone": "0123456789",
"password": "abc123"
}
Example response:
{
"firstName": "Giovanni",
"lastName": "Satellite",
"email": "giovanni@example.com",
"phone": "0123456789",
"username": "giovanni@example.com"
}
PUT /user/me¶
Update the logged in user’s data. All details available should be sent on each update.
If password
is provided it will be updated, don’t send it unless you want to update it. Password must be at least 8
characters long.
Accepted parameters are:
firstName
(optional, string, maximum 64 characters) the user’s first namelastName
(optional, string, maximum 64 characters) the user’s last namephone
(optional, string, maximum 32 characters) the user’s mobile numberpassword
(optional, string, maximum 255 characters) the user’s password
Tip
Sending an empty password will cause a validation error. The password must be sent only if the user want to update it.
Note
Admin users cannot authenticate through the OAuth2 API and therefore they cannot retrieve or edit their details.
PUT /user/me
{
"firstName": "Giovanni",
"lastName": "Satellite",
"email": "giovanni@example.com",
"phone": "0123456789",
"password": "abc456"
}
Example response:
{
"firstName": "Giovanni",
"lastName": "Satellite",
"email": "giovanni@example.com",
"phone": "0123456789",
"username": "giovanni@example.com"
}
GET /user/me¶
Retrieve the details of the logged in user.
Note
Admin users cannot authenticate through the OAuth2 API and therefore they cannot retrieve or edit their details.
Example request:
GET /user/me
Example response:
{
"firstName": "Giovanni",
"lastName": "Satellite",
"email": "giovanni@example.com",
"phone": "0123456789",
"username": "giovanni@example.com"
}