代码之家  ›  专栏  ›  技术社区  ›  Edmund Lee

使用phabricatorapi用javascript创建maniphest任务

  •  0
  • Edmund Lee  · 技术社区  · 7 年前

    长话短说,经过多次的尝试和错误,我走到这一步,仍然得到一个错误 事务不是事务列表 . 这个有效载荷有什么问题?没有一个明确的文件,所以有人成功地做到了这一点?

    var payload = {
    “api.token”: PHAB_TOKEN,
    transactions: [{“type”: “title”, “value”: “test”}],
    output: ‘json’
    };
    
    var options = {
    method: ‘post’,
    payload: payload,
    };
    
    var resp = UrlFetchApp.fetch(“https://xxxxxxx/api/maniphest.edit”, options);
    
    0 回复  |  直到 7 年前
        1
  •  0
  •   Edmund Lee    7 年前

    万一有人在找这个。phab令牌应该位于名为“\uuuu\uuu”的密钥下,如下所示。

      var payload = {
        "params": JSON.stringify({
          "__conduit__": { token: PHAB_TOKEN },
          transactions: [{“type”: “title”, “value”: “test”}],
        }),
        output: 'json'
      };
    
      var options = {
        method: 'post',
        payload: payload,
      };
    
      var resp = UrlFetchApp.fetch("https://xxxxxxxx/api/maniphest.edit", options);
    
    推荐文章