PUT
/
data
/
{class_name}
/
{custom_object_record_id}
.json
curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-token: c8d706877dc40c4f56f8be618dda898456013152" \
-d '{
  "game_mode_name":"rainbow dash",
}' \
https://api.quickblox.com/data/ScoreTable/5f60e245a28f9a78e6c07322.json \
{
  "_id": "5f60e245a28f9a78e6c07322",
  "_parent_id": null,
  "created_at": 1600184901,
  "expert_mode": null,
  "game_mode_name": "rainbow dash",
  "name": null,
  "progress": 0,
  "score_value": null,
  "updated_at": 1600184901,
  "user_id": 102433734,
  "permissions": {
    "read": {
      "access": "open"
    },
    "update": {
      "access": "owner"
    },
    "delete": {
      "access": "owner"
    }
  }
}

Recipes

To update the existing record you should know the record ID and use a PUT request with application/json or application/x-www-form-urlencoded content type of PUT/POST body. Received values will be casted according to the class defined in QuickBlox Dashboard.

A field that is present in class but not specified in the PUT request has a null value. To nullify the existing value you should specify null for application/x-www-/form-urlencoded, and null for application/json content type.

An update request updates specified fields only (i.e. other fields will be left untouched). For numeric fields Integer and Float, there is a special increment operator inc that increments or decrements the numeric field.

Update operators

The request can contain next update operators:

OperatorDescription
incTypes: integer, float

Example:
inc[field1]=1000

Increment field <field_name> to a specified value. The value can be positive or negative (i.e. decrement operation).
pullTypes: arrays

Example:
pull[field1]=val1

Removes a specified value from the array field.
pull with filterTypes: arrays

Example:
pull[field1][<filter_operator>]=<filter_value>

Removes all elements filtered by filter operator from the array.
pull_allTypes: arrays

Example:
pull_all[field1][]=val1&pull_all[field1][]=val2

Removes all specified values from the array.
popTypes: arrays

Example:
pop[field1]=1

Removes the last element from the array. To remove the first, the element value should be equal to 1.
pushTypes: arrays

Example:
push[field1][]=val1&push[field1][]=val2

Appends specified values to the array.
add_to_setTypes: arrays

Example:
add_to_set[<field_name>]=

Adds a value to the array only if the value is not in the array already.
Update array element by index operatorType: arrays

Example:
<field_name>[<index>]=val

Update the array element by index.

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]=survivo,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.

Path Parameters

class_name
string
required

Custom object class name.

custom_object_record_id
string
required

ID of the custom object record. Generated automatically by the server after record creation.

Body Parameters

{custom_field_N}
string

Update a value to the field defined in Custom Object class.

{custom_array_field_N}
string

Update the array element by index. Update Operators.
Example: cartoons[1]=Aladdin.

inc
object
pull
object
pull_all
object
pop
object
push
object
add_to_set
object

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.

Responses

curl -X PUT \
-H "Content-Type: application/json" \
-H "QB-token: c8d706877dc40c4f56f8be618dda898456013152" \
-d '{
  "game_mode_name":"rainbow dash",
}' \
https://api.quickblox.com/data/ScoreTable/5f60e245a28f9a78e6c07322.json \
{
  "_id": "5f60e245a28f9a78e6c07322",
  "_parent_id": null,
  "created_at": 1600184901,
  "expert_mode": null,
  "game_mode_name": "rainbow dash",
  "name": null,
  "progress": 0,
  "score_value": null,
  "updated_at": 1600184901,
  "user_id": 102433734,
  "permissions": {
    "read": {
      "access": "open"
    },
    "update": {
      "access": "owner"
    },
    "delete": {
      "access": "owner"
    }
  }
}