1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "certificates": [
12 {
13 "subcontractor": "DEMO SAMPLE Scaffolding Pty Ltd (not a real subcontractor)",
14 "certificate_type": "Public Liability",
15 "expiry_date": "2026-08-05",
16 "insurer": "DEMO Insurance",
17 "policy_number": "DEMO-PL-0001",
18 "notes": "DEMO SAMPLE - automated-test data, NOT a real certificate."
19 },
20 {
21 "subcontractor": "DEMO SAMPLE Electrical Pty Ltd (not a real subcontractor)",
22 "certificate_type": "Workers Compensation",
23 "expiry_date": "2027-02-01",
24 "insurer": "DEMO Insurance",
25 "policy_number": "DEMO-WC-0002",
26 "notes": "DEMO SAMPLE - automated-test data, NOT a real certificate."
27 }
28 ],
29 "swms_records": [
30 {
31 "subcontractor": "DEMO SAMPLE Scaffolding Pty Ltd (not a real subcontractor)",
32 "review_date": "2025-01-15"
33 },
34 {
35 "subcontractor": "DEMO SAMPLE Electrical Pty Ltd (not a real subcontractor)",
36 "review_date": "2026-05-01"
37 }
38 ]
39};
40
41
42const run = await client.actor("armourylabs/subcontractor-certificate-expiry-checker").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52