Edits history of script submission #48 for ' Download Files (Google Docs, Sheets, Slides) (gdrive)'

  • deno
    type Gdrive = {
      token: string;
    };
    export async function main(
      gdrive_auth: Gdrive,
      fileId: string,
      mimeType: string,
    ) {
      const DOWNLOAD_FILE_URL = `https://www.googleapis.com/drive/v3/files/fileId=${fileId}/export/?mimeType=${mimeType}`;
    
      const token = gdrive_auth["token"];
    
      const response = await fetch(DOWNLOAD_FILE_URL, {
        method: "GET",
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      const result = await response.json();
    
      return result;
    }
    

    Submitted by hugo697 399 days ago

  • deno
    type Gdrive = {
      token: string;
    };
    export async function main(
      gdrive_auth: Gdrive,
      fileId: string,
      mimeType: string,
    ) {
      const DOWNLOAD_FILE_URL = `https://www.googleapis.com/drive/v3/files/fileId=${fileId}/export/?mimeType=${mimeType}`;
    
      const token = gdrive_auth["token"];
    
      const response = await fetch(DOWNLOAD_FILE_URL, {
        method: "GET",
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      const result = await response.json();
    
      return result;
    }
    

    Submitted by admin 1031 days ago

  • deno
    
    type Gdrive = {
      token: string;
    };
    export async function main(
      gdrive_auth: Gdrive,
      fileId: string,
      mimeType: string    
    ) {
      const DOWNLOAD_FILE_URL =`https://www.googleapis.com/drive/v3/files/fileId=${fileId}/export/?mimeType=${mimeType}`;
    
      const token = gdrive_auth["token"];
    
      const response = await fetch(DOWNLOAD_FILE_URL, {
        method: "GET",
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      const result = await response.json();
    
      return result;
    }

    Submitted by admin 1034 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    
    export async function main(
      gdrive_auth: wmill.Resource<"gdrive">,
      fileId: string,
      mimeType: string    
    ) {
      const DOWNLOAD_FILE_URL =`https://www.googleapis.com/drive/v3/files/fileId=${fileId}/export/?mimeType=${mimeType}`;
    
      const token = gdrive_auth["token"];
    
      const response = await fetch(DOWNLOAD_FILE_URL, {
        method: "GET",
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      const result = await response.json();
    
      return result;
    }

    Submitted by adam186 1163 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    
    export async function main(
      gdrive_auth: wmill.Resource<"gdrive">,
      fileId: string,
      mimeType: string    
    ) {
      const DOWNLOAD_FILE_URL =`https://www.googleapis.com/drive/v3/files/fileId=${fileId}/export/?mimeType=${mimeType}`;
    
      const token = gdrive_auth["token"];
    
      const response = await fetch(DOWNLOAD_FILE_URL, {
        method: "GET",
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      const result = await response.json();
    
      return result;
    }

    Submitted by adam186 1198 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    
    export async function main(
      gdrive_auth: wmill.Resource<"gdrive">,
      fileId: string,
      mimeType: string    
    ) {
      const DOWNLOAD_FILE_URL =`https://www.googleapis.com/drive/v3/files/fileId=${fileId}/export/?mimeType=${mimeType}`;
    
      const token = gdrive_auth["token"];
    
      const response = await fetch(DOWNLOAD_FILE_URL, {
        method: "GET",
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      const result = await response.json();
    
      return result;
    }

    Submitted by rossmccrann 1414 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    
    export async function main(
      gdrive_auth: wmill.Resource<"gdrive">,
      fileId: string,
      mimeType: string      /*
        MIME Type	Description
        application/vnd.google-apps.audio	
        application/vnd.google-apps.document	Google Docs
        application/vnd.google-apps.drive-sdk	3rd party shortcut
        application/vnd.google-apps.drawing	Google Drawing
        application/vnd.google-apps.file	Google Drive file
        application/vnd.google-apps.folder	Google Drive folder
        application/vnd.google-apps.form	Google Forms
        application/vnd.google-apps.fusiontable	Google Fusion Tables
        application/vnd.google-apps.jam	Google Jamboard
        application/vnd.google-apps.map	Google My Maps
        application/vnd.google-apps.photo	
        application/vnd.google-apps.presentation	Google Slides
        application/vnd.google-apps.script	Google Apps Scripts
        application/vnd.google-apps.shortcut	Shortcut
        application/vnd.google-apps.site	Google Sites
        application/vnd.google-apps.spreadsheet	Google Sheets
        application/vnd.google-apps.unknown	
        application/vnd.google-apps.video
        */
    ) {
      const DOWNLOAD_FILE_URL =`https://www.googleapis.com/drive/v3/files/fileId=${fileId}/export/?mimeType=${mimeType}`;
    
      const token = gdrive_auth["token"];
    
      const response = await fetch(DOWNLOAD_FILE_URL, {
        method: "GET",
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      const result = await response.json();
    
      return result;
    }

    Submitted by rossmccrann 1414 days ago

  • deno
    import * as wmill from "https://deno.land/x/[email protected]/mod.ts";
    
    export async function main(
      gdrive_auth: wmill.Resource<"gdrive">,
      fileId: string,
      mimeType: string
    ) {
        /*
        MIME Type	Description
        application/vnd.google-apps.audio	
        application/vnd.google-apps.document	Google Docs
        application/vnd.google-apps.drive-sdk	3rd party shortcut
        application/vnd.google-apps.drawing	Google Drawing
        application/vnd.google-apps.file	Google Drive file
        application/vnd.google-apps.folder	Google Drive folder
        application/vnd.google-apps.form	Google Forms
        application/vnd.google-apps.fusiontable	Google Fusion Tables
        application/vnd.google-apps.jam	Google Jamboard
        application/vnd.google-apps.map	Google My Maps
        application/vnd.google-apps.photo	
        application/vnd.google-apps.presentation	Google Slides
        application/vnd.google-apps.script	Google Apps Scripts
        application/vnd.google-apps.shortcut	Shortcut
        application/vnd.google-apps.site	Google Sites
        application/vnd.google-apps.spreadsheet	Google Sheets
        application/vnd.google-apps.unknown	
        application/vnd.google-apps.video
        */
      const DOWNLOAD_FILE_URL =`https://www.googleapis.com/drive/v3/files/fileId=${fileId}/export/?mimeType=${mimeType}`;
    
      const token = gdrive_auth["token"];
    
      const response = await fetch(DOWNLOAD_FILE_URL, {
        method: "GET",
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      const result = await response.json();
    
      return result;
    }

    Submitted by rossmccrann 1414 days ago