# “Request Body should be a valid JSON object.” (post /meetings/{meetingId}/registrants)

**URL:** <https://devforum.zoom.us/t/request-body-should-be-a-valid-json-object-post-meetings-meetingid-registrants/30534>\
**Category:** API and Webhooks\
**Created:** [September 17, 2020, 8:07am UTC](https://devforum.zoom.us/t/request-body-should-be-a-valid-json-object-post-meetings-meetingid-registrants/30534 "2020-09-17T08:07:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![j.amelsberg](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/j.amelsberg/32/11997_2.png) [@j.amelsberg](https://devforum.zoom.us/u/j.amelsberg)\
**Post date:** [September 17, 2020, 8:07am UTC](https://devforum.zoom.us/t/request-body-should-be-a-valid-json-object-post-meetings-meetingid-registrants/30534/1 "2020-09-17T08:07:12Z")

</div>

I want to register users for some meeting base on zoom api. Source is next:

> **[Add Meeting Registrant - Meetings - Zoom API - API Reference](https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantcreate)**
>
> Register a participant for a meeting.
> 
> Prerequisite:
> 
> Host user type must be "Licensed".
> 
> Scopes: meeting:write:admin meeting:write
> Rate Limit Label: L...

  
but I cant do it.

my php code is:

\<?php $client = Drupal::service('zoomapi.client'); $user = array( "email"=\>$udata['uemail'], "first\_name"=\>stripslashes($udata['ufirstname']), "last\_name"=\>stripslashes($udata['ulastname']), "address"=\>"", "city"=\>"", "country"=\>"DE", "zip"=\>"", "state"=\>"", "phone"=\>"", "industry"=\>"", "org"=\>"", "job\_title"=\>"", "purchasing\_time\_frame"=\>"", "role\_in\_purchase\_process"=\>"", "no\_of\_employees"=\>"", "comments"=\>"", "custom\_questions"=\>array(), "language"=\>"de-DE" ); $meeting\_number = 944876713XX; $response = $client-\>request('POST', '/meetings/' . $meeting\_number . '/registrants', ['headers' =\> ['Content-Type' =\> 'application/json'], 'body' =\>[json\_encode($dataJson)] ] ); //I tried too, because required is email and firstname $user = array( "email"=\>$udata['uemail'], "first\_name"=\>stripslashes($udata['ufirstname']), "last\_name"=\>stripslashes($udata['ulastname']), /\* "address"=\>"", "city"=\>"", "country"=\>"DE", "zip"=\>"", "state"=\>"", "phone"=\>"", "industry"=\>"", "org"=\>"", "job\_title"=\>"", "purchasing\_time\_frame"=\>"", "role\_in\_purchase\_process"=\>"", "no\_of\_employees"=\>"", "comments"=\>"", "custom\_questions"=\>array(), "language"=\>"de-DE"\*/ ); $response = $client-\>request('POST', '/meetings/' . $meeting\_number . '/registrants', $user); ?\>

I get this error:  
_GuzzleHttp\Exception\ClientException_ : Client error: `POST https://api.zoom.us/v2/meetings/94487671384/registrants?headers%5BContent-Type%5D=application%2Fjson&body%5B0%5D=%7B%22email%22%3A%22masteroma%40gmail.com%22%2C%22first_name%22%3A%22Roman%22%2C%22last_name%22%3A%22Bunyak%22%7D` resulted in a `400 Bad Request` response: \<?xml version="1.0" encoding="UTF-8" standalone="yes"?\>`300`Request Body should be a valid JS (truncated…) in _GuzzleHttp\Exception\RequestException::create()_ (line _114_ of _vendor/guzzlehttp/guzzle/src/Exception/RequestException.php_ ).

It would be great if you can help me with this.

Thank you!

---

<div class="post-metadata">

**Author:** ![teo.goddet](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/teo.goddet/32/6361_2.png) [@teo.goddet](https://devforum.zoom.us/u/teo.goddet)\
**Post date:** [September 18, 2020, 6:54am UTC](https://devforum.zoom.us/t/request-body-should-be-a-valid-json-object-post-meetings-meetingid-registrants/30534/2 "2020-09-18T06:54:06Z")

</div>

I have the same error with a curl request, the same request works into postman, I tought about encoding but cannot find the problem

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [September 21, 2020, 5:57pm UTC](https://devforum.zoom.us/t/request-body-should-be-a-valid-json-object-post-meetings-meetingid-registrants/30534/3 "2020-09-21T17:57:02Z")

</div>

Hi @j.amelsberg,

Do you run into the same error when you try sending this request in Postman? It seems like this could be an issue with your environment.

Can you try sending this using the tool in our documentation and let us know if you still run into the same error—you can test from the bottom of this endpoint’s documentation, and generate a code snippet in various languages:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/2/2a65794c4101261f586027c545f02d7d2e8b486e.png)

If you are still seeing an error, can you post the request URL and the raw JSON you’re sending in the request?

Thanks!  
Will

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [September 21, 2020, 5:57pm UTC](https://devforum.zoom.us/t/request-body-should-be-a-valid-json-object-post-meetings-meetingid-registrants/30534/4 "2020-09-21T17:57:48Z")

</div>

Hi @teo.goddet,

If your request is working fine in Postman, it’s likely an issue with your environment/code. Have you tried our code generator tool (see post above)?

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [October 22, 2020, 3:57am UTC](https://devforum.zoom.us/t/request-body-should-be-a-valid-json-object-post-meetings-meetingid-registrants/30534/5 "2020-10-22T03:57:51Z")

</div>

Closed on October 22, 2020, 3:57am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
