Build the API in Google Script Editor

Поділитися
Вставка
  • Опубліковано 12 вер 2024

КОМЕНТАРІ • 6

  • @guidowalterpettinari8454
    @guidowalterpettinari8454 4 роки тому +2

    Thank you for the tutorial! Very handy indeed :-)
    For those interested in experimenting, here's the transcript of the Google Script:
    function doGet(e) {
    var spreadsheetId = 'INSERT HERE THE SPREADSHEET ID';
    var sheetName = 'INSERT HERE THE SHEET NAME';
    var sheet = SpreadsheetApp
    .openById(spreadsheetId)
    .getSheetByName(sheetName);
    var results = sheet.getSheetValues(1, 1, sheet.getLastRow(), 1)
    .reduce(function(a, b) {return a.concat(b);});
    return ContentService.createTextOutput(
    e.parameters.callback + '(' + JSON.stringify(results) + ')'
    ).setMimeType(ContentService.MimeType.JAVASCRIPT);
    }
    Hope it helps.
    Cheers,
    Guido

  • @paulajonye9787
    @paulajonye9787 2 роки тому

    Thanks man you really saved me a ton.

  • @elabinnovations
    @elabinnovations 5 років тому

    How to make API for uploading files to Google drive with base64 method?

  • @oscarmejia8306
    @oscarmejia8306 5 років тому

    How can I actually use this api for a project? I'm trying to do a get request from postman and can't get anything back. I've tried both /exec and executed link, and all types of OAuth set ups. Please help!

    • @oscarmejia8306
      @oscarmejia8306 5 років тому

      I fixed it by deploying the app lol. If you managed to read this though. I'd like to ask if there any security concerns regarding this? Since there is no oauth

    • @JordanRhea
      @JordanRhea  5 років тому

      You can totally create your own security for the API. I think OAuth might be difficult to implement, however, if you can get it to work I would love to see it!