0

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

参考这个 SO question 和接受的答案。 从 Google Apps 脚本创建 Asana 任务

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") 
4

1 回答 1

0

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

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

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

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

于 2016-07-12T06:55:15.120 回答