1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "googleAccessToken": "",
12 "googleRefreshToken": "",
13 "googleClientId": "",
14 "googleClientSecret": "",
15 "customerName": "",
16 "customerPhone": "",
17 "customerEmail": "",
18 "serviceType": "",
19 "specialNotes": "",
20 "eventData": {
21 "summary": "Meeting with Customer",
22 "description": "Customer phone: 555-1234\nNotes: Initial consultation",
23 "start": {
24 "dateTime": "2025-08-17T14:00:00-07:00",
25 "timeZone": "America/Los_Angeles"
26 },
27 "end": {
28 "dateTime": "2025-08-17T15:00:00-07:00",
29 "timeZone": "America/Los_Angeles"
30 },
31 "attendees": [
32 {
33 "email": "customer@example.com",
34 "displayName": "Customer Name"
35 }
36 ],
37 "location": "123 Main St, Your City, State"
38 }
39};
40
41
42const run = await client.actor("sambehnke/google-calendar-create-event").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