Trello Webhook provides malformed Json?

I've been working on setting up an event notification system for our Discord channel and that requires converting the json that the trello webhook provides the callback URL.

The issue with this is that the json is malformed as it has an additional } after the cards:{} element and another one at the end of the json.

As a result of this I cannot retrieve about half of the data that has been provided including the member that triggered the specific event (If existing)


What can I do about this?

1 answer

Hi Andre,

For more than a year, I've been running a system that receives a pretty large amount of webhooks from Trello, and never received malformed JSON from them.

Are you sure there isn't another part of your system that may be corrupting the data received?

It is entirely possible that I'm doing it wrong however I read that in order to get the json I need to use file_get_contents('php:input') (On my phone, excuse typos)

After logging the contents of this I found that the json is malformed. Is there a better method of doing it? 

Thanks for the reply 😊

I'm not familiar with PHP, but json_decode(file_get_contents('php://input')) seems to be the way to do this.

It's hard to figure out what's not working without understanding your setup and code. If you post the JSON you're getting it may help to see what's wrong.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 20, 2019 in Trello

Using Trello To Facilitate Skillsharing

I work with a lot of really smart people, and chances are, you do, too! Our company encourages learning, even outside of things that relate to our jobs, so a friend of mine and I decided to find a wa...

235 views 1 4
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