0

Get classification on folder

by
Published Oct 17, 2025

Retrieves the classification metadata instance that has been applied to a folder. This API can also be called by including the enterprise ID in the URL explicitly, for example `/folders/:id/enterprise_12345/securityClassification-6VMVochwUWo`.

Script box Verified

The script

Submitted by hugo697 Bun
Verified 235 days ago
1
//native
2
type Box = {
3
  token: string;
4
};
5
/**
6
 * Get classification on folder
7
 * Retrieves the classification metadata instance that
8
has been applied to a folder.
9

10
This API can also be called by including the enterprise ID in the
11
URL explicitly, for example
12
`/folders/:id/enterprise_12345/securityClassification-6VMVochwUWo`.
13
 */
14
export async function main(auth: Box, folder_id: string) {
15
  const url = new URL(
16
    `https://api.box.com/2.0/folders/${folder_id}/metadata/enterprise/securityClassification-6VMVochwUWo`,
17
  );
18

19
  const response = await fetch(url, {
20
    method: "GET",
21
    headers: {
22
      Authorization: "Bearer " + auth.token,
23
    },
24
    body: undefined,
25
  });
26
  if (!response.ok) {
27
    const text = await response.text();
28
    throw new Error(`${response.status} ${text}`);
29
  }
30
  return await response.json();
31
}
32