1
Create Spreadsheet
One script reply has been approved by the moderators Verified
Created by rossmccrann 640 days ago Viewed 5066 times
0
Submitted by rossmccrann Deno
Verified 640 days ago
1
type Gsheets = {
2
  token: string;
3
};
4
export async function main(gsheets_auth: Gsheets) {
5
  const CREATE_URL = `https://sheets.googleapis.com/v4/spreadsheets`;
6

7
  const token = gsheets_auth["token"];
8

9
  const response = await fetch(CREATE_URL, {
10
    method: "POST",
11
    headers: {
12
      Authorization: "Bearer " + token,
13
      "Content-Type": "application/json",
14
    },
15
  });
16

17
  const result = await response.json();
18

19
  return { result: result };
20
}
21