# Creating a Registrant with Node and JWT

**URL:** <https://devforum.zoom.us/t/creating-a-registrant-with-node-and-jwt/28981>\
**Category:** API and Webhooks\
**Created:** [September 3, 2020, 4:22am UTC](https://devforum.zoom.us/t/creating-a-registrant-with-node-and-jwt/28981 "2020-09-03T04:22:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssoward](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ssoward/32/14606_2.png) [@ssoward](https://devforum.zoom.us/u/ssoward)\
**Post date:** [September 3, 2020, 4:22am UTC](https://devforum.zoom.us/t/creating-a-registrant-with-node-and-jwt/28981/1 "2020-09-03T04:22:10Z")

</div>

**Description**  
Error creating a Registrant via API, JWT, and node.

**Error**  
For some reason I am getting this error, even though I have removed ‘customer\_questions’ from the body.  
body: {  
code: 300,  
message: ‘The parameter is required in custom\_questions: State or Province.’  
},

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
JWT

**Which Endpoint/s?**  
[api.zoom.us/v2/webinars/](http://api.zoom.us/v2/webinars/)" + req.params.id + “/registrants”,

**How To Reproduce (If applicable)**  
Steps to reproduce the behavior:

1. POST  
const registrant = {  
“email”: “sjfkghdsg@someemail.dfgjd”,  
“first\_name”: “Jill”,  
“last\_name”: “Chill”,  
“address”: “dsfhkdjsfh st”,  
“city”: “jackson heights”,  
“country”: “US”,  
“zip”: “11371”,  
“state”: “NY”,  
“phone”: “0000000000”,  
“org”: “WHYTRYTEST”,  
“job\_title”: “Moon walker”  
};  
const options = {  
uri: “[https://api.zoom.us/v2/webinars/](https://api.zoom.us/v2/webinars/)” + req.params.id + “/registrants”,  
qs: {status: ‘active’},  
auth: {‘bearer’: token},  
headers: {‘User-Agent’: ‘Zoom-api-Jwt-Request’, ‘content-type’: ‘application/json’},  
method:‘GET’,  
json: true  
};  
exports.webinarRegistrantsAdd = async (req, res) =\> {  
options.body = registrant;  
rp(opts)  
.then(function (response) {  
res.send(response);  
})  
.catch(function (err) {  
console.log('API call failed, reason ', err);  
});  
}

**Screenshots (If applicable)**  
If applicable, add screenshots to help explain your problem.

**Additional context**  
The docs say that only name and email are required, but got errors saying to provide city, state, and country, which I did, until I got to the this error: ‘The parameter is required in custom\_questions: State or Province.’

Any suggestions would be appreciated, thank you.

---

<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 8, 2020, 4:15pm UTC](https://devforum.zoom.us/t/creating-a-registrant-with-node-and-jwt/28981/2 "2020-09-08T16:15:13Z")

</div>

Hi @ssoward,

Thanks for reaching out, and happy to help. First, I should note that state and province are note required fields, you’re correct. I haven’t been able to reproduce the exact error you’re receiving—however, can you please try the following request in either Postman or cURL?:

```auto
Host: api.zoom.us
Content-Type: application/json
Authorization: Bearer <token>

{
  "email": "example@someemail.dfgjd",
  "first_name": "Phill",
  "last_name": "Chill"
}

```

I also noticed that within const options, you have “method: GET” — please ensure your request is a POST request if you’re trying to add a webinar registrant.

Let me know if you’re able to successfully send the request in Postman or the like!

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![ssoward](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ssoward/32/14606_2.png) [@ssoward](https://devforum.zoom.us/u/ssoward)\
**Post date:** [September 9, 2020, 1:37am UTC](https://devforum.zoom.us/t/creating-a-registrant-with-node-and-jwt/28981/3 "2020-09-09T01:37:22Z")

</div>

Hello Will,

Thanks so much for your response.

The GET you noticed is dynamically updated to a POST. I should have clarified that.

I tried as you mentioned and got the login page for zoom.  
I updated your example with a specific webinar id in the url: [https://api.zoom.us/v2/webinars/93297196054/registrants](https://api.zoom.us/v2/webinars/93297196054/registrants)  
And with the body you suggested:  
{  
“email”: “example@someemail.dfgjd”,  
“first\_name”: “Phill”,  
“last\_name”: “Chill”  
}  
and got:  
{“code”:300,“message”:“The parameter is required: city.”}

 ![postmanJPG002](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/c/cb74667d6758abdb31b153519e419939ecb45cb7.jpeg)

I proceed to solve the 300 errors until I get to this:  
Body:  
{  
“email”: “example@someemail.dfgjd”,  
“first\_name”: “Phill”,  
“last\_name”: “Chill”,  
“city”:“Cincinnati”,  
“country”:“US”,  
“zip”:12345,  
“phone”:1111111111,  
“org”:“testorg”,  
“job\_title”:“testJobTitle”  
}

Result:  
{“code”:300,“message”:“The parameter is required in custom\_questions: State or Province.”}

Also, I have these GETs working fine, suggesting that the auth is setup correctly:  
…api.zoom.us/v2/webinars/93297196054  
…api.zoom.us/v2/webinars/93297196054/registrants

---

<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 11, 2020, 3:49pm UTC](https://devforum.zoom.us/t/creating-a-registrant-with-node-and-jwt/28981/4 "2020-09-11T15:49:19Z")

</div>

Hi @ssoward,

Thanks for confirming those details.

Can you let me know if any custom registration questions have already been created for this webinar in the UI by any chance? If so, these could be the reason you’re being required to pass these fields. This post covers a similar issue:

> [@Getting Custom Question Error While creating the Registrant in Zoom Webinar](https://devforum.zoom.us/t/getting-custom-question-error-while-creating-the-registrant-in-zoom-webinar/3987):
>
> [Image1] I have created a Custom question with my webinar which you can see in the above screen shot. Now I am going to create a registrant with that webinar and passing the values Body: { “address”: “chd”, “city”: “chd”, “comments”: “test”, “country”: “ind”, “custom\_questions”: [{ “title”: “What is your role in the study?”, “value”: “Manager” }], “email”: "nip19@gmail.com", “first\_name”: “nip”, “industry”: “it”, “job\_title”: “soft”, “last\_name”: “trip”, “no\_of\_employees”: “…

If that’s not the case, let me know and I’ll be happy to escalate this if necessary!

Best,  
Will

---

<div class="post-metadata">

**Author:** ![ssoward](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ssoward/32/14606_2.png) [@ssoward](https://devforum.zoom.us/u/ssoward)\
**Post date:** [September 12, 2020, 5:02pm UTC](https://devforum.zoom.us/t/creating-a-registrant-with-node-and-jwt/28981/5 "2020-09-12T17:02:06Z")

</div>

That worked! THANK YOU. And for anyone reading this, this was the template of the successful POST:  
And the ‘value’ of the custom\_question needs to be valid.

```
{
"email": "sjfkghdsg@someemail.dfgjd",
"first_name": "Jill",
"last_name": "Chill",
"city": "jackson heights",
"country": "US",
"zip": "11371",
"state": "Utah",
"phone": "0000000000",
"org": "WHYTRYTEST",
"job_title": "Moon walker",
"custom_questions": [
    {
        "title": "State or Province",
        "value": "Utah"
    }
]

```

};

---

<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 15, 2020, 4:19pm UTC](https://devforum.zoom.us/t/creating-a-registrant-with-node-and-jwt/28981/6 "2020-09-15T16:19:13Z")

</div>

@ssoward — So happy to hear that resolved the issue! 🙂

Best,  
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 16, 2020, 2:19am UTC](https://devforum.zoom.us/t/creating-a-registrant-with-node-and-jwt/28981/7 "2020-10-16T02:19:19Z")

</div>

Closed on October 16, 2020, 2:19am UTC

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