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?
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 😊
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.