【问题标题】:Google Script to add Asana Task Error 400谷歌脚本添加 Asana 任务错误 400
【发布时间】:2016-07-05 19:46:26
【问题描述】:

我正在使用以下示例尝试通过 Google Sheets 脚本创建 Asana 任务。

参考这个 SO 问题和接受的答案。 Creating Asana tasks from Google Apps Script

OP 声称它在 2015 年当时有效。现在,在尝试使用我自己的私钥等进行调试后,我收到以下错误。

Asana 的网站有关于 API 的不错的文档,但没有正确格式的 JSON 示例可供参考……据我所知。

我已将此脚本添加到我的 Google 工作表中,并在尝试使用我自己的 PERSONAL_ACCESS_TOKEN、WORKSPACE_ID 和 ASSIGNEE 调试 testTask() 时收到以下错误。

Request failed for app.asana.com/api/1.0/tasks returned code 400. Truncated server response: {"errors":[{"message":"Could not parse request data, invalid JSON","help":"For more information on API status codes and how to handle them, read th... (use muteHttpExceptions option to examine full response) (line 98, file "Code") 

【问题讨论】:

    标签: google-apps-script asana-api


    【解决方案1】:

    您好,您遇到了这个问题,因为您发送到 Asana 的有效负载实际上格式不正确。如果您可以发布要发送到 Asana 的实际有效负载,我将能够帮助您找出问题所在。最好的方法是向 Asana 创建一个 curl 请求。

    此页面应该有示例(带有 json)以帮助您入门:https://asana.com/developers/documentation/getting-started/input-output-options

    我最好的猜测是您可能有一些额外的 " 字符或缺少 ,这会导致您的 json 无效。

    如果没有具体的例子说明什么不适合您,就很难为您提供帮助。祝你好运!

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-10
    • 2018-08-04
    相关资源
    最近更新 更多