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.

...

You can modify company relations (entity vs. entity) incrementally instead of an all-in-one sync.

...

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
languagejson
PUT /api/v1/sync
Authorization: Bearer :token
Content-Type: application/json
{
  "configcompanies": [
    {
      "referenceId": "d",
      "companyIdFieldsparentCompanies": [
        {
          "referenceId": "b"],
          "collectionStrategyownership": "incremental"
  },
  25
        }
      ]
    }
  ]
}

How to delete a relationship?

Previously created relations are not deleted by default. In order to delete relationships, use the delete property.

Code Block
languagejson
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`
        }
      ]
    }
  ]
}

How to delete

...

Use the delete property

...

all previously created relationships?

In order to delete all previously created relationships, set the value of the cleanup property to true

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

...

Need more help?

Contact us on support@avallone.io and we will get in contact with you as fast as possible.