1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "before_json": `{"status": "COMPLETE", "results": [{"from": {"id": "001"}, "to": [{"toObjectId": 7, "associationTypes": [{"category": "USER_DEFINED", "typeId": 123, "label": "Client"}]}]}]}`,
12 "proposed_json": `{"status": "COMPLETE", "results": [{"from": {"id": "001"}, "to": [{"toObjectId": 7, "associationTypes": [{"category": "USER_DEFINED", "typeId": 123, "label": "Client"}]}]}]}`,
13 "policy_json": `{"from_object_type": "contacts", "to_object_type": "companies", "queried_from_ids": ["001"]}`
14};
15
16
17const run = await client.actor("biztoolsus/hubspot-association-pair-delta").call(input);
18
19
20console.log('Results from dataset');
21console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
22const { items } = await client.dataset(run.defaultDatasetId).listItems();
23items.forEach((item) => {
24 console.dir(item);
25});
26
27