I able to create webhook but struggling to get post data of that url

Here is the registred webhook.

{
"id": "59fb6f025f9638a2b081201a",
"description": "Trello Webhook Server",
"idModel": "59edd17a48fa712db6465109",
"callbackURL": "https://gitbub-trello-webhook.firebaseapp.com/trelloUserWebhook",
"active": true
}

When i try to hit the callback url in the browser, I get empty output.

{}

I am really trying hard  from 2 weeks to get this working please some one help me on this.

Below is the way i am trying to get posted data:

//Code to get user activity on board.

app.get("/trelloUserWebhook", (req, res, next) => {

res.send(req.body);

});

1 answer

0 vote
Bentley Cook Atlassian Team Nov 07, 2017

The callback URL you provided when creating the webhook will be the URL that Trello sends a request to with updates whenever an action occurs related to the object representing by the idModel.

Assuming that 59edd17a48fa712db6465109 is the ID of a user that you want to receive updates about, you can change your server code to:

app.use("/trelloUserWebhook", (reqresnext=> {
  console.log(JSON.stringify(req.body, null, 2));
  res.sendStatus(200);
});

Now, whenever an action occurs for that user, Trello will POST a request to that URL and the request body will contain data about what action occurred.

You can also get all of the recent actions for the user by making a request to Trello's 1/members/{memberID}/actions API resource:

https://api.trello.com/members/59edd17a48fa712db6465109/actions?key={yourAPIkey}&token={yourAPItoken}

The difference between these two setups is that in the former, Trello is notifying you of updates and in the latter you are asking (also known as polling) Trello for the most recent information.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Feb 02, 2018 in Trello

Atlassian User Groups: Trello edition

You’re invited to our first ever Trello User Groups   Good news for current and aspiring Trello enthusiasts! We’re launching Trello User Groups so that you can network, share ideas, solve ...

1,738 views 14 14
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you