0

List Filtered Events

by
Published Oct 17, 2025

Gets the events that are occurring in a Smartsheet organization account for resources to which the current user has access to.

Script smartsheet Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Smartsheet = {
3
  token: string;
4
  baseUrl: string;
5
};
6
/**
7
 * List Filtered Events
8
 * Gets the events that are occurring in a Smartsheet organization account for resources to which the current user has access to.
9
 */
10
export async function main(
11
  auth: Smartsheet,
12
  body: {
13
    sheetIds?: string[];
14
    workspaceIds?: string[];
15
    since?: string;
16
    to?: string;
17
    streamPosition?: string;
18
    maxCount?: number;
19
    numericDates?: false | true;
20
    managedPlanId?: number;
21
  },
22
) {
23
  const url = new URL(`${auth.baseUrl}/filteredEvents`);
24

25
  const response = await fetch(url, {
26
    method: "POST",
27
    headers: {
28
      "Content-Type": "application/json",
29
      Authorization: "Bearer " + auth.token,
30
    },
31
    body: JSON.stringify(body),
32
  });
33
  if (!response.ok) {
34
    const text = await response.text();
35
    throw new Error(`${response.status} ${text}`);
36
  }
37
  return await response.json();
38
}
39