Recipes
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. 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. 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. 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.
The request can contain all, some or none of the optional parameters. Login, email, Facebook ID, and the external user ID should not be taken previously.
If you want to create a user with some content (for example, with an avatar) you have to create a blob first. The blob is the entity that is a file in a system. To learn how to create a blob, review this section .
You can assign tags to the user. The same tags can be used for any number of users.
Body Parameters
User login. Must be unique . Only one required: login
or email
.
User e-mail. Must be unique . Only one required: login
or email
.
ID of the file/blob. Generated automatically by the server after file/blob creation (for example, user photo).
ID of the user in the external system (External User ID .). Must be unique .
ID of the user’s Facebook account. Must be unique .
allow_statistics_analysis
Marketing info.
A user or application session token. See
Authentication page to learn more about session tokens. Must be used either QB-Token or Authorization.
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
A successful response allow_statistics_analysis
An error response Errors related to full name
Errors related to password
Errors related to Facebook ID
Errors related to external user ID
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"
}
}