//native
type Box = {
token: string;
};
/**
* Delete Slack integration mapping
* Deletes a [Slack integration mapping](https://support.box.com/hc/en-us/articles/4415585987859-Box-as-the-Content-Layer-for-Slack).
You need Admin or Co-Admin role to
use this endpoint.
*/
export async function main(auth: Box, integration_mapping_id: string) {
const url = new URL(
`https://api.box.com/2.0/integration_mappings/slack/${integration_mapping_id}`,
);
const response = await fetch(url, {
method: "DELETE",
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