//native
type Smartsheet = {
token: string;
baseUrl: string;
};
/**
* Reactivate User
* Reactivates the user associated with the current Smartsheet plan, restoring the user's access to Smartsheet, owned items, and shared items.
*/
export async function main(
auth: Smartsheet,
userId: string,
) {
const url = new URL(`${auth.baseUrl}/users/${userId}/reactivate`);
const response = await fetch(url, {
method: "POST",
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