# Getting JSONError: Unexpected token '{' when i run pm.response.json() in test script for chuncked Json data

**URL:** <https://community.postman.com/t/getting-jsonerror-unexpected-token-when-i-run-pm-response-json-in-test-script-for-chuncked-json-data/33115>\
**Category:** Help Hub\
**Created:** [March 3, 2022, 4:29am UTC](https://community.postman.com/t/getting-jsonerror-unexpected-token-when-i-run-pm-response-json-in-test-script-for-chuncked-json-data/33115 "2022-03-03T04:29:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![siba19](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@siba19](https://community.postman.com/u/siba19)\
**Post date:** [March 3, 2022, 4:29am UTC](https://community.postman.com/t/getting-jsonerror-unexpected-token-when-i-run-pm-response-json-in-test-script-for-chuncked-json-data/33115/1 "2022-03-03T04:29:54Z")

</div>

Hi folks,

When i parse the json body by pm.response.json() I am getting ( JSONError: Unexpected token ‘{’ ) This error , My response will be in chunked- JSON format.

Kindly Help me how can i parse the response and check for a value in the response via test scripts.

Response sample :- {  
“groups”: [  
{  
“name”: “My Company”,  
“objId”: “ttt-tt-tt-tt-tt”  
},  
{  
“name”: “Test123 my company test”,  
“objId”: “ttt-yy-yy-yy-tttt”  
}]  
}

{  
“groups”: [  
{  
“name”: “My Company”,  
“objId”: “ttt-tt-tt-tt-tt”  
},  
{  
“name”: “Test123 my company test”,  
“objId”: “ttt-yy-yy-yy-tttt”  
}]  
}

---

<div class="post-metadata">

**Author:** ![sahuvikramp](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/sahuvikramp/32/10828_2.png) [@sahuvikramp](https://community.postman.com/u/sahuvikramp)\
**Post date:** [March 3, 2022, 8:24am UTC](https://community.postman.com/t/getting-jsonerror-unexpected-token-when-i-run-pm-response-json-in-test-script-for-chuncked-json-data/33115/2 "2022-03-03T08:24:26Z")

</div>

Hey @siba19, Welcome to the community 🎉

I think the issue is with **“** and **”** which is making your response as string (which is fine) but when I am trying to convert the string into JSON it gets broken with below error.

![Screenshot 2022-03-03 at 1.53.17 PM](https://us1.discourse-cdn.com/getpostman/original/3X/3/f/3fc0e08b93809f0fdf13733e370cd99563a474f5.png)

Please try changing your response with below one:

```json
{
    "groups": [
        {
            "name": "My Company",
            "objId": "ttt-tt-tt-tt-tt"
        },
        {
            "name": "Test123 my company test",
            "objId": "ttt-yy-yy-yy-tttt"
        }
    ]
}

```

Cheers
