# Cannot parse data of postman webhook

**URL:** <https://community.postman.com/t/cannot-parse-data-of-postman-webhook/56991>\
**Category:** Help Hub\
**Tags:** collections, json\
**Created:** [January 26, 2024, 8:42pm UTC](https://community.postman.com/t/cannot-parse-data-of-postman-webhook/56991 "2024-01-26T20:42:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![msewell13](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@msewell13](https://community.postman.com/u/msewell13)\
**Post date:** [January 26, 2024, 8:42pm UTC](https://community.postman.com/t/cannot-parse-data-of-postman-webhook/56991/1 "2024-01-26T20:42:50Z")

</div>

I have a postman webhook setup but I’m having a problem parsing the data. I am accessing the request body exactly as outlined in documentation…

```auto
var previousRequest = JSON.parse(globals.previousRequest),
    webhookRequestData = previousRequest.data;

```

The problem is `webhookRequestData` is not valid json and I am unable to access any of the information.

Here is an example response:

```auto
{ '{"fcResponse":{"responseData":{"cmContact":{"ownerType":"Franchisee","country":"USA","_pickYourDesiredAppointmentDate583732175":"","contactFirstName":"Samantha","_vehicleserviceinterest1497622543":"Vehicle Wraps Graphics","_commercial1827422581":"","contactType":"Retail Customers","_vehicleEngine1759783270":"","_buildingType363061559":"","suffix":"","_ifThisIsRegardingASpecificServiceYouReceivedWhenDidT1573731334":"","areaID":"","unsubscribe":"Opted In","cmLeadStatusID":"New","state":"","_enterYourDesiredAppointmentTime853588546":"","contactAddedBy":"Web SERVICE","emailIds":"notreal@gmail.com","areaReferenceId":"","bounceEmailStatus":"No","_dynamicCoupon188185671":"","cmSource3ID":"TintWorld.com Quote Request","_emailSignUp1344452027":"Yes","_recommendedButDeclined27767687":"","cmSource1ID":"","_formType1540301458":"quote","_vesselType1902339993":"","zipcode":"","smsUnsubscribeDate":"","franchiseeReferenceId":"513159907","contactedBySmartScheduler":"","_vehicleSubmodel1467066024":"","lastContactedField":"","contactAddDate":"2024-01-26T18:47Z","contactLastName":"Nott","divisionID":"","position":"","smartSchedulerAppointmentDate":"","_vehicleMake139916510":"Ford","_vehicleYear1213765475":"2019","_vehicleModel427539974":"Mustang","extn":"","city":"","_marine368878106":"","contactAddedByReferenceId":"2","spamEmailStatus":"No","referenceId":"673780370","phoneNumbers":"1234567890","_automotive2043077692":"Vehicle Wraps Graphics","faxNumbers":"","tenantID":"TintWorld92","respondedToSmartScheduler":"","bounceReason":"","smsUnsubscribe":"Opt-In Request not Sent","unsubscribeDate":"","_homeType32064006":"","franchiseeNo":"TN - Memphis - Store076","alternateEmail":"","comments":"2019 mustang eco boost color black Looking to wrap a metallic teal color","address":"","cmSource2ID":"Internet","mobileNumbers":"","_residential648719965":"","_syncid1307531401":"","contactModifyDate":"","unsubscribeReason":"","contactOwnerReferenceId":"1705095989","cmLeadSubStatusID":"","_vehicleDoors1043267202":"2","contactOwnerID":"Tint World Store 076 Manager","accountDetails":{"emailIds":"","accountName":"","accountType":"","companyAddDate":"","referenceId":""},"unsubscribeReasonDetail":"","divisionReferenceId":"","serviceID":"Email Communications, Information Email","_requestType2131132030":"","_mileageIn633847082":""}},"responseStatus":"Success","responseId":"1050617154"}}': ''}

```

If I delete the outer curly braces along with the extra characters it would be valid json. I tried converting to a string to strip the extra characters and reparsing but was never able to get it to work. Has anyone else run into this issue before? Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [January 26, 2024, 8:57pm UTC](https://community.postman.com/t/cannot-parse-data-of-postman-webhook/56991/2 "2024-01-26T20:57:12Z")

</div>

Hey @msewell13 👋

Welcome to the Postman community :postman:

Which documentation are you following? Do you have a link to that?

If its from this:

> **[Trigger collection runs using webhooks | Postman Learning Center](https://learning.postman.com/docs/collections/running-collections/collection-webhooks/#accessing-the-request-body-in-scripts)**
>
> Trigger collection runs using webhooks: documentation for Postman, the collaboration platform for API development. Create better APIs—faster.

```auto
var previousRequest = JSON.parse(globals.previousRequest),
    webhookRequestData = previousRequest.data;

// webhookRequestData contains the data sent to your webhook.
console.log(JSON.stringify(webhookRequestData)); 

```

Are you using `JSON.stringify()` with your response?

---

<div class="post-metadata">

**Author:** ![msewell13](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@msewell13](https://community.postman.com/u/msewell13)\
**Post date:** [January 26, 2024, 9:38pm UTC](https://community.postman.com/t/cannot-parse-data-of-postman-webhook/56991/3 "2024-01-26T21:38:21Z")

</div>

Thanks for responding. Yes, that is the documentation I was referring too. I did not however use the JSON.stringify().

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [February 25, 2024, 9:39pm UTC](https://community.postman.com/t/cannot-parse-data-of-postman-webhook/56991/4 "2024-02-25T21:39:06Z")

</div>

Closed on February 25, 2024, 9:39pm UTC

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