Edits history of script submission #22409 for ' Get Values (gsheets)'

  • bunnative
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    
    type Gsheets = {
      token: string;
    };
    export async function main(
      gsheets_auth: Gsheets,
      spreadsheetId: string,
      worksheet_name: string,
    ) {
      const token = gsheets_auth["token"];
    
      const GET_VALUES_URL = `https://sheets.googleapis.com/v4/spreadsheets/${spreadsheetId}/values/${worksheet_name}`;
    
      const response = await fetch(GET_VALUES_URL, {
        method: "GET",
        headers: {
          Authorization: "Bearer " + token,
          "Content-Type": "application/json",
        },
      });
    
      return await response.text();
    }
    

    Submitted by hugo989 13 days ago