1
Get Shared Drive
One script reply has been approved by the moderators Verified
Created by rossmccrann 717 days ago Viewed 9309 times
0
Submitted by rossmccrann Deno
Verified 717 days ago
1
type Gdrive = {
2
  token: string;
3
};
4
export async function main(
5
  gdrive_auth: Gdrive,
6
  driveId: string,
7
  useDomainAdminAccess: boolean = false,
8
) {
9
  const GET_SHARED_DRIVE_URL = `https://www.googleapis.com/drive/v3/drives/${driveId}/?useDomainAdminAccess=${useDomainAdminAccess}`;
10

11
  const token = gdrive_auth["token"];
12

13
  const response = await fetch(GET_SHARED_DRIVE_URL, {
14
    method: "GET",
15
    headers: {
16
      Authorization: "Bearer " + token,
17
      "Content-Type": "application/json",
18
    },
19
  });
20

21
  return await response.text();
22
}
23