这是我正在使用的Twilio API调用。
我的请求:https://api.trello.com/1/boards/boardID/cards/cardId?fields=name&key=MYKEY&token=MYTOKEN
我的回复:{ “ID”: “570666201ffd1e340fb2e7f8”, “名”:…
你可以尝试这样的东西......但你可能需要修改一下以满足你的需要。
function ImportJSON() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getActiveSheet(); var url = "https://api.trello.com/1/boards/boardID/cards/cardId?fields=name&key=MYKEY&token=MYTOKEN"; var response = UrlFetchApp.fetch(url); // Get the raw JSON var dataSet = JSON.parse(response.getContentText()); // Parse it var rows = new Array(); for (i = 0; i < dataSet.length; i++) { var data = dataSet[i]; rows.push([data.name,data.email]); // your actual JSON entities here ... do not include "id" } dataRange = sheet.getRange(1, 1, rows.length, 3); // 3 being the total number of entities dataRange.setValues(rows); }