curl -X GET \
-H "QB-Token: fdb5f5a28388a64aba5b2f57570b13f827012bba" \
https://api.quickblox.com/users.json
{
"current_page": 1,
"per_page": 10,
"total_entries": 2,
"items": [
{
"user": {
"id": 96753878,
"full_name": "Peter Smith",
"email": "peter@gmail.com",
"login": "Peter",
"phone": "+73123555",
"website": "https://mysite.com",
"created_at": "2019-08-27T20:49:07Z",
"updated_at": "2019-09-01T12:23:08Z",
"last_request_at": "2019-08-29T20:48:14Z",
"external_user_id": 1236672,
"facebook_id": "15868",
"twitter_id": "9982366",
"blob_id": null,
"custom_data": "lead of marketing team",
"age_over16": true,
"allow_statistics_analysis": true,
"allow_sales_activities": true,
"parents_contacts": "",
"user_tags": "Marketing,seo"
}
},
{
"user": {
"id": 96754523,
"full_name": "Alex Miller",
"email": "alex@gmail.com",
"login": "Alex",
"phone": "+3123555",
"website": "https://mysite.com",
"created_at": "2019-08-27T21:08:55Z",
"updated_at": "2019-09-01T12:36:59Z",
"last_request_at": null,
"external_user_id": 126672,
"facebook_id": "5844",
"twitter_id": "982366",
"blob_id": null,
"custom_data": null,
"age_over16": true,
"allow_statistics_analysis": true,
"allow_sales_activities": true,
"parents_contacts": "",
"user_tags": "Android,web"
}
}
]
}
{
"errors": {
"base": [
"Users retrieving forbidden in admin panel, application settings. Setup it here https://admin.quickblox.com/apps/{app_id}/service/users/settings"
]
}
}
Users
List Users
Retrieve all users for a current app.
GET
/
users.json
curl -X GET \
-H "QB-Token: fdb5f5a28388a64aba5b2f57570b13f827012bba" \
https://api.quickblox.com/users.json
{
"current_page": 1,
"per_page": 10,
"total_entries": 2,
"items": [
{
"user": {
"id": 96753878,
"full_name": "Peter Smith",
"email": "peter@gmail.com",
"login": "Peter",
"phone": "+73123555",
"website": "https://mysite.com",
"created_at": "2019-08-27T20:49:07Z",
"updated_at": "2019-09-01T12:23:08Z",
"last_request_at": "2019-08-29T20:48:14Z",
"external_user_id": 1236672,
"facebook_id": "15868",
"twitter_id": "9982366",
"blob_id": null,
"custom_data": "lead of marketing team",
"age_over16": true,
"allow_statistics_analysis": true,
"allow_sales_activities": true,
"parents_contacts": "",
"user_tags": "Marketing,seo"
}
},
{
"user": {
"id": 96754523,
"full_name": "Alex Miller",
"email": "alex@gmail.com",
"login": "Alex",
"phone": "+3123555",
"website": "https://mysite.com",
"created_at": "2019-08-27T21:08:55Z",
"updated_at": "2019-09-01T12:36:59Z",
"last_request_at": null,
"external_user_id": 126672,
"facebook_id": "5844",
"twitter_id": "982366",
"blob_id": null,
"custom_data": null,
"age_over16": true,
"allow_statistics_analysis": true,
"allow_sales_activities": true,
"parents_contacts": "",
"user_tags": "Android,web"
}
}
]
}
{
"errors": {
"base": [
"Users retrieving forbidden in admin panel, application settings. Setup it here https://admin.quickblox.com/apps/{app_id}/service/users/settings"
]
}
}
Recipes
Filter users by multiple criteria
Filter users by multiple criteria
1
1. Set a filter
Use a
filter parameter to set a filter.Set a value type, search operator, and value to filter users by. You can set as many filters as you need.Here, the two filters are set:- The users are filtered by the
facebook_idfield with a value less than the50000. - The users are filtered by the
created_atfield with a value greater than the2019-08-27T21:08:55Z.
curl -X GET \
-H "QB-Token: da6be1483635df69b2993352d053c7aa8b012bba" \
https://api.quickblox.com/users.json?filter[]=number+facebook_id+lt+50000&filter[]=date+created_at+gt+2019-08-27T21:08:55Z
2
2. As a result, the API returns users filtered by two criteria.
- The users with the
facebook_idvalue less than the50000are returned. - The users with the
created_atvalue greater than the2019-08-27T21:08:55Zare returned.
curl -X GET \
-H "QB-Token: da6be1483635df69b2993352d053c7aa8b012bba" \
https://api.quickblox.com/users.json?filter[]=number+facebook_id+lt+50000&filter[]=date+created_at+gt+2019-08-27T21:08:55Z
Filter users by criteria
Filter users by criteria
1
1. Set a filter
Use a
filter parameter to set a filter.Set a value type, search operator, and value to filter users by.In this case, the users are filtered by the facebook_id with a value less than 50000.curl -X GET \
-H "QB-Token: fdb5f5a28388a64aba5b2f57570b13f827012bba" \
https://api.quickblox.com/users.json?filter[]=number+facebook_id+lt+50000&page=2&per_page=2&order=asc+date+created_at
2
2. As a result, the API returns users by the specified criteria.
The users with the
facebook_id value greater than 50000 are returned.curl -X GET \
-H "QB-Token: fdb5f5a28388a64aba5b2f57570b13f827012bba" \
https://api.quickblox.com/users.json?filter[]=number+facebook_id+lt+50000&page=2&per_page=2&order=asc+date+created_at
List users with API key
List users with API key
1
1. Use 'Authorization' header to pass API key
curl -X GET \
-H 'Content-Type: application/json' \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
https://api.quickblox.com/users.json
2
2. As a result, the API returns a list of users.
curl -X GET \
-H 'Content-Type: application/json' \
-H 'Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI' \
https://api.quickblox.com/users.json
created_at value is specified, the request will return only instances by the specified created_atvalue. Filters require an exact match of property values with an instance of the corresponding parameter value.
| Operator | Description |
|---|---|
| gt | Greater Than operator Types: number, string, date Applicable to fields: id, created_at, updated_at, last_request_at, external_user_id, facebook_id Example: filter[]=number+external_user_id+gt+33 filter[]=date+updated_at+gt+2019-05-23T18:07:19Z Will return users with external_user_id greater than 33. Will return users with updated_at greater than 2019-05-23T18:07:19Z. |
| lt | Less Than operator Types: number, string, date Applicable to fields: id, created_at, updated_at, last_request_at, external_user_id, facebook_id Example: filter[]=number+id+lt+85000 filter[]=date+last_request_at+lt+2019-05-23T18:07:19Z Will return users with IDs less than 85000. Will return users with last_request_at less than 2019-05-23T18:07:19Z. |
| ge | Greater or Equal to operator Types: number, string, date Applicable to fields: id, created_at, updated_at, last_request_at, external_user_id, facebook_id Example: filter[]=number+facebook_id+ge+34524 filter[]=date+last_request_at+ge+2019-05-23T18:07:19Z Will return users with facebook_id greater than or equal to 34524. Will return users with last_request_at greater than or equal to 2019-05-23T18:07:19Z. |
| le | Less or Equal to operator Types: number, string, date Applicable to fields: id, created_at, updated_at, last_request_at, external_user_id, facebook_id Example: filter[]=number+facebook_id+le+34524 filter[]=date+created_at+le+2019-05-23T18:07:19Z Will return users with facebook_id less than or equal 34524. Will return users with created_at less than or equal 2019-05-23T18:07:19Z. |
| eq | Equal to operator Types:number, string, date Applicable to fields: id, full_name, email, login, phone, created_at, updated_at, last_request_at, external_user_id, facebook_id Example: filter[]=number+facebook_id+eq+810 filter[]=string+email+eq+test@gmail.com filter[]=date+created_at+eq+2019-04-22 Will return a user with facebook_id equal to 810. Will return a user with email equal to test@gmail.com. Will return a user with created_at equal to 2019-04-22. |
| ne | Not Equal to operator Types: number, string, date Applicable to fields: id, full_name, email, login, phone, created_at, updated_at, last_request_at, external_user_id, facebook_id Example: filter[]=number+external_user_id +ne+810 filter[]=string+email+ne+test@gmail.com filter[]=date+created_at+ne+2019-04-22T19:07:19Z Will return users with external_user_id not equal to 810. Will return users with email not equal to test@gmail.com. Will return users with created_at not equal to 2019-04-22T19:07:19Z. |
| between | Contained Between values operator Types: number, string, date Applicable to fields: id, created_at, updated_at, last_request_at, external_user_id, facebook_id Example: filter[]=number+external_user_id+between+33,1000 filter[]=date+updated_at+between+2019-04-22T19:07:19Z,2019-04-23T11:04:03Z Will return users with external_user_id between 3 and 1000. Will return users with updated_at between 2019-04-22T19:07:19Z and 2019-04-23T11:04:03Z. |
| in | Contained IN array operator Types: number, string, date Applicable to fields: id, full_name, email, login, phone, created_at, updated_at, last_request_at, external_user_id, facebook_id Example: filter[]=number+external_user_id+in+33,555 filter[]=string+email+in+test@test.com,test@gmail.com filter[]=date+created_at+in+2019-04-22T19:07:19Z,2019-04-22T19:08:38Z Will return users with external_user_id 33 and 555. Will return users with email test@test.com and test@gmail.com. Will return users with created_at 2019-04-22T19:07:19Z and 2019-04-22T19:08:38Z. |
| Param | Possible values | Description |
|---|---|---|
| order | asc, desc | Types: string, number, date Applicable to fields: id, full_name, email, login, phone, website, created_at, updated_at, last_request_at, external_user_id Example: order=asc+date +last_request_at Will return users with the last_request_at sorted in the ascending order. |
Query Parameters
string
Review Search Operators section for more details.
string
Review Sort operators section for more details.
integer
default:"1"
Page of results to return.
integer
default:"10"
Number of records to return in one request. Min: 1. Max: 100.
Headers
string
required
A user session token. See Authentication page to learn more about the session token.
string
default:"ApiKey {your_api_key}"
required
API key from Dashboard. Expected format:
ApiKey {your_api_key}. Must be used either QB-Token or Authorization.Responses
200
200
curl -X GET \
-H "QB-Token: fdb5f5a28388a64aba5b2f57570b13f827012bba" \
https://api.quickblox.com/users.json
{
"current_page": 1,
"per_page": 10,
"total_entries": 2,
"items": [
{
"user": {
"id": 96753878,
"full_name": "Peter Smith",
"email": "peter@gmail.com",
"login": "Peter",
"phone": "+73123555",
"website": "https://mysite.com",
"created_at": "2019-08-27T20:49:07Z",
"updated_at": "2019-09-01T12:23:08Z",
"last_request_at": "2019-08-29T20:48:14Z",
"external_user_id": 1236672,
"facebook_id": "15868",
"twitter_id": "9982366",
"blob_id": null,
"custom_data": "lead of marketing team",
"age_over16": true,
"allow_statistics_analysis": true,
"allow_sales_activities": true,
"parents_contacts": "",
"user_tags": "Marketing,seo"
}
},
{
"user": {
"id": 96754523,
"full_name": "Alex Miller",
"email": "alex@gmail.com",
"login": "Alex",
"phone": "+3123555",
"website": "https://mysite.com",
"created_at": "2019-08-27T21:08:55Z",
"updated_at": "2019-09-01T12:36:59Z",
"last_request_at": null,
"external_user_id": 126672,
"facebook_id": "5844",
"twitter_id": "982366",
"blob_id": null,
"custom_data": null,
"age_over16": true,
"allow_statistics_analysis": true,
"allow_sales_activities": true,
"parents_contacts": "",
"user_tags": "Android,web"
}
}
]
}
{
"errors": {
"base": [
"Users retrieving forbidden in admin panel, application settings. Setup it here https://admin.quickblox.com/apps/{app_id}/service/users/settings"
]
}
}
Was this page helpful?