1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "campaignId": "your-campaign-id-here",
12 "leads": [
13 {
14 "email": "sarah.chen@acmecorp.com",
15 "firstName": "Sarah",
16 "lastName": "Chen",
17 "companyName": "Acme Corp",
18 "phone": "+1-415-555-0192",
19 "website": "acmecorp.com",
20 "icpScore": 82,
21 "icpGrade": "A"
22 }
23 ],
24 "personalizationTemplate": "Hi {{firstName}}, I noticed {{companyName}} scored {{icpGrade}} on our ICP analysis.",
25 "minIcpScore": 0,
26 "dryRun": true
27};
28
29
30const run = await client.actor("ryanclinton/instantly-lead-pusher").call(input);
31
32
33console.log('Results from dataset');
34console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
35const { items } = await client.dataset(run.defaultDatasetId).listItems();
36items.forEach((item) => {
37 console.dir(item);
38});
39
40