Users

Ask tech team
From QuickBlox Developers (API docs, code samples, SDK)
Jump to: navigation, search

Contents

Summary

The user module manages all things related to user accounts handling, authentication, account data, password reminding etc.

  • OAuth is secure and supports transparent authentication;
  • Password reminder and other typical user management tasks are managed automatically. Reminders and other technical messages are sent via Messages module;
  • Logging in users with their Facebook/Twitter/Twitter Digits accounts is available;
  • User tags – set up user tags and address them separately in your app or through the admin panel – supported by other modules such as Messages;
  • Existing user base integration – our module supports connection to your system by storing your existent IDs table and matching them to new ones.


Need to know information

Before using the Users module please read the following:



Users API

Requests and Responses

URL HTTP Verb Action Description Success HTTP Status Code
/users.json GET Retrieve API Users for current account 200
/users.json POST API User Sign Up 201
/users/{user_id}.json GET Show API User by identifier 200
/users/by_login.json GET Retrieve API User by login 200
/users/by_full_name.json GET Retrieve API Users by full name 200
/users/by_facebook_id.json GET Retrieve API User by Facebook identifier 200
/users/by_twitter_id.json GET Retrieve API User by Twitter identifier 200
/users/by_email.json GET Retrieve API User by email 200
/users/by_tags.json GET Retrieve API Users By Tags 200
/users/{user_id}.json PUT Update API User by identifier 200
/users/{user_id}.json DELETE Delete API User by identifier 200
/users/external/{external_user_id}.json GET Retrieve API User by external user id 200
/users/external/{external_user_id}.json DELETE Delete API User by external user id 200
/users/password/reset.json GET Reset API User password by e-mail 200


Retrieve all Users

Retrieve all API Users for current account.

Parameters

The request can contain all, some or none of these parameters.

Param Required Type Value Example Description
page No Unsigned Integer 3 Page number of the book of the results that you want to get. By default: 1
per_page No Unsigned Integer 15 The maximum number of results per page. Min: 1. Max: 100. By default: 10

Filters

The request can contain one of these filters.

Date format used for last_request_at, created_at and updated_at must be yyyy-mm-dd or yyyy.mm.dd

Param Operator Allowed types Allowed fields Value Example Description
filter[] gt number,string,date id,full_name,email,login,phone,website,created_at,updated_at,
last_request_at,external_user_id,twitter_id,facebook_id
number+id+gt+3 Will return users withs IDs greater than 3
filter[] lt number,string,date id,full_name,email,login,phone,website,created_at,updated_at,
last_request_at,external_user_id,twitter_id,facebook_id
number+id+lt+34 Will return users withs IDs less than 34
filter[] ge number,string,date id,full_name,email,login,phone,website,created_at,updated_at,
last_request_at,external_user_id,twitter_id,facebook_id
number+id+ge+445 Will return users withs IDs greater than or equal to 445
filter[] le number,string,date id,full_name,email,login,phone,website,created_at,updated_at,
last_request_at,external_user_id,twitter_id,facebook_id
number+id+le+2241 Will return users withs IDs less than or equal 2241
filter[] eq number,string,date id,full_name,email,login,phone,website,created_at,updated_at,
last_request_at,external_user_id,twitter_id,facebook_id
number+id+eq+3 Will return a user withs ID equal to 3
filter[] ne number,string,date id,full_name,email,login,phone,website,created_at,updated_at,
last_request_at,external_user_id,twitter_id,facebook_id
number+id+ne+3 Will return users withs IDs not equal to 3
filter[] between number,string,date id,full_name,email,login,phone,website,created_at,updated_at,
last_request_at,external_user_id,twitter_id,facebook_id
number+id+between
+3,2241
Will return users withs IDs between 3 and 2241
filter[] in number,string,date id,full_name,email,login,phone,website,created_at,updated_at,
last_request_at,external_user_id,twitter_id,facebook_id
number+id+in
+3,45,2241
Will return users withs IDs 3,45,2241

Sort

Param Possible values Allowed types Allowed fields Value Example Description
order asc/desc string/number/date id/full_name/email/login/phone/website/created_at/updated_at/
last_request_at/external_user_id/twitter_id/facebook_id
order=asc+date
+last_request_at
Sort by field

Request

curl -X GET \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: f1435baba523599662f3c5f125316073d112a5af" \
https://api.quickblox.com/users.json

Response

{
  "current_page": 1,
  "per_page": 10,
  "total_entries": 8,
  "items": [
    {
      "user": {
        "id": 87,
        "full_name": "John Partizan",
        "email": "john@domain.com",
        "login": "Kitty",
        "phone": "7665891",
        "website": "http://partizan.com",
        "created_at": "2012-03-20T08:47:34Z",
        "updated_at": "2012-05-09T08:25:33Z",
        "last_request_at": "2012-05-08T13:07:37Z",
        "external_user_id": 158,
        "facebook_id": "1346987743",
        "twitter_id": "545878645453",
        "twitter_digits_id": 23487743,
        "blob_id": null,
        "custom_data": null,
        "user_tags": "hello, world, hey"
      }
    },
  ...
  ]
}

User Sign Up

API User sign up. Use for the identification of the mobile applications users. The request can contain all, some or none of the optional parameters. Login, email, facebook ID, twitter ID and the external user ID should not be taken previously. If you want to create a user with a some content (f.e. with a photo) you have to create a blob firstly. The same tags can be used for any number of users.
Please note that trailing whitespaces in string data (except password) will be trimmed.

Parameters

Param Required Type Value Example Description
user[login] Yes* String mylogin API User login
user[password] Yes String mypassword API User password
user[email] Yes* String superuser@domain.com API User e-mail
user[blob_id] Optional Integer 412 ID of associated blob (for example, API User photo)
user[external_user_id] Optional Integer 21445 ID of API User in external system
user[facebook_id] Optional Integer 1000041 ID of API User in Facebook
user[twitter_id] Optional Integer 200655 ID of API User in Twitter
user[full_name] Optional String Captain Jack Full name
user[phone] Optional String 144556488 Phone
user[website] Optional String http://quickblox.com Website
user[custom_data] Optional String I'm at work now User's additional info
user[tag_list] Optional String tag1,tag2,tag3 Tags

* Only login OR email required

Request

curl -X POST \
-H "Content-Type: application/json" \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: cf5709d6013fdb7a6787fbeb8340afed8aec4c69" \
-d '{"user": {"login": "Lena", "password": "Lena", "email": "lena@domain.com", "external_user_id": "68764641", "facebook_id": "87964654", "twitter_id": "65765413614", "full_name": "Lena Laktionova", "phone": "87654351", "website": "http://lena.com", "tag_list": "name,age"}}' \
https://api.quickblox.com/users.json


Response

{
  "user": {
    "id": 1639,
    "full_name": "Lena Laktionova",
    "email": "lena@domain.com",
    "login": "Lena",
    "phone": "87654351",
    "website": "http://lena.com",
    "created_at": "2012-05-09T10:24:26Z",
    "updated_at": "2012-05-09T10:24:26Z",
    "last_request_at": "2012-05-09T10:24:26Z",
    "external_user_id": 68764641,
    "facebook_id": "87964654",
    "twitter_id": "65765413614",
    "twitter_digits_id": 23487743,
    "blob_id": null,
    "custom_data": null,
    "user_tags": "name, age"
  }
}


Show API User by identifier

Show API User.

Request

curl -X GET \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: 6f8c8931e80d0d828341ef218e95584ac48195db" \
https://api.quickblox.com/users/1326.json

Response

{
  "user": {
    "id": 1326,
    "full_name": "Sun Burn",
    "email": "sun@domain.com",
    "login": "Sun",
    "phone": "7665727",
    "website": "http://sun.com",
    "created_at": "2012-04-23T09:09:26Z",
    "updated_at": "2012-05-09T10:06:39Z",
    "last_request_at": "2012-05-09T10:04:50Z",
    "external_user_id": 28552,
    "facebook_id": "4561356",
    "twitter_id": "1653489",
    "twitter_digits_id": 23487743,
    "custom_data": null,
    "blob_id": null,
    "user_tags": "type, volume, name"
  }
}


Retrieve API User by login

Search API User by login

Parameters

Param Required Type Value Example Description
login Yes String mylogin API User login

Request

curl -X GET \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: 6f8c8931e80d0d828341ef218e95584ac48195db" \
https://api.quickblox.com/users/by_login.json?login=Flower

Response

{
  "user": {
    "id": 1635,
    "full_name": "Beautiful Flower",
    "email": "flower@domain.com",
    "login": "Flower",
    "phone": "374257547",
    "website": "http://flower.com",
    "created_at": "2012-05-09T10:19:39Z",
    "updated_at": "2012-05-09T10:27:16Z",
    "last_request_at": "2012-05-09T10:27:16Z",
    "external_user_id": 7845636,
    "facebook_id": "6357372",
    "twitter_id": "67967327",
    "twitter_digits_id": 23487743,
    "blob_id": null,
    "custom_data": null,
    "user_tags": "type, name"
  }
}


Retrieve API Users by full name

Search API Users by full name

Parameters

Param Required Type Value Example Description
full_name Yes String Mike Senior API User full name
page No Unsigned Integer 3 Page number of the book of the results that you want to get. By default: 1
per_page No Unsigned Integer 15 The maximum number of results per page. Min: 1. Max: 100. By default: 10

Request

curl -X GET 
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: c9c18b1a2e7768027458e594583ea1a434707203" \
https://api.quickblox.com/users/by_full_name.json?full_name=Double%20Cloud

Response

{
  "current_page": 1,
  "per_page": 10,
  "total_entries": 1,
  "items": [
    {
      "user": {
        "id": 796,
        "full_name": "Double Cloud",
        "email": "cloud111@domain.com",
        "login": "Cloud111",
        "phone": "78767356",
        "website": "http://cloud.com",
        "created_at": "2012-05-09T09:33:05Z",
        "updated_at": "2012-05-09T09:33:05Z",
        "last_request_at": "2012-05-09T09:33:05Z",
        "external_user_id": 283312311,
        "facebook_id": "1852657311",
        "twitter_id": "2376876111",
        "twitter_digits_id": 23487743,
        "blob_id": null,
        "custom_data": null,
        "user_tags": "aaa"
      }
    }
  ]
}


Retrieve API User by Facebook identifier

Search API User by Facebook identifier

Parameters

Param Required Type Value Example Description
facebook_id Yes Integer 10000445 API User Facebook ID

Request

curl -X GET \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: f1435baba523599662f3c5f125316073d112a5af" \
https://api.quickblox.com/users/by_facebook_id.json?facebook_id=1346987743

Response

{
  "user": {
    "id": 87,
    "full_name": "John Partizan",
    "email": "john@domain.com",
    "login": "Kitty",
    "phone": "7665891",
    "website": "http://partizan.com",
    "created_at": "2012-03-20T08:47:34Z",
    "updated_at": "2012-05-10T09:21:19Z",
    "last_request_at": "2012-05-10T09:21:19Z",
    "external_user_id": 158,
    "facebook_id": "1346987743",
    "twitter_id": "545878645453",
    "twitter_digits_id": 23487743,
    "blob_id": null,
    "custom_data": null,
    "user_tags": "hello, world, hey"
  }
}


Retrieve API User by Twitter identifier

Retrieve a User by Twitter identifier

Parameters

Param Required Type Value Example Description
twitter_id Yes Integer 100500 API User Twitter ID

Request

curl -X GET \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: c9c18b1a2e7768027458e594583ea1a434707203" \
https://api.quickblox.com/users/by_twitter_id.json?twitter_id=123456

Response

{
  "user": {
    "id": 798,
    "full_name": "Ivan Tkachenko",
    "email": "ivan@domain.com",
    "login": "Ivan",
    "phone": "123123",
    "website": "http://ivan.com",
    "created_at": "2012-05-10T09:41:19Z",
    "updated_at": "2012-05-10T09:41:19Z",
    "last_request_at": "2012-05-10T09:41:19Z",
    "external_user_id": 123456,
    "facebook_id": "123456",
    "twitter_id": "123456",
    "twitter_digits_id": 23487743,
    "blob_id": null,
    "custom_data": null,
    "user_tags": "university, department"
  }
}


Retrieve API User by Twitter Digits identifier

Retrieve a User by Twitter Digits identifier

Parameters

Param Required Type Value Example Description
twitter_digits_id Yes Integer 100500 API User Twitter Digits ID

Request

curl -X GET \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: c9c18b1a2e7768027458e594583ea1a434707203" \
https://api.quickblox.com/users/by_twitter_digits_id.json?twitter_digits_id=1653489

Response

{
  "user": {
    "id": 798,
    "full_name": "Ivan Tkachenko",
    "email": "ivan@domain.com",
    "login": "Ivan",
    "phone": "123123",
    "website": "http://ivan.com",
    "created_at": "2012-05-10T09:41:19Z",
    "updated_at": "2012-05-10T09:41:19Z",
    "last_request_at": "2012-05-10T09:41:19Z",
    "external_user_id": 123456,
    "facebook_id": "123456",
    "twitter_id": "123456",
    "twitter_digits_id": 1653489,
    "blob_id": null,
    "custom_data": null,
    "user_tags": "university, department"
  }
}


Retrieve API User by email

Retrieve API User by email

Parameters

Param Required Type Value Example Description
email Yes String mike@senior.com API User email

Request

curl -X GET \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: 61bbb37dee2b7547f647cc269c4083f1a1ce37a7" \
https://api.quickblox.com/users/by_email.json?email=ivan@domain.com

Response

{
  "user": {
    "id": 798,
    "full_name": "Ivan Tkachenko",
    "email": "ivan@domain.com",
    "login": "Ivan",
    "phone": "123123",
    "website": "http://ivan.com",
    "created_at": "2012-05-10T09:41:19Z",
    "updated_at": "2012-05-10T09:41:19Z",
    "last_request_at": "2012-05-10T09:41:19Z",
    "external_user_id": 123456,
    "facebook_id": "123456",
    "twitter_id": "123456",
    "twitter_digits_id": 23487743,
    "blob_id": null,
    "custom_data": null,
    "user_tags": "university, department"
  }
}


Retrieve API Users by tags

Search API Users by tags

Parameters

Param Required Type Value Example Description
tags Yes String tag1,tag2,tag3 API User tag(s) The maximum number of tags per user: 5.
page No Unsigned Integer 3 Page number of the book of the results that you want to get. By default: 1
per_page No Unsigned Integer 15 The maximum number of results per page. Min: 1. Max: 100. By default: 10

Request

curl -X GET \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: 3391435dc93a22fc3d864a16e8026f60417379ef" \
https://api.quickblox.com/users/by_tags.json?tags=type

Response

{
  "current_page": 1,
  "per_page": 10,
  "total_entries": 2,
  "items": [
    {
      "user": {
        "id": 781,
        "full_name": "Double Cloud",
        "email": "cloud@domain.com",
        "login": "Cloud",
        "phone": "78767356",
        "website": "http://cloud.com",
        "created_at": "2012-05-09T08:47:41Z",
        "updated_at": "2012-05-09T08:47:41Z",
        "last_request_at": "2012-05-09T08:47:41Z",
        "external_user_id": 283452,
        "facebook_id": "8526573",
        "twitter_id": "2376876",
        "twitter_digits_id": 23487743,
        "blob_id": null,
        "custom_data": null,
        "user_tags": "type, volume"
      }
    },
  ...
  ]
}


Retrieve API User by external user id

Retrieve API User by external user id

Request

curl -X GET \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: 3391435dc93a22fc3d864a16e8026f60417379ef" \
https://api.quickblox.com/users/external/158.json

Response

{
  "user": {
    "id": 87,
    "full_name": "John Partizan",
    "email": "john@domain.com",
    "login": "Kitty",
    "phone": "7665891",
    "website": "http://partizan.com",
    "created_at": "2012-03-20T08:47:34Z",
    "updated_at": "2012-05-10T09:21:19Z",
    "last_request_at": "2012-05-10T09:21:19Z",
    "external_user_id": 158,
    "facebook_id": "1346987743",
    "twitter_id": "545878645453",
    "twitter_digits_id": 23487743,
    "blob_id": null,
    "custom_data": null,
    "user_tags": "hello, world, hey"
  }
}


Update API User by identifier

Update API User by identifier

Parameters

Param Required Type Value Example Description
user[login] Optional String mylogin API User login
user[blob_id] Optional Integer 412 ID of associated blob (for example, API User photo)
user[email] Optional String superuser@domain.com API User e-mail
user[external_user_id] Optional Integer 21445 ID of API User in external system
user[facebook_id] Optional Integer 1000041 ID of API User in Facebook
user[twitter_id] Optional Integer 200655 ID of API User in Twitter
user[full_name] Optional String Captain Jack Full name
user[phone] Optional String 144-556488 Phone
user[website] Optional String http://quickblox.com Website
user[tag_list] Optional String tag1,tag2,tag3 Tags
user[custom_data] Optional String I'm at work now User's additional information
user[password] Optional String newsupersecure New password
user[old_password] Optional String oldpassword Old user password (required only if new password provided)

Request

curl -X PUT \
-H "Content-Type: application/json" \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: 7483d80bb9caddd504764d85b050c85755aecc84" \
-d '{"user": {"full_name": "Tkach", "email": "ivanko@domain.com"}}' \
https://api.quickblox.com/users/1328.json

Response

{
  "user": {
    "id": 798,
    "full_name": "Tkach",
    "email": "ivanko@domain.com",
    "login": "Ivan",
    "phone": "123123",
    "website": "http://ivan.com",
    "created_at": "2012-05-10T09:41:19Z",
    "updated_at": "2012-05-10T15:21:07Z",
    "last_request_at": "2012-05-10T15:19:55Z",
    "external_user_id": 123456,
    "facebook_id": "123456",
    "twitter_id": "123456",
    "twitter_digits_id": 23487743,
    "blob_id": null,
    "custom_data": null,
    "user_tags": "university, department"
  }
}


Delete API User by identifier

Delete API User by identifier. User can delete only himself.

Request

curl -X DELETE \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: b284ddf44f5369611fe14e0e588f1cfa855116c8" \
https://api.quickblox.com/users/36.json


Response

Status: 200, null


Delete API User by external user id

Delete API User by external user id

Request

curl -X DELETE \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: b284ddf44f5369611fe14e0e588f1cfa855116c8" \
https://api.quickblox.com/users/external/697.json

Response

Empty body, status: 200


Reset API User password by e-mail

Parameters

Param Required Type Value Example Description
email Required String usermail@quickblox.com API User e-mail

Request

curl -X GET \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-H "QB-Token: b284ddf44f5369611fe14e0e588f1cfa855116c8" \
https://api.quickblox.com/users/password/reset.json?email=usermail@quickblox.com

Response

Status: 200, empty body