GET
/
data
/
{class_name}
.json
curl -X GET \
-H "Content-Type: application/json" \
-H "QB-Token: 0bea0abd041b2431e5e1c2d0b06fab4414012bba" \
https://api.quickblox.com/data/ScoreTable.json?score_value[lt]=1000
{
  "class_name": "ScoreTable",
  "skip": 0,
  "limit": 100,
  "items": [
    {
      "_id": "5d866a5aa0eb4753fc6099c3",
      "_parent_id": null,
      "completed_levels": [
        1,
        2,
        3,
        10,
        11,
        12,
        13
      ],
      "created_at": 1569090138,
      "date": "2019-09-21T21:21:00Z",
      "expert_mode": false,
      "game_mode_name": "beta testing4",
      "progress": 0.12,
      "score_value": 665,
      "updated_at": 1569177165,
      "user_avatar": null,
      "user_id": 96753878,
      "user_location": [
        11.13,
        45.52
      ]
    }
  ]
}

Recipies

If you are sorting records by time, use the _id field. It is indexed and will be much faster than the created_at field.

Combinations of operators are allowed. For example:
score_value[gt]=100&score_value[lt]=1000&game_mode_name[in]=deathmatch,ctf

Search Operators

The request can contain all, some or none of the next search operators:

OperatorDescription
ltLess Than operator

Types: integer, float

Example:
score_value[lt]=1000
lteLess Than or Equal to operator

Types: integer, float

Example:
score_value[lte]=850
gtGreater Than operator

Types: integer, float

Example:
bonus_count[gt]=2.45
gteGreater Than or Equal to operator

Types: integer, float

Example:
bonus_count[gte]=56.443
neNot Equal to operator

Types: integer, float, string, boolean

Example:
game_mode_name[ne]=ctf
inContained IN array operator

Types: integer, float, string

Example:
game_mode_name[in]=deathmatch,rage
ninNot contained IN array operator

Types: integer, float, string

Example:
game_mode_name[nin]=survivor,crazy_nightmare
allALL contained IN array operator

Types: array

Example:
game_modes[all]=survivor,crazy
orOR operator

Types: integer, float, string

Example:
name[or]=sam,tim
name[or]=sam&lastname[or]=johnson

Will return records with name sam or tim.

Will return records with name sam or last name johnson.
ctnContains substring operator

Types: string

Example:
username[ctn]=son

Will return all records where username field contains son substring.
nearTypes: location

Example:
mylocation[near]=25.32,44.551;1000

Search records in a specific radius with
the current position in meters.
Format: {field_name}[near]=longitude,latitude;radius.

Sort Operators

Next sorting operators are allowed:

OperatorDescription
sort_ascTypes: all types

Example:
sort_asc=field_name

Search results will be sorted by the specified field in ascending order.
sort_descTypes: all types

Example:
sort_desc=field_name

Search results will be sorted by the specified field in descending order.

Aggregation Operators

OperatorDescription
{field_name}[calc]=Types: integer,
float

Example:
rating[calc]=min

avg, min, max, sum can be used with group_by operator.
group_by={field_name}Types: integer, float, string, boolean

Example:
group_by=game_mode_name

The group_by works similarly to the SQL GROUP BY operator, should be used with the calc operator.

Path Parameters

class_name
string
required

Custom object class name.

Query Parameters

{custom_field_N}
string

Search records with the field that contains the specified value. Can be many 1..N.

{custom_field_N}[{search_operator}]
string

Search a record with the field that contains a value according to the specified value and operator.

limit
integer
default:"100"

Limit search results to N records. Useful for pagination.

skip
integer
default:"0"

Skip N records in search results. Useful for pagination.

count
integer

Count search results. Response will contain only count of records found.

sort_desc
string

Search results will be sorted by specified field in descending order.

sort_asc
string

Search results will be sorted by specified field in ascending order.

output[include]
string

The output parameter takes the form of a record with a list of fields for inclusion or exclusion from the result set. output[include] specifies the fields to include. The _id field is, by default, included in the result set. To exclude the _id field from the result set, you need to specify the exclusion of the _id field in the output[exclude] value.

output[exclude]
string

The output parameter takes the form of a record with a list of fields for inclusion or exclusion from the result set. output[exclude] specifies the fields to exclude. The _id field is, by default, included in the result set. To exclude the _id field from the result set, you need to specify the exclusion of the _id field in the output[exclude] value.

Headers

QB-Token
string
required
A user or application session token. See our Authentication page to learn more about session tokens. Must be used either QB-Token or Authorization.

Response

curl -X GET \
-H "Content-Type: application/json" \
-H "QB-Token: 0bea0abd041b2431e5e1c2d0b06fab4414012bba" \
https://api.quickblox.com/data/ScoreTable.json?score_value[lt]=1000
{
  "class_name": "ScoreTable",
  "skip": 0,
  "limit": 100,
  "items": [
    {
      "_id": "5d866a5aa0eb4753fc6099c3",
      "_parent_id": null,
      "completed_levels": [
        1,
        2,
        3,
        10,
        11,
        12,
        13
      ],
      "created_at": 1569090138,
      "date": "2019-09-21T21:21:00Z",
      "expert_mode": false,
      "game_mode_name": "beta testing4",
      "progress": 0.12,
      "score_value": 665,
      "updated_at": 1569177165,
      "user_avatar": null,
      "user_id": 96753878,
      "user_location": [
        11.13,
        45.52
      ]
    }
  ]
}