1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "salesObject": {
12 "candidates": [
13 {
14 "candidateId": "candidate id",
15 "outreach_status": "'start','messaged'",
16 "fullName": "Full name of the candidate",
17 "werkNlUrl": "Werk NL profile url of the candidate",
18 "message": {
19 "subject": "Subject of the message",
20 "content": "Content of the message"
21 }
22 }
23 ],
24 "user_id": {
25 "title": "User ID",
26 "type": "string",
27 "description": "User ID to use for the outreach"
28 }
29 }
30};
31
32
33const run = await client.actor("obedient_stars/cmg-werknl-outreach-service").call(input);
34
35
36console.log('Results from dataset');
37console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
38const { items } = await client.dataset(run.defaultDatasetId).listItems();
39items.forEach((item) => {
40 console.dir(item);
41});
42
43