我可以使用Google Apps脚本作为Asana Webhooks端点(doPost)吗? [英] Can I use Google Apps Script as Asana Webhooks endpoint (doPost)?

查看:298
本文介绍了我可以使用Google Apps脚本作为Asana Webhooks端点(doPost)吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将 Google文档 Asana 连接。我可以从 Google文档创建任务,并将连接保存到 MySql 数据库,以便我可以在 Google文档中显示任务。

现在我需要将这些任务随时与 Asana 同步,所以我想创建 Asana webhooks 。我在 Google Apps脚本中创建了一个 doPost功能这应该作为一个终点。但是,当我启动握手时,我没有收到来自 Asana Google Web App 的请求。

为确保我做的一切正确,我还在 PHP 中创建了一个握手,这是我更熟悉的。我遇到的唯一问题是 SSL证书。但我认为这不应该是 Google 的问题。此外,我的 Google Web App 是公开的,因此不应该有任何限制(我使用 Postman 。我收到来自 Postman 的请求。为确保收到请求,我还在 Google文档



我做错了什么?

解决方案

简短回答:



Google Apps脚本不能用作Asana Webhooks终结点。

长答案:

您可以使用doPost功能收到Google Apps Script的发布请求。因此,可以完成 Asana Webhooks握手的前两步。但是,无法为握手的第三步发送适当的响应,因为您无法读取从Asana收到的发布请求的标题,也无法将响应的标题设置回Asana。以下是我在回答中发现的关于在Google Apps脚本中阅读和设置标头的信息。


I'm trying to connect Google Docs with Asana. I can create tasks from Google Docs and save the connection to MySql database so I can display tasks inside Google Document.

Now I need those tasks to be synced with Asana all the time, so I wanted to create Asana webhooks. I created a doPost funtion in Google Apps Script which should serve as an endpoint. But when I initiate the starting handshake I don't receive a request from Asana to my Google Web App.

To be sure I'm doing everything right I also created a handshake in PHP, which I'm more familiar with. The only problem I had was a SSL certificate. But I think that shouldn't be the problem with Google. And also my Google Web App is public so there shouldn't be any restrictions (I tested it with Postman. I'm receiving requests from Postman. To be sure I receive a request I also created a log into a Google Document.)

What am I doing wrong?

解决方案

Short answer:

Google Apps Script cannot be used as Asana Webhooks endpoint.

Long answer:

You can receive post requests to Google Apps Script with doPost function. So the first two steps of Asana Webhooks handshake can be accomplished. But there is no way to send a proper response for the third step of the handshake, because you can't read headers of the post request received from Asana and you also can't set the headers of the response back to Asana. Here is the answer I have found about reading and setting headers in Google Apps Script.

这篇关于我可以使用Google Apps脚本作为Asana Webhooks端点(doPost)吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆