Signup
Creates a new account
info
username
field must be unique and valid (valid characters are: a-z A-Z 0-9 _-).
info
Only users with the admin role can register new users.
info
This operation requires admin role.
HTTP Request
POST /api/v2/sso/signup/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
ext_id | body | integer | false | A unique external id identifying the user |
username | body | string | true | The username of the user. Max 255 characters. Letters, numbers and -/_ characters |
body | string | false | The email of the user. | |
password | body | string | false | The password of the user. If passed, the password must be at least 8 characters (max 128 chararacters) and it must contains at least 3 of the following 4 types of characters: lower case letters, upper case letters, numbers and special characters (eg !@#$%^&) |
avatar | body | url | false | The avatar of the user |
role | body | string¦null | false | Role of the user; it can be: admin, moderator, editor |
tags | body | list(integer)¦null | false | List of tags id |
Example Body Parameters
- JSON
- YAML
{
"ext_id": "integer",
"username": "string",
"role": "string",
"tags": ["integer"]
}
ext_id: integer
username: string
role: string
tags:
- "integer"
Example Request
- JavaScript
- Bash
- Python
const inputBody = '{
"username": "string",
"ext_id": "integer"
}';
const headers = {
'Authorization':'Bearer {access_token}',
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('/api/v2/sso/signup/',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X POST /api/v2/sso/signup/ \
-H 'Authorization: Bearer {access_token}'
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
-d '{
"username": "string",
"ext_id": "integer"
}'
import requests
headers = {
'Authorization': 'Bearer {access_token}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
payload = '{"username": "string","ext_id": "integer"}'
r = requests.post('/api/v2/sso/signup/', headers = headers, data = payload)
print(r.json())
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Response status code | Inline |
Response Schema
Status Code 201
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» id | integer | true | none | The unique internal id associated to the created user |
» ext_id | integer¦null | true | none | A unique external id identifying the user |
» username | string | true | none | Username of the registered user |
string | false | none | Email of the registered user | |
» role | string¦null | false | none | Role of the user; it can be: admin, moderator, editor |
» tags | ["integer"]¦null | false | none | List of tags id |
Example responses
- 200
{
"id": "integer",
"ext_id": "integer",
"username": "string",
"role": "string",
"tags": ["integer"]
}