0

List Image URLs

by
Published Oct 17, 2025

Posts an array of Image Url objects that can be used to retrieve the specified cell images.

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 Image URLs
8
 * Posts an array of Image Url objects that can be used to retrieve the specified cell images.
9
 */
10
export async function main(
11
  auth: Smartsheet,
12
  body: {
13
    imageId?: string;
14
    error?: { refId?: string; errorCode?: number; message?: string };
15
    height?: number;
16
    url?: string;
17
    width?: number;
18
  }[],
19
) {
20
  const url = new URL(`${auth.baseUrl}/imageurls`);
21

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