scmrus
8/24/2017 - 8:59 AM

google scripts - spreadsheet

google scripts - spreadsheet

function onOpen() {
  var data = {'key': 'xxx'};
  var options = {
    'method' : 'post',
    'payload' : data
  };
  
  var response = UrlFetchApp.fetch('https://api.com/', options);
  var sum = response.getContentText("UTF-8");
  
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheets()[0];
  sheet.getRange("C2").setValue(sum);
}