0

List Sent Update Requests

by
Published Oct 17, 2025

Gets a summarized list of all sent update requests on the sheet. Only the following fields are returned in the response: * **id** * **message** * **sendTo** * **sentAt** * **sentBy** * **status** * **subject** * **updateRequestId**

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 Sent Update Requests
8
 * Gets a summarized list of all sent update requests on the sheet.
9
Only the following fields are returned in the response:
10
  * **id**
11
  * **message**
12
  * **sendTo**
13
  * **sentAt**
14
  * **sentBy**
15
  * **status**
16
  * **subject**
17
  * **updateRequestId**
18

19
 */
20
export async function main(
21
  auth: Smartsheet,
22
  sheetId: string,
23
  includeAll: string | undefined,
24
  page: string | undefined,
25
  pageSize: string | undefined,
26
  Authorization?: string,
27
) {
28
  const url = new URL(
29
    `${auth.baseUrl}/sheets/${sheetId}/sentupdaterequests`,
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