Problem with establish up webhook Asana -> Power Automate

Hi,

I’m having trouble setting up a webhook, specifically the # Handshake response sent by example.com step.

i do it like this:

  1. I send by postman request estabish a webhook
{
     "date": {
         "resource": "<project_GID>",
         "target": "<Flow Power automate recipient URL>",
         "action": "changed",
         "filters": [
             {
                 "resource_type": "task"
             }
         ]
     }
}
  1. in response Flow in Power Autoamte receives # Handshake sent to https://example.com/ in which is X-Hook-Secret

  2. I refer to the address https://app.asana.com/api/1.0/webhooks

{
     "uri": "https://app.asana.com/api/1.0/webhooks",
     "method": "POST",
     "headers": {
         "X-Hook-Secret": "123445",
         "Authorization": "*sanitized*"
     },
     "body": {
         "date": {
             "resource": "<project_GID>"
         }
     }
}
  1. in response Asana sends back:
{
     "statusCode": 400,
     "headers": {
         "Connection": "keep-alive",
         "pragma": "no-cache",
         "X-Frame-Options": "DENY",
         "X-XSS-Protection": "1; mode=block",
         "X-Content-Type-Options": "nosniff",
         "Content-Security-Policy": "report-uri https://app.asana.com/-/csp_report?report_only=false;default-src 'none';frame-src 'none';frame-ancestors 'none' ",
         "X-Asana-Api-Version": "1.0",
         "Asana-Change": "name=new_user_task_lists;info=https://forum.asana.com/t/update-on-our-planned-api-changes-to-user-task-lists-a-k-a-my-tasks /103828,name=new_goal_memberships;info=https://forum.asana.com/t/launched-team-sharing-for-goals/378601;affected=true",
         "X-Robots-Tag": "none",
         "Cache-Control": "no-store",
         "Date": "Thu, 04 May 2023 15:59:42 GMT",
         "server": "nginx",
         "Content-Length": "188",
         "Content-Type": "application/json; charset=UTF-8"
     },
     "body": {
         "errors": [
             {
                 "message": "target: Missing input",
                 "help": "For more information on API status codes and how to handle them, read the docs on errors: https://developers.asana.com/docs/errors"
             }
         ]
     }
}

Where did I go wrong?

Hi @anon4179082,

A couple of thoughts here:

  • In your posted code, you have “date” instead of “data”. (Not sure if that typo is also in your actual code or just what you posted here.)

  • The handshake response you send back needs to come from the target URL, and I’m not sure in your case if that’s happening or it’s coming from some other URL? (I’m not familiar with Power Automate specifically so not sure how it works in this scenario.)

There is “date” in my code, it’s a typo in rewrite.
You may be right that the handshake is not being sent from the correct URL. I will keep looking for a solution to this problem.
Thanks and best regards.

Hi,

thank you for your suggestion, indeed flow in Power Automate was responding from self URL, not a trigger. I chose the wrong response method, instead of the action in the “Response” flow, I chose “HTTP”. I corrected it and it worked, I estabished a webhook.

In short, the trigger in flow is “When a HTTP request is received” and “X-Hook-Secret” is sent with the “Response” action in “Headers”.

Thanks and best regards.

1 Like

Excellent, @anon4179082 - thanks for posting the details of the solution!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.