curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: cf5709d6013fdb7a6787fbeb8340afed8aec4c69" \
-d '{
"user":{
"login":"Peter",
"password":"!Peter009",
"email":"peter@gmail.com",
"external_user_id":1236672,
"facebook_id":"8887366",
"full_name":"Peter Smith",
"phone":"+73123555",
"website":"https://mysite.com",
"tag_list":"marketing,seo",
"custom_data":"lead of marketing team"
}
}' \
https://api.quickblox.com/users.json
{
"user": {
"id": 96752798,
"full_name": "Peter Smith",
"email": "peter@gmail.com",
"login": "Peter",
"phone": "+73123555",
"website": "https://mysite.com",
"created_at": "2019-08-27T20:19:08Z",
"updated_at": "2019-08-27T20:19:08Z",
"last_request_at": null,
"external_user_id": 1236672,
"facebook_id": "8887366",
"blob_id": null,
"custom_data": "lead of marketing team",
"age_over16": false,
"allow_statistics_analysis": false,
"allow_sales_activities": false,
"parents_contacts": "",
"user_tags": "marketing,seo"
}
}
{
"code": null,
"message": "No data was provided"
}
{
"errors": {
"full_name": [
"is invalid",
"is too long (maximum is 200 characters)"
],
"email": [
"should look like an email address"
],
"login": [
"has already been taken"
],
"password": [
"is too short (minimum is 8 characters)"
],
"facebook_id": [
"should be hexadecimal or decimal number"
],
"external_user_id": [
"must be less than 4 bytes"
],
"phone": [
"is not a number"
]
}
}
Users
Create User
Creates a new user.
POST
/
users.json
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: cf5709d6013fdb7a6787fbeb8340afed8aec4c69" \
-d '{
"user":{
"login":"Peter",
"password":"!Peter009",
"email":"peter@gmail.com",
"external_user_id":1236672,
"facebook_id":"8887366",
"full_name":"Peter Smith",
"phone":"+73123555",
"website":"https://mysite.com",
"tag_list":"marketing,seo",
"custom_data":"lead of marketing team"
}
}' \
https://api.quickblox.com/users.json
{
"user": {
"id": 96752798,
"full_name": "Peter Smith",
"email": "peter@gmail.com",
"login": "Peter",
"phone": "+73123555",
"website": "https://mysite.com",
"created_at": "2019-08-27T20:19:08Z",
"updated_at": "2019-08-27T20:19:08Z",
"last_request_at": null,
"external_user_id": 1236672,
"facebook_id": "8887366",
"blob_id": null,
"custom_data": "lead of marketing team",
"age_over16": false,
"allow_statistics_analysis": false,
"allow_sales_activities": false,
"parents_contacts": "",
"user_tags": "marketing,seo"
}
}
{
"code": null,
"message": "No data was provided"
}
{
"errors": {
"full_name": [
"is invalid",
"is too long (maximum is 200 characters)"
],
"email": [
"should look like an email address"
],
"login": [
"has already been taken"
],
"password": [
"is too short (minimum is 8 characters)"
],
"facebook_id": [
"should be hexadecimal or decimal number"
],
"external_user_id": [
"must be less than 4 bytes"
],
"phone": [
"is not a number"
]
}
}
Recipes
Create user with API key
Create user with API key
1
1. Use 'Authorization' header to pass API key
curl -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-d '{
"user": {
"login": "johndoe",
"password":"quickblox",
"full_name": "John Doe"
}
}' \
https://api.quickblox.com/users.json
2
2. Use a `user` parameter to create a new user
curl -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-d '{
"user": {
"login": "johndoe",
"password":"quickblox",
"full_name": "John Doe"
}
}' \
https://api.quickblox.com/users.json
3
3. Set values for the fields
curl -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-d '{
"user": {
"login": "johndoe",
"password":"quickblox",
"full_name": "John Doe"
}
}' \
https://api.quickblox.com/users.json
4
4. As a result, the API returns a created user
curl -X POST \
-H 'Content-Type: application/json' \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
-d '{
"user": {
"login": "johndoe",
"password":"quickblox",
"full_name": "John Doe"
}
}' \
https://api.quickblox.com/users.json
Trailing whitespaces in string data (except for the password) will be trimmed.
Body Parameters
object
required
Show properties
Show properties
string
required
User login. Must be unique. Only one required:
login or email. string
required
User e-mail. Must be unique. Only one required:
login or email. string
required
User password.
integer
ID of the file/blob. Generated automatically by the server after file/blob creation (for example, user photo).
integer
ID of the user in the external system (.). Must be unique.
string
ID of the user’s Facebook account. Must be unique.
string
User’s full name.
string
User’s phone.
string
User’s website.
string
User’s additional info.
string
User tags.
boolean
deprecated
boolean
deprecated
boolean
deprecated
string
deprecated
Headers
string
required
A user or application session token. See Authentication page to learn more about session tokens. Must be used either QB-Token or Authorization.
string
default:"ApiKey {your_api_key}"
required
API key from Dashboard. Expected format:
ApiKey {your_api_key}. Must be used either QB-Token or Authorization.Responses
201
201
422
422
An error response
object
Show properties
Show properties
array of strings
Errors related to full name
array of strings
Errors related to email
array of strings
Errors related to login
array of strings
Errors related to password
array of strings
Errors related to Facebook ID
array of strings
Errors related to external user ID
array of strings
Errors related to phone number
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: cf5709d6013fdb7a6787fbeb8340afed8aec4c69" \
-d '{
"user":{
"login":"Peter",
"password":"!Peter009",
"email":"peter@gmail.com",
"external_user_id":1236672,
"facebook_id":"8887366",
"full_name":"Peter Smith",
"phone":"+73123555",
"website":"https://mysite.com",
"tag_list":"marketing,seo",
"custom_data":"lead of marketing team"
}
}' \
https://api.quickblox.com/users.json
{
"user": {
"id": 96752798,
"full_name": "Peter Smith",
"email": "peter@gmail.com",
"login": "Peter",
"phone": "+73123555",
"website": "https://mysite.com",
"created_at": "2019-08-27T20:19:08Z",
"updated_at": "2019-08-27T20:19:08Z",
"last_request_at": null,
"external_user_id": 1236672,
"facebook_id": "8887366",
"blob_id": null,
"custom_data": "lead of marketing team",
"age_over16": false,
"allow_statistics_analysis": false,
"allow_sales_activities": false,
"parents_contacts": "",
"user_tags": "marketing,seo"
}
}
{
"code": null,
"message": "No data was provided"
}
{
"errors": {
"full_name": [
"is invalid",
"is too long (maximum is 200 characters)"
],
"email": [
"should look like an email address"
],
"login": [
"has already been taken"
],
"password": [
"is too short (minimum is 8 characters)"
],
"facebook_id": [
"should be hexadecimal or decimal number"
],
"external_user_id": [
"must be less than 4 bytes"
],
"phone": [
"is not a number"
]
}
}
Was this page helpful?