# Not getting full response from API

**URL:** <https://devforum.zoom.us/t/not-getting-full-response-from-api/604>\
**Category:** API and Webhooks\
**Created:** [June 2, 2017, 11:43am UTC](https://devforum.zoom.us/t/not-getting-full-response-from-api/604 "2017-06-02T11:43:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raymond\_Lee](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/raymond_lee/32/11505_2.png) [@Raymond\_Lee](https://devforum.zoom.us/u/Raymond_Lee)\
**Post date:** [June 2, 2017, 11:43am UTC](https://devforum.zoom.us/t/not-getting-full-response-from-api/604/1 "2017-06-02T11:43:54Z")

</div>

I have the api working, and I’m succesfully creating users no problem.&nbsp;

However, on my end when I parse the response, whether in XML or JSON, I’m only getting a partial response with “…” at the end. I don’t know if that’s on my end or ZOOM’s end but if anyone has thoughts I’d appreciate it!&nbsp;

Here’s a var\_dump of the xml response, you can see where it ends at the disable\_recording element. Thanks!&nbsp;

| string(2198) “\<?xml version=“1.0” encoding=“UTF-8”?\> |  
| &nbsp; | \<result\> |  
| &nbsp; | \<id\>TwI0-Y2vS8GrzQtfp8R3GQ\</id\> |  
| &nbsp; | \<email\>test[496404167@domain.com](mailto:496404167@domain.com)\</email\> |  
| &nbsp; | \<first\_name\>David\</first\_name\> |  
| &nbsp; | \<last\_name\>\</last\_name\> |  
| &nbsp; | \<pic\_url\>\</pic\_url\> |  
| &nbsp; | \<type\>1\</type\> |  
| &nbsp; | \<disable\_chat\>false\</disable\_chat\> |  
| &nbsp; | \<disable\_private\_chat\>false\</disable\_private\_chat\> |  
| &nbsp; | \<enable\_e2e\_encryption\>false\</enable\_e2e\_encryption\> |  
| &nbsp; | \<enable\_silent\_mode\>false\</enable\_silent\_mode\> |  
| &nbsp; | \<disable\_group\_hd\>false\</disable\_group\_hd\> |  
| &nbsp; | \<disable\_recording\>false\</disable\_reco”… |

---

<div class="post-metadata">

**Author:** ![Joshua\_Woodward1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/joshua_woodward1/32/1480_2.png) [@Joshua\_Woodward1](https://devforum.zoom.us/u/Joshua_Woodward1)\
**Post date:** [June 2, 2017, 3:10pm UTC](https://devforum.zoom.us/t/not-getting-full-response-from-api/604/2 "2017-06-02T15:10:29Z")

</div>

I ran it in the [playground](https://zoom.us/developer/api/playground) at got the response below, can you share what your code that makes the request looks like (hiding you key/secret)

{  
“id”: “Iez8-viBQf2Ti\_hoQcbSxQ”,  
“email”: “[test496404167@domain.com](mailto:test496404167@domain.com)”,  
“first\_name”: “”,  
“last\_name”: “”,  
“pic\_url”: “”,  
“type”: 1,  
“disable\_chat”: false,  
“disable\_private\_chat”: false,  
“enable\_e2e\_encryption”: false,  
“enable\_silent\_mode”: true,  
“disable\_group\_hd”: false,  
“disable\_recording”: false,  
“enable\_large”: false,  
“large\_capacity”: 0,  
“enable\_webinar”: false,  
“webinar\_capacity”: 0,  
“disable\_feedback”: true,  
“disable\_jbh\_reminder”: false,  
“disable\_cancel\_meeting\_notification”: false,  
“enable\_cmr”: false,  
“enable\_auto\_recording”: false,  
“enable\_cloud\_auto\_recording”: false,  
“enable\_breakout\_room”: true,  
“enable\_polling”: false,  
“enable\_annotation”: true,  
“enable\_auto\_saving\_chats”: false,  
“enable\_co\_host”: true,  
“enable\_enter\_exit\_chime”: false,  
“enable\_remote\_support”: false,  
“enable\_file\_transfer”: false,  
“enable\_virtual\_background”: false,  
“enable\_attention\_tracking”: false,  
“enable\_waiting\_room”: false,  
“enable\_closed\_caption”: false,  
“enable\_far\_end\_camera\_control”: false,  
“enable\_share\_dual\_camera”: false,  
“enable\_phone\_participants\_password”: false,  
“enable\_use\_pmi”: false,  
“enable\_auto\_delete\_cmr”: false,  
“auto\_delete\_cmr\_days”: 0,  
“verified”: 0,  
“pmi”: 6643718568,  
“meeting\_capacity”: 0,  
“created\_at”: “2017-06-02T15:07:12Z”,  
“token”: “”,  
“status”: 0  
}

---

<div class="post-metadata">

**Author:** ![Raymond\_Lee](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/raymond_lee/32/11505_2.png) [@Raymond\_Lee](https://devforum.zoom.us/u/Raymond_Lee)\
**Post date:** [June 2, 2017, 4:05pm UTC](https://devforum.zoom.us/t/not-getting-full-response-from-api/604/3 "2017-06-02T16:05:26Z")

</div>

Thanks Joshua. The code is the php library taken directly from the zoom website with slight modification, making believe it is likely something on my end, but I’m just not sure what it could be. Here’s what I have. The last line I’ve tried parsing/decoding it in different ways:&nbsp;

class ZoomAPI{

/\*The API Key, Secret, & URL will be used in every function.\*/  
private $api\_key = ‘xxx’;  
private $api\_secret = ‘xxx’;  
private $api\_url = ‘[https://api.zoom.us/v1/](https://api.zoom.us/v1/)’;

/\*Function to send HTTP POST Requests\*/  
/\*Used by every function below to make HTTP POST call\*/  
function sendRequest($calledFunction, $data){  
/\*Creates the endpoint URL\*/  
$request\_url = $this-\>api\_url.$calledFunction;

/\*Adds the Key, Secret, & Datatype to the passed array\*/  
$data[‘api\_key’] = $this-\>api\_key;  
$data[‘api\_secret’] = $this-\>api\_secret;  
$data[‘data\_type’] = ‘XML’;

$postFields = http\_build\_query($data);  
/\*Check to see queried fields\*/  
/\*Used for troubleshooting/debugging\*/

/\*Preparing Query…\*/  
$ch = curl\_init();  
curl\_setopt($ch, CURLOPT\_RETURNTRANSFER,1);  
curl\_setopt($ch, CURLOPT\_URL, $request\_url);  
curl\_setopt($ch, CURLOPT\_POST, 1);  
curl\_setopt($ch, CURLOPT\_POSTFIELDS, $postFields);  
curl\_setopt($ch, CURLOPT\_SSL\_VERIFYPEER, false);  
$response = curl\_exec($ch);

/\*Check for any errors\*/  
$errorMessage = curl\_exec($ch);  
curl\_close($ch);

/\*Will print back the response from the call\*/  
/\*Used for troubleshooting/debugging \*/  
//var\_dump($data);  
echo “\<pre\>”; var\_dump($response); exit();  
echo “\<hr\>\<hr\>”;  
if(!$response){  
return false;  
}

/\*Return the data in JSON format\*/

return json\_encode($response);  
}  
/\*Functions for management of users\*/

function createAUser($params){  
$createAUserArray = array();  
$createAUserArray[‘email’] = $params[‘email’];  
$createAUserArray[‘type’] = $params[‘type’];  
$createAUserArray[‘first\_name’] = $params[‘first\_name’];  
createAUserArray['last\_name'] = \_POST[‘last\_name’];  
return $this-\>sendRequest(‘user/create’, $createAUserArray);  
}

}

\*\*\*\*\*

$zoomCreateUser=new ZoomAPI();  
$r = $zoomCreateUser-\>createAUser(  
array(  
“email”=\>“[x@domain.com](mailto:x@domain.com)”,  
“type”=\>“1”,  
“first\_name”=\>“Dan”,  
“last\_name”=\>“Smith”,  
)  
);

$resp=json\_decode(html\_entity\_decode($r),true);

---

<div class="post-metadata">

**Author:** ![Joshua\_Woodward1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/joshua_woodward1/32/1480_2.png) [@Joshua\_Woodward1](https://devforum.zoom.us/u/Joshua_Woodward1)\
**Post date:** [June 2, 2017, 4:44pm UTC](https://devforum.zoom.us/t/not-getting-full-response-from-api/604/4 "2017-06-02T16:44:36Z")

</div>

Where (what environment) are you running this code? I ran what you have in mac terminal and I get the full response, not sure what could be truncating your response with the “…” appended. However you can see the “string(2198)” from the var\_dump and everything up to the “…” is not 2198 in length. So I assume it’s just something when you go to display that is truncating it.

 ![](https://support.zoom.us/hc/user_images/t3p5-yeNV19oa7CBff6jMw.png)

---

<div class="post-metadata">

**Author:** ![Raymond\_Lee](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/raymond_lee/32/11505_2.png) [@Raymond\_Lee](https://devforum.zoom.us/u/Raymond_Lee)\
**Post date:** [June 5, 2017, 4:29pm UTC](https://devforum.zoom.us/t/not-getting-full-response-from-api/604/5 "2017-06-05T16:29:37Z")

</div>

For some reason I was able to get the full response in XML, so I’m rolling with that. I appreciate your help with it. If I figure it out later I’ll come back and post the solution in case it can help others. I assume its a config val or something in our ini, so I’ll check with the admins on it.&nbsp;

Thanks!

---

<div class="post-metadata">

**Author:** ![Joshua\_Woodward1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/joshua_woodward1/32/1480_2.png) [@Joshua\_Woodward1](https://devforum.zoom.us/u/Joshua_Woodward1)\
**Post date:** [June 5, 2017, 4:41pm UTC](https://devforum.zoom.us/t/not-getting-full-response-from-api/604/6 "2017-06-05T16:41:46Z")

</div>

Hey Raymond,

&nbsp;

Looking closer, I see you are doing a var\_dump and exiting early. At that point the response is just a string (and may be getting truncated.

&nbsp;

Also noticed the sample code is wrong

```
/\*Return the data in JSON format\*/return json\_encode($response);

```

Should be

```
/\*Return the data in JSON format\*/return json\_decode($response);

```

If you change your data\_type back to JSON you should get what you’re looking for

```
$data['data\_type'] = 'JSON';  
...  
  
$response = curl\_exec($ch);  
  
$data = json\_decode($response);  
  
var\_dump($data);  
...  

```

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 5:12pm UTC](https://devforum.zoom.us/t/not-getting-full-response-from-api/604/7 "2020-08-21T17:12:20Z")

</div>

Closed on August 21, 2020, 5:12pm UTC


