POST
/
data
/
{class_name}
/
{parent_id}
/
{child_name}
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 00b4daecf2f3cc13687515977f81e3613d000335" \
-d '{  
  "name": "Bob"
}'\
https://api.quikblox.com/data/user/617817b94dd9626e64022fdd/friends.json
{
  "_id": "617819e24dd96270083a270c",
  "_parent_id": "617817b94dd9626e64022fdd",
  "created_at": 1635260898,
  "name": "Bob",
  "updated_at": 1635260898,
  "user_id": 579,
  "permissions": {
    "read": {
      "access": "open"
    },
    "update": {
      "access": "owner"
    },
    "delete": {
      "access": "owner"
    }
  }
}

A child record type is a record that refers to another record that has already been created, a parent. When a record is created, it is assigned a record ID. Thus, you can create a new record, a child, and attach it to the parent record by pointing to its ID.

Path Parameters

class_name
string
required

A class name of the parent custom object.

parent_id
string
required

An ID of the parent custom object.

child_name
string
required

A class name of the child custom object.

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 our Authentication page to learn more about session tokens. Must be used either QB-Token or Authorization.

Responses

curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 00b4daecf2f3cc13687515977f81e3613d000335" \
-d '{  
  "name": "Bob"
}'\
https://api.quikblox.com/data/user/617817b94dd9626e64022fdd/friends.json
{
  "_id": "617819e24dd96270083a270c",
  "_parent_id": "617817b94dd9626e64022fdd",
  "created_at": 1635260898,
  "name": "Bob",
  "updated_at": 1635260898,
  "user_id": 579,
  "permissions": {
    "read": {
      "access": "open"
    },
    "update": {
      "access": "owner"
    },
    "delete": {
      "access": "owner"
    }
  }
}