问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/41357834/can-i-use-google-apps-script-as-asana-webhooks-endpoint-dopost