Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

This is a beta functionality - expect some changes in the default configuration.

Note

Value for companyIdFields will be ["referenceId"] by default, going forward. Avallone will reach out to you if you are affected by this change.

Note

Value for collectionStrategy will be incremental by default, going forward. Avallone will reach out to you if you are affected by this change.

Create or update a relationship

Code Block
languagejson
PUT /api/v1/sync
Authorization: Bearer :token
Content-Type: application/json
{
  "config": {
    "companyIdFields": ["referenceId"],
  
 "collectionStrategy": "incremental"
  },
  "companies": [
    {
      "referenceId": "d",
      "parentCompanies": [
        {
          "referenceId": "b",
          "ownership": 25
        }
      ]
    }
  ]
}

How to delete a relationship

...

?

Use Previously created relations are not deleted by default. If you want to explicitly delete a relationship, use the delete property

Code Block
languagejson
PUT /api/v1/sync
Authorization: Bearer :token
Content-Type: application/json
{
  "config":
{
 
  "companyIdFields": ["referenceId"],
    "collectionStrategy": "incremental"
  },
  "companies": [
    {
      "referenceId": "d",
      "parentCompanies": [
        {
          "referenceId": "b",
          "ownership": 25,
          "delete": true        <--- Set the `delete` prppertyproperty to `true`
        }
      ]
    }
  ]
}