# Always get “Request Body should be a valid JSON object."  when create a user

**URL:** <https://devforum.zoom.us/t/always-get-request-body-should-be-a-valid-json-object-when-create-a-user/1327>\
**Category:** API and Webhooks\
**Created:** [June 5, 2018, 9:01am UTC](https://devforum.zoom.us/t/always-get-request-body-should-be-a-valid-json-object-when-create-a-user/1327 "2018-06-05T09:01:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![1116](https://avatars.discourse-cdn.com/v4/letter/1/439d5e/32.png) [@1116](https://devforum.zoom.us/u/1116)\
**Post date:** [June 5, 2018, 9:01am UTC](https://devforum.zoom.us/t/always-get-request-body-should-be-a-valid-json-object-when-create-a-user/1327/1 "2018-06-05T09:01:09Z")

</div>

POST [https://api.zoom.us/v2/users](https://api.zoom.us/v2/users)

{

“action”: “autoCreate”,  
“user\_info”: {  
“email”: “[hahaha@bytedance.com](mailto:hahaha@bytedance.com)”,  
“type”: “basic”,  
“password”: “1wW2e5367”  
}  
}

---

<div class="post-metadata">

**Author:** ![michael\_p.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_p.zoom/32/18105_2.png) [@michael\_p.zoom](https://devforum.zoom.us/u/michael_p.zoom)\
**Post date:** [June 5, 2018, 5:02pm UTC](https://devforum.zoom.us/t/always-get-request-body-should-be-a-valid-json-object-when-create-a-user/1327/2 "2018-06-05T17:02:09Z")

</div>

Hi,&nbsp;

Can you try to replace " **basic"** with " **1**"?&nbsp;

“type”: “basic”, -\>&nbsp;“type”: “1”,

Thanks

Michael

---

<div class="post-metadata">

**Author:** ![1116](https://avatars.discourse-cdn.com/v4/letter/1/439d5e/32.png) [@1116](https://devforum.zoom.us/u/1116)\
**Post date:** [June 6, 2018, 9:26am UTC](https://devforum.zoom.us/t/always-get-request-body-should-be-a-valid-json-object-when-create-a-user/1327/3 "2018-06-06T09:26:03Z")

</div>

It works for me. Thank you.

May be you can change the response message.&nbsp; I mean this request is indeed a valid json object.

---

<div class="post-metadata">

**Author:** ![michael\_p.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_p.zoom/32/18105_2.png) [@michael\_p.zoom](https://devforum.zoom.us/u/michael_p.zoom)\
**Post date:** [June 6, 2018, 4:13pm UTC](https://devforum.zoom.us/t/always-get-request-body-should-be-a-valid-json-object-when-create-a-user/1327/4 "2018-06-06T16:13:50Z")

</div>

Hi,&nbsp;

We’ll put in a request to change & display a more accurate message.&nbsp;

Thanks

Michael

---

<div class="post-metadata">

**Author:** ![Sachin\_E](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sachin\_E](https://devforum.zoom.us/u/Sachin_E)\
**Post date:** [September 21, 2018, 1:14pm UTC](https://devforum.zoom.us/t/always-get-request-body-should-be-a-valid-json-object-when-create-a-user/1327/5 "2018-09-21T13:14:44Z")

</div>

Hi Michael,  
I am trying to create meeting from my cURL call, for that I am sending data as follows

$headers = array (“Content-Type: application/json”);  
$json\_encode = json\_encode($data1);  
&nbsp; - here $data1 having form data which I am sending

$ch = curl\_init();  
curl\_setopt($ch, CURLOPT\_HTTPHEADER, $headers);  
curl\_setopt($ch, CURLOPT\_RETURNTRANSFER,1);  
curl\_setopt($ch, CURLOPT\_URL, $url);  
curl\_setopt($ch, CURLOPT\_CUSTOMREQUEST, “POST”);  
curl\_setopt($ch, CURLOPT\_POSTFIELDS, $data\_json);  
curl\_setopt($ch, CURLOPT\_SSL\_VERIFYPEER, false);  
$response = curl\_exec($ch);

if I print $data\_json, then I got following output

{  
&nbsp;“topic”:“Get test meeting creation”,  
&nbsp;“type”:“2”,  
&nbsp;“start\_time”:“2018-09-21’T’17:09:00’Z”,  
&nbsp;“duration”:60,  
&nbsp;“timezone”:“Colombo, India Standard Time”,  
&nbsp;“password”:"",  
&nbsp;“agenda”:“Test”,  
&nbsp;“recurrence”:{  
&nbsp;&nbsp; &nbsp;“type”:“1”,  
&nbsp;&nbsp; &nbsp;“repeat\_interval”:“1”,  
&nbsp;&nbsp; &nbsp;“weekly\_days”:"""",  
&nbsp;&nbsp; &nbsp;“monthly\_day”:"""",  
&nbsp;&nbsp; &nbsp;“monthly\_week”:"""",  
&nbsp;&nbsp; &nbsp;“monthly\_week\_day”:"""",  
&nbsp;&nbsp; &nbsp;“end\_times”:"""",  
&nbsp;&nbsp; &nbsp;“end\_date\_time”:""""  
&nbsp; },  
&nbsp;“settings”:{  
&nbsp;&nbsp; &nbsp;“host\_video”:“false”,  
&nbsp;&nbsp; &nbsp;“participant\_video”:“false”,  
&nbsp;&nbsp; &nbsp;“cn\_meeting”:“false”,  
&nbsp;&nbsp; &nbsp;“in\_meeting”:“false”,  
&nbsp;&nbsp; &nbsp;“join\_before\_host”:“true”,  
&nbsp;&nbsp; &nbsp;“mute\_upon\_entry”:“false”,  
&nbsp;&nbsp; &nbsp;“watermark”:“false”,  
&nbsp;&nbsp; &nbsp;“use\_pmi”:“false”,  
&nbsp;&nbsp; &nbsp;“approval\_type”:“3”,  
&nbsp;&nbsp; &nbsp;“registration\_type”:“1”,  
&nbsp;&nbsp; &nbsp;“audio”:“both”,  
&nbsp;&nbsp; &nbsp;“auto\_recording”:“none”,  
&nbsp;&nbsp; &nbsp;“enforce\_login”:“true”  
&nbsp;}  
}

in above code of cURL if I print $response then I got the response as  
string(68) “{“code”:300,“message”:“Request Body should be a valid JSON object.”}”

Please help me for this as soon as possible.

Thanks  
Sachin

---

<div class="post-metadata">

**Author:** ![michael\_p.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_p.zoom/32/18105_2.png) [@michael\_p.zoom](https://devforum.zoom.us/u/michael_p.zoom)\
**Post date:** [September 21, 2018, 10:28pm UTC](https://devforum.zoom.us/t/always-get-request-body-should-be-a-valid-json-object-when-create-a-user/1327/6 "2018-09-21T22:28:32Z")

</div>

Hi Sachin,&nbsp;

The error has something to do with your request payload. Have you tried to paste your request payload into an JSON formatter and then use it within POSTman?

Thanks

---

<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:48pm UTC](https://devforum.zoom.us/t/always-get-request-body-should-be-a-valid-json-object-when-create-a-user/1327/7 "2020-08-21T17:48:54Z")

</div>

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


