//native
type Smartsheet = {
token: string;
baseUrl: string;
};
/**
* List Org Sheets
* Gets a summarized list of all sheets owned by the members of the organization account.
* **_This operation is only available to system administrators_**
* **_You may use the query string parameter numericDates with a value of true to enable strict parsing of dates in numeric format. See Dates and Times for more information._**
*/
export async function main(
auth: Smartsheet,
modifiedSince: string | undefined,
) {
const url = new URL(`${auth.baseUrl}/users/sheets`);
for (const [k, v] of [["modifiedSince", modifiedSince]]) {
if (v !== undefined && v !== "" && k !== undefined) {
url.searchParams.append(k, v);
}
}
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago