1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "snapshotId": "support-week-2026-10-02",
12 "asOf": "2026-10-02T12:00:00Z",
13 "responseObservation": {
14 "from": "2026-09-28T00:00:00Z",
15 "through": "2026-10-02T12:00:00Z",
16 "coverage": "complete"
17 },
18 "schedules": [
19 {
20 "scheduleId": "weekday-9-18",
21 "coverageStart": "2026-09-28T00:00:00Z",
22 "coverageEnd": "2026-10-06T00:00:00Z",
23 "coverage": "complete"
24 }
25 ],
26 "tickets": [
27 {
28 "sourceId": "helpdesk-export",
29 "ticketId": "0001",
30 "createdAt": "2026-10-01T17:30:00Z",
31 "firstReplyAt": "2026-10-02T09:30:00Z",
32 "scheduleId": "weekday-9-18",
33 "targetMinutes": 60
34 },
35 {
36 "sourceId": "helpdesk-export",
37 "ticketId": "0002",
38 "createdAt": "2026-10-02T09:00:00Z",
39 "firstReplyAt": "2026-10-02T10:15:00Z",
40 "scheduleId": "weekday-9-18",
41 "targetMinutes": 60
42 },
43 {
44 "sourceId": "helpdesk-export",
45 "ticketId": "0003",
46 "createdAt": "2026-10-02T11:30:00Z",
47 "firstReplyAt": null,
48 "scheduleId": "weekday-9-18",
49 "targetMinutes": 60
50 },
51 {
52 "sourceId": "helpdesk-export",
53 "ticketId": "0004",
54 "createdAt": "2026-10-02T11:00:00Z",
55 "firstReplyAt": null,
56 "scheduleId": "weekday-9-18",
57 "targetMinutes": 60
58 },
59 {
60 "sourceId": "helpdesk-export",
61 "ticketId": "0005",
62 "createdAt": "2026-10-02T09:00:00Z",
63 "firstReplyAt": null,
64 "scheduleId": "weekday-9-18",
65 "targetMinutes": 60
66 }
67 ],
68 "workIntervals": [
69 {
70 "scheduleId": "weekday-9-18",
71 "intervalId": "2026-09-28",
72 "start": "2026-09-28T09:00:00Z",
73 "end": "2026-09-28T18:00:00Z"
74 },
75 {
76 "scheduleId": "weekday-9-18",
77 "intervalId": "2026-09-29",
78 "start": "2026-09-29T09:00:00Z",
79 "end": "2026-09-29T18:00:00Z"
80 },
81 {
82 "scheduleId": "weekday-9-18",
83 "intervalId": "2026-09-30",
84 "start": "2026-09-30T09:00:00Z",
85 "end": "2026-09-30T18:00:00Z"
86 },
87 {
88 "scheduleId": "weekday-9-18",
89 "intervalId": "2026-10-01",
90 "start": "2026-10-01T09:00:00Z",
91 "end": "2026-10-01T18:00:00Z"
92 },
93 {
94 "scheduleId": "weekday-9-18",
95 "intervalId": "2026-10-02",
96 "start": "2026-10-02T09:00:00Z",
97 "end": "2026-10-02T18:00:00Z"
98 },
99 {
100 "scheduleId": "weekday-9-18",
101 "intervalId": "2026-10-05",
102 "start": "2026-10-05T09:00:00Z",
103 "end": "2026-10-05T18:00:00Z"
104 }
105 ],
106 "ticketsCsv": "",
107 "workIntervalsCsv": "",
108 "ticketColumns": {
109 "sourceId": "sourceId",
110 "ticketId": "ticketId",
111 "createdAt": "createdAt",
112 "firstReplyAt": "firstReplyAt",
113 "scheduleId": "scheduleId",
114 "targetMinutes": "targetMinutes"
115 },
116 "intervalColumns": {
117 "scheduleId": "scheduleId",
118 "intervalId": "intervalId",
119 "start": "start",
120 "end": "end"
121 },
122 "csvDelimiter": ","
123};
124
125
126const run = await client.actor("h_murdock/support-business-hours-evidence").call(input);
127
128
129console.log('Results from dataset');
130console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
131const { items } = await client.dataset(run.defaultDatasetId).listItems();
132items.forEach((item) => {
133 console.dir(item);
134});
135
136