Skip to main content
POST
/
data
/
{class_name}
.json
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 199b1d9ec0dedeb19d81283b3b2a32b80f012bba" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ]
}' \
https://api.quickblox.com/data/ScoreTable.json
{
  "_id": "5d866b53a28f9a5ad51cb562",
  "_parent_id": null,
  "completed_levels": [
    1,
    2,
    3
  ],
  "created_at": 1569090387,
  "date": "2019-09-21T21:21:00Z",
  "expert_mode": false,
  "game_mode_name": "deathmatch",
  "progress": 0.12,
  "score_value": 665,
  "updated_at": 1569090387,
  "user_avatar": null,
  "user_id": 96753878,
  "user_location": [
    11.13,
    45.52
  ],
  "permissions": {
    "read": {
      "access": "open"
    },
    "update": {
      "access": "owner"
    },
    "delete": {
      "access": "owner"
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.quickblox.com/llms.txt

Use this file to discover all available pages before exploring further.

Recipes

1

1. Set record fields.

You can set as many fields as you need.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 199b1d9ec0dedeb19d81283b3b2a32b80f012bba" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ]
}' \
"https://api.quickblox.com/data/ScoreTable.json"
2

2. Set a class.

Set a class for a new record.Here, the ScoreTable class is specified.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 199b1d9ec0dedeb19d81283b3b2a32b80f012bba" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ]
}' \
"https://api.quickblox.com/data/ScoreTable.json"
3

3. As a result, the API returns a new record.

{
  "_id": "5d866b53a28f9a5ad51cb562",
  "_parent_id": null,
  "completed_levels": [
    1,
    2,
    3
  ],
  "created_at": 1569090387,
  "date": "2019-09-21T21:21:00Z",
  "expert_mode": false,
  "game_mode_name": "deathmatch",
  "progress": 0.12,
  "score_value": 665,
  "updated_at": 1569090387,
  "user_avatar": null,
  "user_id": 96753878,
  "user_location": [
    11.13,
    45.52
  ],
  "permissions": {
    "read": {
      "access": "open"
    },
    "update": {
      "access": "owner"
    },
    "delete": {
      "access": "owner"
    }
  }
}
1

1. Set record fields

You can set as many fields as you need for a new record
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 199b1d9ec0dedeb19d81283b3b2a32b80f012bba" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ],
}' \
"https://api.quickblox.com/data/ScoreTable.json"
2

2. Use a `permissions` parameter to set operations allowed and access levels

curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 199b1d9ec0dedeb19d81283b3b2a32b80f012bba" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ],
  "permissions": {}
}' \
"https://api.quickblox.com/data/ScoreTable.json"
3

3. Set CRUD operations

Set CRUD operations that can be performed on a record.Here, the read, and update operations are set.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 199b1d9ec0dedeb19d81283b3b2a32b80f012bba" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ],
  "permissions": {
    "read": {},
    "update": {}
  }
}' \
"https://api.quickblox.com/data/ScoreTable.json"
4

4. Set access levels

Set an access level for a record.Here, the owner, and open_for_groups access levels are set.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 199b1d9ec0dedeb19d81283b3b2a32b80f012bba" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ],
  "permissions": {
    "read": {
      "access":"owner",
    },
    "update": {
      "access":"open_for_groups"
    }
  }
}' \
"https://api.quickblox.com/data/ScoreTable.json"
5

5. Set a user group

Set a user group to determine who can make a required operation.Here, users with the world tag can make a required operation.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 199b1d9ec0dedeb19d81283b3b2a32b80f012bba" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ],
  "permissions": {
    "read": {
      "access":"owner",
    },
    "update": {
      "access":"open_for_groups",
      "user_groups":[
        "world"
      ]
    }
  }
}' \
"https://api.quickblox.com/data/ScoreTable.json"
6

6. As a result, the API returns a new record.

{
  "_id": "5d866b53a28f9a5ad51cb562",
  "_parent_id": null,
  "completed_levels": [
    1,
    2,
    3
  ],
  "created_at": 1569090387,
  "date": "2019-09-21T21:21:00Z",
  "expert_mode": false,
  "game_mode_name": "deathmatch",
  "progress": 0.12,
  "score_value": 665,
  "updated_at": 1569090387,
  "user_avatar": null,
  "user_id": 96753878,
  "user_location": [
    11.13,
    45.52
  ],
  "permissions": {
    "read": {
      "access": "owner"
    },
    "update": {
      "access": "open_for_groups",
      "user_groups": [
        "world"
      ]
    },
    "delete": {
      "access": "owner"
    }
  }
}
1

1. Use 'Authorization' header to pass API key

curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ]
}' \
"https://api.quickblox.com/data/ScoreTable.json"
2

2. Set record fields.

You can set as many fields as you need.
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ]
}' \
"https://api.quickblox.com/data/ScoreTable.json"
3

3. Set a class.

Set a class for a new record.Here, the ScoreTable class is specified.
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ]
}' \
"https://api.quickblox.com/data/ScoreTable.json"
4

4. As a result, the API returns a new record.

{
  "_id": "5d866b53a28f9a5ad51cb562",
  "_parent_id": null,
  "completed_levels": [
    1,
    2,
    3
  ],
  "created_at": 1569090387,
  "date": "2019-09-21T21:21:00Z",
  "expert_mode": false,
  "game_mode_name": "deathmatch",
  "progress": 0.12,
  "score_value": 665,
  "updated_at": 1569090387,
  "user_avatar": null,
  "user_id": 96753878,
  "user_location": [
    11.13,
    45.52
  ],
  "permissions": {
    "read": {
      "access": "open"
    },
    "update": {
      "access": "owner"
    },
    "delete": {
      "access": "owner"
    }
  }
}
1

1. Use 'Authorization' header to pass API key

curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ],
}' \
"https://api.quickblox.com/data/ScoreTable.json"
2

2. Set record fields

You can set as many fields as you need for a new record
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ],
}' \
"https://api.quickblox.com/data/ScoreTable.json"
3

3. Use a `permissions` parameter to set operations allowed and access levels

curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ],
  "permissions": {}
}' \
"https://api.quickblox.com/data/ScoreTable.json"
4

4. Set CRUD operations

Set CRUD operations that can be performed on a record.Here, the read, and update operations are set.
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ],
  "permissions": {
    "read": {},
    "update": {}
  }
}' \
"https://api.quickblox.com/data/ScoreTable.json"
5

5. Set access levels

Set an access level for a record.Here, the owner, and open_for_groups access levels are set.
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ],
  "permissions": {
    "read": {
      "access":"owner",
    },
    "update": {
      "access":"open_for_groups"
    }
  }
}' \
"https://api.quickblox.com/data/ScoreTable.json"
6

6. Set a user group

Set a user group to determine who can make a required operation.Here, users with the world tag can make a required operation.
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ],
  "permissions": {
    "read": {
      "access":"owner",
    },
    "update": {
      "access":"open_for_groups",
      "user_groups":[
        "world"
      ]
    }
  }
}' \
"https://api.quickblox.com/data/ScoreTable.json"
7

7. As a result, the API returns a new record.

{
  "_id": "5d866b53a28f9a5ad51cb562",
  "_parent_id": null,
  "completed_levels": [
    1,
    2,
    3
  ],
  "created_at": 1569090387,
  "date": "2019-09-21T21:21:00Z",
  "expert_mode": false,
  "game_mode_name": "deathmatch",
  "progress": 0.12,
  "score_value": 665,
  "updated_at": 1569090387,
  "user_avatar": null,
  "user_id": 96753878,
  "user_location": [
    11.13,
    45.52
  ],
  "permissions": {
    "read": {
      "access": "owner"
    },
    "update": {
      "access": "open_for_groups",
      "user_groups": [
        "world"
      ]
    },
    "delete": {
      "access": "owner"
    }
  }
}
To create a new record use a POST request with application/json or application/x-www-form-urlencoded content type of the POST body. Received values will be cast according to the class defined in QuickBlox Dashboard. The field that is present in the class but not specified in the POST request will have a null value. Allowed permissions
PermissionSyntaxExample
Openpermissions.<CRUD_operation>.accesspermissions.read.access=open
Ownerpermissions.<CRUD_operation>.accesspermissions.read.access=owner
Open for users IDspermissions.<CRUD_operation>.access=open_for_users_ids permissions.<CRUD_operation>.ids=id_1,id_2,id_3,…permissions.update.access=open_for_users_ids permissions.update.ids=3,12
Open for groupspermissions.<CRUD_operation>.access=open_for_groups permissions.<CRUD_operation>.groups=group_name_1,group_name_2permissions.delete.access=open_for_groups permissions.delete.groups=experience,rate

Path Parameters

class_name
string
required
Custom object class name.

Body Parameters

{custom_field_N}
string
Set value to the field defined in Custom Object class. Can be many 1..N.
permissions
string
Record permissions. Format:
permission.<CRUD_operation>.access=<value>
permission.<CRUD_operation>.<option>=<value>
CRUD operations: create, read, update, delete.
CRUD access values: open, owner, open_for_users_ids, open_for_groups.
CRUD options: ids, groups.

Headers

QB-Token
string
required
A user or application session token. See Authentication page to learn more about session tokens. Must be used either QB-Token or Authorization.
Authorization
string
default:"ApiKey {your_api_key}"
API key from Dashboard. Expected format: ApiKey {your_api_key}. Must be used either QB-Token or Authorization.
On-Behalf-Of
string
User ID. The user ID of the user on whose behalf the request is being made.

Responses

A successful response
_id
string
_parent_id
string
created_at
integer
updated_at
integer
user_id
integer
permissions
object
An error response
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 199b1d9ec0dedeb19d81283b3b2a32b80f012bba" \
-d '{
  "score_value":665,
  "progress":"0.12",
  "expert_mode":false,
  "game_mode_name":"deathmatch",
  "user_location":"11.13, 45.52",
  "date":"2019-09-21 21:21:00",
  "completed_levels":[
    1,
    2,
    3
  ]
}' \
https://api.quickblox.com/data/ScoreTable.json
{
  "_id": "5d866b53a28f9a5ad51cb562",
  "_parent_id": null,
  "completed_levels": [
    1,
    2,
    3
  ],
  "created_at": 1569090387,
  "date": "2019-09-21T21:21:00Z",
  "expert_mode": false,
  "game_mode_name": "deathmatch",
  "progress": 0.12,
  "score_value": 665,
  "updated_at": 1569090387,
  "user_avatar": null,
  "user_id": 96753878,
  "user_location": [
    11.13,
    45.52
  ],
  "permissions": {
    "read": {
      "access": "open"
    },
    "update": {
      "access": "owner"
    },
    "delete": {
      "access": "owner"
    }
  }
}