Learn how to manage your users with QuickBlox.
signUp()
method.
Create a user using the code snippet below. Only login (or email) and password are required. Other fields are optional.
users(withExtendedRequest:page:)
method. The code snippet below shows how to get a list of users created between the two given dates and sorted in descending order.
Argument | Required | Description |
---|---|---|
extendedRequest | yes | A dictionary that stores keys and values of the String type. |
page | no | If you want to get a paginated list of users from the server, you can set the following fields of the page:- currentpage is a number of pages with results to be returned.- perPage is a number of records to return in one page. |
Search operators | Applicable to types | Applicable to fields | Description |
---|---|---|---|
lt | number, string, date | id, created_at, updated_at, last_request_at, external_user_id, facebook_id | Less Than operator. |
gt | number, string, date | id, created_at, updated_at, last_request_at, external_user_id, facebook_id | Greater Than operator. |
gte | number, string, date | id, created_at, updated_at, last_request_at, external_user_id, facebook_id | Greater Than or Equal to operator. |
le | number, string, date | id, created_at, updated_at, last_request_at, external_user_id, facebook_id | Less or Equal to operator |
eq | number, string, date | id, full_name, email, login, phone, created_at, updated_at, last_request_at, external_user_id, facebook_id | Equal to operator. |
ne | number, string, date | id, full_name, email, login, phone, created_at, updated_at, last_request_at, external_user_id, facebook_id | Not Equal to operator. |
between | number, string, date | id, created_at, updated_at, last_request_at, external_user_id, facebook_id | Contained between values operator. |
in | number, string, date | id, full_name, email, login, phone, created_at, updated_at, last_request_at, external_user_id, facebook_id | IN array operator. |
created_at
field.
Sort operator | Applicable to types | Applicable to fields | Description |
---|---|---|---|
asc | All types | id, full_name, email, login, phone, website, created_at, updated_at,last_request_at, external_user_id | Search results will be sorted in ascending order by the specified field. |
desc | All types | id, full_name, email, login, phone, website, created_at, updated_at,last_request_at, external_user_id | Search results will be sorted in descending order by the specified field. |
ExternalID
field) in QBUser
model to link users from QuickBlox with users from your external database.
updateUser()
method. If you want to change your password, you need to provide 2 parameters: password
and oldPassword
. The updated user entity will be returned.
null
into the user’s password
field if you do not want to change your password, otherwise, you will need to add the user’s old password to the oldPassword
field.updateUser()
method. Thus, the snippet below shows how to update a tagList
and customData
fields.
Field | Required | Description |
---|---|---|
tags | no | User tags. An array of Strings. A tag must include alphabetic characters only. The tag must be at least 3 and no more than 15 characters long. There are no spaces in the tag format. For example, the “tagOne” format is correct while the “tag one” format is incorrect. The maximum number of tags is 10. If more than 10 tags are provided, an error is returned: tag list should contain maximum 10 tags. |
customData | no | User custom data. Should be a String. You can convert any data types to String, or example, JSON, XML, etc. |
tUploadFile(fileName:contentType:isPublic:)
method. In the response, the uploadedBlob
object is returned by the server. Get the blob UID from the uploadedBlob
object.
To connect the file to the user, set the blob UID in the customData
field of the user
model and call the updateCurrentUser()
method. As a result, the user avatar gets updated.
updateCurrentUser()
method.
Argument | Required | Description |
---|---|---|
parameters | yes | Specifies parameters fields that should be set. |
downloadFile(withUID:)
method.
Argument | Required | Description |
---|---|---|
avatarUID | yes | Blob unique identifier. |