想要从Trello API响应中删除Id字段


v-star*위위
2025-03-12 11:54:08 (26天前)


这是我正在使用的Twilio API调用。

我的请求:
https://api.trello.com/1/boards/boardID/cards/cardId?fields=name&key=MYKEY&token=MYTOKEN

我的回复:
{ “ID”: “570666201ffd1e340fb2e7f8”, “名”:…

2 条回复
  1. 0# 誓言 | 2019-08-31 10-32



    你可以尝试这样的东西……但你可能需要修改一下以满足你的需要。




    1. function ImportJSON() {

    2. var ss = SpreadsheetApp.getActiveSpreadsheet();

    3. var sheet = ss.getActiveSheet();

    4. var url = https://api.trello.com/1/boards/boardID/cards/cardId?fields=name&key=MYKEY&token=MYTOKEN“;

    5. var response = UrlFetchApp.fetch(url); // Get the raw JSON

    6. var dataSet = JSON.parse(response.getContentText()); // Parse it

    7. var rows = new Array();

    8. 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”
      }

    9. dataRange = sheet.getRange(1, 1, rows.length, 3); // 3 being the total number of entities

    10. dataRange.setValues(rows);

    11. }

    12. </code>

登录 后才能参与评论