what all things is necessary for creating the webhook

This post was flagged by the community and is temporarily hidden.

I find the documentation to be quite complete, isn’t it? https://developers.asana.com/docs/establish-a-webhook

can you just explain steps in just simple way.

am i doing right?. above given details

I believe I can’t explain better than the documentation. You might need to read the whole thing several time though, this is not an easy topic. @Phil_Seeman what do you think?

What all things need to accept in target url

I am sorry I don’t understand the question.

@test_user,

I recommend getting a webhook going without using any filtering first, as filtering just adds complexity. Once you have it working without any filters, you can add the filtering in later.

Remove the “actions” line - that’s part of filtering and isn’t in the correct syntax anyway.

What you need to add, in addition to the target parameter, is a resource parameter that provides the ID of the object you want to set the webhook on. In other words. something like:

{
  "data": {
    "resource": "12345",
    "target": "https://example.com/receive-webhook/7654?app_specific_param=app_specific_value"
  }
}

In the target URL, this is what you need to do:

When a webhook is created, we will send a test POST to the target with an X-Hook-Secret header. The target must respond with a 200 OK or 204 No Content and a matching X-Hook-Secret header to confirm that this webhook subscription is indeed expected.

what should i add here

That’s purely optional; you would just use that if you want to include any additional helpful info when the webhook events come back to you.

For example, I use it to pass a unique ID for each user in my app’s external database; so that when I get a webhook event, I can easily know which of my users it belongs to.

so you mean upto here is enough …right?

This post was flagged by the community and is temporarily hidden.

Right!

Please post the exact contents of your webhook request, but XXXXX out your auth token.

    headers = {
        'Content-Type': 'application/json',
        'Accept': 'application/json',
        'Authorization': 'Bearer 1XXXXXXXXXXXX',
    }

    data = {
        "resource": "1191316121663167",
        "target": "https://console.growthplug.com/api/meeting/asana-webhook"
    }

    response = requests.post('https://app.asana.com/api/1.0/webhooks', headers=headers, data=data)
    print(response.json())
    return Response("success")

I think what’s missing is wrapping your resource and target in a data structure:

    data = {
        {
            "data": {
                "resource": "1191316121663167",
                "target": "https://console.growthplug.com/api/meeting/asana-webhook"
            }
        }

    }

when i give like this , it shows unhashable dict

    data = {"data": [{"resource": "1191316121663167",
                      "target": "my url"}]}

also tried this one, am getting this error again

{‘errors’: [{‘help’: ‘For more information on API status codes and how to handle them, read the docs on errors: —’, ‘message’: ‘Could not parse request data, invalid JSON’}]}

@Phil_Seeman
i also tried this method

still it showing another error

Invalid Request: The remote server responded with an incorrect status code: 403

please help me out

Aha, you’re making progress!!

That means you’ve now gotten the syntax of the request right and the request has successfully made it to the Asana servers for processing.

See the list of response codes here for info on a 403. Looks like maybe you don’t have full permission to access to the resource you specified? Not sure exactly what that 403 means…

its showing you dont have access to this resources