# Parse Authtoken from response body

**URL:** <https://community.postman.com/t/parse-authtoken-from-response-body/44013>\
**Category:** Help Hub\
**Tags:** authentication\
**Created:** [February 15, 2023, 1:21pm UTC](https://community.postman.com/t/parse-authtoken-from-response-body/44013 "2023-02-15T13:21:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mission-specialist-4](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@mission-specialist-4](https://community.postman.com/u/mission-specialist-4)\
**Post date:** [February 15, 2023, 1:21pm UTC](https://community.postman.com/t/parse-authtoken-from-response-body/44013/1 "2023-02-15T13:21:11Z")

</div>

Hello,

Im trying to parse bearer-token from response body, although body doesnt have any variable, which i can grab. Just bare text ( on pic)

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/0/5/0536219eb721faff63177056244aa8da250c588a.png)

I’ve already tried: var jsonData = JSON.parse(responseBody)  
postman.setEnvironmentVariable(“authtoken”, jsonData.token);

but it does not work. Asking for help to parse this bare text and then set it as variable in env

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 15, 2023, 1:30pm UTC](https://community.postman.com/t/parse-authtoken-from-response-body/44013/2 "2023-02-15T13:30:33Z")

</div>

Have a look at the following and see if that answers your question.

[Set a variable from raw text response - Just getting started - Postman](https://community.postman.com/t/set-a-variable-from-raw-text-response/11522)
