1 | type Gdocs = { |
2 | token: string; |
3 | }; |
4 | export async function main(gdocs_auth: Gdocs, documentId: string) { |
5 | const token = gdocs_auth["token"]; |
6 |
|
7 | const GET_DOC_URL = `https://docs.googleapis.com/v1/documents/${documentId}`; |
8 |
|
9 | const response = await fetch(GET_DOC_URL, { |
10 | method: "GET", |
11 | headers: { |
12 | Authorization: "Bearer " + token, |
13 | "Content-Type": "application/json", |
14 | }, |
15 | }); |
16 |
|
17 | return await response.text(); |
18 | } |
19 |
|