# PubSub message inner value comes as a JSON string

**URL:** <https://discuss.dev.twitch.com/t/pubsub-message-inner-value-comes-as-a-json-string/31458>\
**Category:** API\
**Created:** [April 26, 2021, 2:04pm UTC](https://discuss.dev.twitch.com/t/pubsub-message-inner-value-comes-as-a-json-string/31458 "2021-04-26T14:04:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zuphest](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/zuphest/32/12012_2.png) [@zuphest](https://discuss.dev.twitch.com/u/zuphest)\
**Post date:** [April 26, 2021, 2:04pm UTC](https://discuss.dev.twitch.com/t/pubsub-message-inner-value-comes-as-a-json-string/31458/1 "2021-04-26T14:04:53Z")

</div>

Been playing with PubSub today to catch gift sub events.

Noticed that the data.message value for the Subscription event comes as a JSON string  
ie. I have to parse the entire message and then parse the data.message value again.

Just putting it out here and see if it’ll be fixed or reflected in the documentation.  
Not sure if the other endpoints have the same issue.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [April 26, 2021, 2:06pm UTC](https://discuss.dev.twitch.com/t/pubsub-message-inner-value-comes-as-a-json-string/31458/2 "2021-04-26T14:06:25Z")

</div>

PubSub just loves to nest JSON in JSON.

If you have found a documentation error please file it on the [GitHub Issue Tracker](https://github.com/twitchdev/issues/issues)

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [May 26, 2021, 2:06pm UTC](https://discuss.dev.twitch.com/t/pubsub-message-inner-value-comes-as-a-json-string/31458/3 "2021-05-26T14:06:30Z")

</div>

Closed on May 26, 2021, 2:06pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
