0

List Update Requests

by
Published Oct 17, 2025

Gets a summarized list of all update requests that have future schedules associated with the specified sheet. Only the following fields are returned in the response: * **id** * **ccMe** * **createdAt** * **message** * **modifiedAt** * **schedule** * **sendTo** * **sentBy** * **subject**

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 Update Requests
8
 * Gets a summarized list of all update requests that have future schedules associated with the specified sheet.
9
Only the following fields are returned in the response:
10
  * **id**
11
  * **ccMe**
12
  * **createdAt**
13
  * **message**
14
  * **modifiedAt**
15
  * **schedule**
16
  * **sendTo**
17
  * **sentBy**
18
  * **subject**
19

20
 */
21
export async function main(
22
  auth: Smartsheet,
23
  sheetId: string,
24
  includeAll: string | undefined,
25
  page: string | undefined,
26
  pageSize: string | undefined,
27
) {
28
  const url = new URL(
29
    `${auth.baseUrl}/sheets/${sheetId}/updaterequests`,
30
  );
31
  for (const [k, v] of [
32
    ["includeAll", includeAll],
33
    ["page", page],
34
    ["pageSize", pageSize],
35
  ]) {
36
    if (v !== undefined && v !== "" && k !== undefined) {
37
      url.searchParams.append(k, v);
38
    }
39
  }
40
  const response = await fetch(url, {
41
    method: "GET",
42
    headers: {
43
      Authorization: "Bearer " + auth.token,
44
    },
45
    body: undefined,
46
  });
47
  if (!response.ok) {
48
    const text = await response.text();
49
    throw new Error(`${response.status} ${text}`);
50
  }
51
  return await response.json();
52
}
53