//native
type Box = {
token: string;
};
/**
* List all classifications
* Retrieves the classification metadata template and lists all the
classifications available to this enterprise.
This API can also be called by including the enterprise ID in the
URL explicitly, for example
`/metadata_templates/enterprise_12345/securityClassification-6VMVochwUWo/schema`.
*/
export async function main(auth: Box) {
const url = new URL(
`https://api.box.com/2.0/metadata_templates/enterprise/securityClassification-6VMVochwUWo/schema`,
);
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