# Closing brace missing in webhook JSON

**URL:** <https://meta.discourse.org/t/closing-brace-missing-in-webhook-json/50418>\
**Category:** Bug\
**Created:** [20 سبتمبر 2016، 11:31م UTC](https://meta.discourse.org/t/closing-brace-missing-in-webhook-json/50418 "2016-09-20T23:31:45Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![DanielMarquard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danielmarquard/32/74010_2.png) [@DanielMarquard](https://meta.discourse.org/u/DanielMarquard)\
**Post date:** [20 سبتمبر 2016، 11:31م UTC](https://meta.discourse.org/t/closing-brace-missing-in-webhook-json/50418/1 "2016-09-20T23:31:45Z")

</div>

I set up a webhook in Discourse today for the first time. I’ve got a great use case for it and can’t wait to finish the code. 🙂

But the post and topic event JSON sent by Discourse is not playing well with my receiving PHP script. PHP fails to parse it. Through `json_last_error_msg`, I saw that there is a syntax error somewhere in the payload, which is why `json_decode` is failing.

From the webhook’s log panel in Discourse, the request JSON validated when I tested it, so I set up a simple script to verify that PHP is receiving the same data that Discourse is reporting, but that doesn’t seem to be the case.

```
<?php

$data = file_get_contents('php://input');
print_r($data);

?>

```

Discourse receives a response that seems to show that a closing brace is omitted in the payload being received by PHP.

Here’s the well-formed JSON payload reported by Discourse:

> <https://pastebin.com/VTtgLWm9>

…and here’s what `print_r` returns to Discourse:

> <https://pastebin.com/qCcyusu9>

---

_[View the full topic](https://meta.discourse.org/t/closing-brace-missing-in-webhook-json/50418)._
