# How do i use the body after get users from Management API

**URL:** <https://community.auth0.com/t/how-do-i-use-the-body-after-get-users-from-management-api/8434>\
**Category:** Get Help\
**Tags:** body, react, users, search, management-api\
**Created:** [October 10, 2017, 7:41am UTC](https://community.auth0.com/t/how-do-i-use-the-body-after-get-users-from-management-api/8434 "2017-10-10T07:41:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccae3214](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@ccae3214](https://community.auth0.com/u/ccae3214)\
**Post date:** [October 10, 2017, 7:41am UTC](https://community.auth0.com/t/how-do-i-use-the-body-after-get-users-from-management-api/8434/1 "2017-10-10T07:41:56Z")

</div>

I’am an beginner in auth and react,and i faced some problems,  
After I called the API =\>List or search users ,GET/api/v2/users.This endpoint can be used to retrieve a list of users.

i get the data from body,which is current ,  
but the body information like body.name or body"email"] is undefined .

I’am confuse how to get user information after i called the API.  
I hope someone will help me, I will be very grateful.

---

<div class="post-metadata">

**Author:** ![ccae3214](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@ccae3214](https://community.auth0.com/u/ccae3214)\
**Post date:** [October 10, 2017, 8:44am UTC](https://community.auth0.com/t/how-do-i-use-the-body-after-get-users-from-management-api/8434/2 "2017-10-10T08:44:14Z")

</div>

i think i find the anwser :JSON.parse ,  
and response type is an object array

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [October 10, 2017, 4:10pm UTC](https://community.auth0.com/t/how-do-i-use-the-body-after-get-users-from-management-api/8434/3 "2017-10-10T16:10:17Z")

</div>

As you mentioned in the follow-up comment, the response of the endpoint to list/search users will be a JSON array.

As an additional note, if you are interested in only one actual user and you know its identifier then you may wan to use the [Get a user by ID](https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id) endpoint instead as that will return a single user in a JSON object.

---

<div class="post-metadata">

**Author:** ![ccae3214](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@ccae3214](https://community.auth0.com/u/ccae3214)\
**Post date:** [October 10, 2017, 11:19pm UTC](https://community.auth0.com/t/how-do-i-use-the-body-after-get-users-from-management-api/8434/4 "2017-10-10T23:19:45Z")

</div>

Thank @jmangelo response.  
I have solved my problem,  
The SPA need to add some condition to use JSON.parse.  
Here’s my snippet code.  
{  
b1=JSON.parse(body)  
this.setState({b1})  
const { b1 } = this.state  
if(b1[0]!==undefined)  
{  
return(

### {b1[0].name}

### } } and b1[0].name is work

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:56am UTC](https://community.auth0.com/t/how-do-i-use-the-body-after-get-users-from-management-api/8434/5 "2018-03-02T05:56:54Z")

</div>


