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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Apr 23, 2018 in Trello

Using Trello to manage events

As a Jira power user, I was at first doubtful that Trello could benefit my workflow. Jira already uses boards (ones you can customize!), so why would I even need to use Trello?! In this post you will...

986 views 14 11
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