Elastic webhooks integration

Hi, I’m trying to integrate Elastic webhooks (Webhook connector and action | Kibana Guide [8.0] | Elastic) which are using axios with Asana in order to create tasks.
My request is authenticated correctly and also sending proper headers ‘Content-Type: application/json’; ‘Accept: application/json’ and ‘Authorization: Bearer {access-token}’

Unfortunately I’m continuously getting error 400 bad request when giving following body:


{
    "data": {
        "projects": "12345",
        "followers": [
            {
                "gid": "12345,123456,1234567"
            }
        ],
        "name": "Test",
        "notes": "Test"
    }
}

Could anyone give a hand what could be wrong with this body request.

Hi,

Sometimes the 400 error has a text in the body with the error message, you don’t? Which endpoint are you calling?
pinging @Phil_Seeman the best at web hooks, just in case

On elastic side it’s just this error message

    error calling webhook, invalid response
Details:
    [400] Bad Request

However when testing the same body with postman, I’m getting 400 with bad syntax response.

Calling https://app.asana.com/api/1.0/tasks

Hi @anon75604222,

projects needs to be an array, like

"projects": [
      "12345"
    ],

Good catch!

Thanks, however that still doesn’t fix the issue,

I rewrote it to this example, it’s valid json, but Asana api is still giving me 400 :frowning:

{
    "data": {
        "projects": [
               "12345"
        ],
        "followers": [
            {
                "gid": "12345,123456,1234567"
            }
        ],
        "name": "Test",
        "notes": "Test"
    }
}

Oh wait, followers should not specify the word gid, it should just be the gids.

I simplified it, tried different variations so it looks like example bellow but still not passing over response [400] Bad Request

{
    "data": {
        "projects": [
               "12345"
        ],
        "name": "Test",
        "notes": "Test"
    }
}

Where you have “12345”, are you sure you’re sending a valid project gid?

Have you tried it without the projects just to simplify it even more (not saying that’s the solution in the end, just for testing purposes)?

I tried the same gids over curl and it was working fine, tasks were created without issues.

Tried your suggestion, but it didn’t change a thing

{
    "data": {
        "name": "Test",
        "notes": "Test"
    }
}

So if it worked over curl (good job trying it that way!) then the issue isn’t with your syntax or anything on the Asana end, but with your Elastic environment. Afraid I can’t help there personally (I use MS Azure) but that would be the appropriate focus.