The QuickBlox Developer Hub

Welcome to the QuickBlox developer hub. You'll find comprehensive guides and documentation to help you start working with QuickBlox as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

This is our new documentation for beta version of QuickBlox React Native SDK. Please contact our Customer Support Team to provide your feedback, suggestions, and requests to improve this page.

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

Create user

Create a user using the code snippet below. Only login (or email) and password are required. Other fields are optional.

QB.users
  .create({
    email: '[email protected]',
    fullName: 'Jack Sparrow',
    login: 'jack',
    password: 'jackpassword',
    phone: '404-388-5366',
    tags: [ '#awesome', '#quickblox' ]
  })
  .then(function (user) {
    // user created successfully
  })
  .catch(function (e) {
    // handle as necessary
  });

Update user

Update a user profile using the following code snippet. If you want to change your password, you need to provide 2 parameters: password and newPassword. The updated user entity will be returned.

user.fullName = "Monro";
user.email = "monr[email protected]";
 
QB.users
  .update({ user: user })
  .then(function (updatedUser) {
    // update local user with updated one
  })
  .catch(function (e) {
    // handle error
  });

Retrieve users

Retrieve users by ID

To get a list of users by ID for a current account, use the following code snippet.

const occupantsIds = dialog.occupantsIds;
const filter = {
  field: QB.users.USERS_FILTER.FIELD.ID,
  type: QB.users.USERS_FILTER.TYPE.NUMBER,
  operator: QB.users.USERS_FILTER.OPERATOR.IN,
  value: occupantsIds.join()
};

QB.users
  .getUsers({ filter: filter })
  .then(function (result) {
    // result.users - array of users found by provided IDs
    // result.page - page of results
    // result.perPage - how much items returned per page
    // result.total - total amount of items
  })
  .catch(function (e) {
    // handle error
  });

Retrieve users by full name

To get a list of users by full name for a current account, use the following code snippet.

const filter = {
  field: QB.users.USERS_FILTER.FIELD.FULL_NAME,
  operator: QB.users.USERS_FILTER.OPERATOR.IN,
  type: QB.users.USERS_FILTER.TYPE.STRING,
  value: 'filter'
};

QB.users
  .getUsers({ filter: filter })
  .then(function (result) {
    // users found
  })
  .catch(function (e) {
    // handle error
  });

Updated 8 days ago


What's Next

Chat

Users


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.