Create or update a relationship
If you omit the name
property for the company, then only the nested properties are synced. In the following example, on the the parentCompanies
will be synced since the name
of the company is not specified.
Code Block |
---|
|
PUT /api/v1/sync
Authorization: Bearer :token
Content-Type: application/json
{
"companies": [
{
"referenceId": "d",
"parentCompanies": [
{
"referenceId": "b",
"ownership": 25
}
]
}
]
} |
...
Previously created relations are not deleted by default. If you want In order to explicitly delete a relationshiprelationships, use the delete
property.
Code Block |
---|
|
PUT /api/v1/sync
Authorization: Bearer :token
Content-Type: application/json
{
"companies": [
{
"referenceId": "d",
"parentCompanies": [
{
"referenceId": "b",
"ownership": 25,
"delete": true <--- Set the `delete` property to `true`
}
]
}
]
} |