Methods
-
staticQB.users.create(params, callback)
modules/qbUsers.js, line 178 -
Registers a new app user. Call this API to register a user for the app. You must provide either a user login or email address along with their password, passing both email address and login is permitted but not required(read more).
Name Type Description paramsobject Object of user's parameters. Name Type Description loginstring The user's login name. passwordstring The user's password for this app. emailstring The user's email address. full_namestring optional The user's full name. phonestring optional The user's phone number. websitestring optional The user's web address, or other url. facebook_idstring optional The user's facebook uid. twitter_idstring optional The user's twitter uid. blob_idnumber optional The id of an associated blob for this user, for example their photo. external_user_idnumber | string optional An uid that represents the user in an external user registry. tag_liststring | Array.<string> optional A comma separated list of tags associated with the user. Set up user tags and address them separately in your app. custom_datastring optional The user's additional info. callbackcreateUserCallback The createUserCallback function. -
staticQB.users.delete(params, callback)
modules/qbUsers.js, line 253 -
Remove a user from the app, {@linkhttps://docs.quickblox.com/docs/js-users#delete-user by user's id} or uid that represents the user in an external user registry.
Name Type Description paramsnumber | object An id of user to remove or object with external user id. Name Type Description externalnumber | string An id of user to remove or object with external user id. callbackdeleteUserCallback An uid that represents the user in an external user registry. Example
// parameter as user id: var params = 567831; // parameter as external user id: // var params = {'external': 'ebdf831abd12da4bcf12f22d'}; QB.users.delete(params, function(error, response) { if (error) { console.log(error); } else { console.log(response); } }); -
staticQB.users.get(params, callback)
modules/qbUsers.js, line 117 -
Retrieve a specific user or users.
Name Type Description paramsnumber | object User ID (number) or object of parameters (object with one of next required properties). Name Type Default Description loginstring The login of the user to be retrieved(read more). full_namestring The full name of users to be retrieved(read more). facebook_idstring The user's facebook uid. twitter_idstring The user's twitter uid. phonestring The user's phone number(read more). emailstring The user's email address(read more). tagsstring | Array.<string> A comma separated list of tags associated with users(read more). externalnumber | string An uid that represents the user in an external user registry(read more). pagestring 1 optional Used to paginate the results when more than one page of users retrieved (can be used with get by 'full_name' or 'tags'). per_pagestring 10 optional The maximum number of users to return per page, if not specified then the default is 10 (can be used with get by 'full_name' or 'tags'). callbackgetUsersCallback The getUsersCallback function. Example
var params = {'email': 'example-email@gmail.com'}; // for search by 'full_name' or 'tags': // var params = { // 'full_name': 'test_user', // 'page': 2, // 'per_page': 25 // }; // for search by user's ID: // var id = 53454; // use params or id to get records: QB.users.get(params, function(error, response) { if (error) { console.log(error); } else { console.log(response); } }); -
staticQB.users.listUsers(params, callback)
modules/qbUsers.js, line 37 -
Call this API to get a list of current users of you app. By default it returns upto 10 users, but you can change this by adding pagination parameters. You can filter the list of users by supplying a filter string. You can sort results by ask/desc(read more).
Name Type Description paramsobject Object of parameters. Name Type Default Description pagenumber 1 optional Used to paginate the results when more than one page of users retrieved. per_pagenumber 10 optional The maximum number of users to return per page, if not specified then the default is 10. filterstring optional You can filter the list of users by supplying a filter string. Possible operators: gt, lt, ge, le, eq, ne, between, in. Allowed fields' types: string,number,date. Allowed fields: id, full_name, email, login, phone, website, created_at, updated_at, last_request_at, external_user_id, twitter_id, twitter_digits_id, facebook_id (example: 'field_type+field_name+operator+value'). orderstring optional Parameter to sort results. Possible values: asc and desc. Allowed fields' types: string,number,date. Allowed fields: id, full_name, email, login, phone, website, created_at, updated_at, last_request_at, external_user_id, twitter_id, twitter_digits_id, facebook_id ('asc+date+created_at' (format is 'sort_type+field_type+field_name')). callbacklistUsersCallback The listUsersCallback function. -
staticQB.users.resetPassword(email, callback)
modules/qbUsers.js, line 279 -
You can initiate password resets for users who have emails associated with their account. Password reset instruction will be sent to this email address(read more).
Name Type Description emailstring The user's email to send reset password instruction. callbackresetPasswordByEmailCallback The resetPasswordByEmailCallback function. -
staticQB.users.update(id, params, callback)
modules/qbUsers.js, line 215 -
Update current user. In normal usage, nobody except the user is allowed to modify their own data. Any fields you don’t specify will remain unchanged, so you can update just a subset of the user’s data. login/email and password may be changed, but the new login/email must not already be in use(read more).
Name Type Description idnumber The id of user to update. paramsobject object of user's parameters. Name Type Description loginstring optional The user's login name. old_passwordstring optional The user's old password for this app. passwordstring optional The user's new password for this app. emailstring optional The user's email address. full_namestring optional The user's full name. phonestring optional The user's phone number. websitestring optional The user's web address, or other url. facebook_idstring optional The user's facebook uid. twitter_idstring optional The user's twitter uid. blob_idnumber optional The id of an associated blob for this user, for example their photo. external_user_idnumber | string optional An uid that represents the user in an external user registry. tag_liststring | Array.<string> optional A comma separated list of tags associated with the user. Set up user tags and address them separately in your app. custom_datastring optional The user's additional info. callbackupdateUserCallback The updateUserCallback function.