REST API
- Overview
- Limits
- Errors
- GETGet Account Settings
- Authentication
- Users
- Ovevriew
- User Model
- POSTCreate User
- POSTCreate Token with API key
- DELDelete Token with API key
- DELFlush Tokens with API key
- GETList Users
- GETList Users by Full Name
- GETList Users by Tags
- GETGet User by ID
- GETGet User by Login
- GETGet User by Facebook ID
- GETGet User by Email
- GETGet User by External User ID
- PUTUpdate User
- DELDelete User by ID
- DELDelete User by External ID
- GETReset User Password
- Chat
- Content
- Push Notifications
- Custom Objects
- Address Book
- AI
Create User
Creates a new user.
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"
}
}
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
login
or email
. login
or email
. Headers
ApiKey {your_api_key}
. Must be used either QB-Token or Authorization.Responses
A successful response
An error response
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"
}
}
Was this page helpful?
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"
}
}