C# Adding registrants to a meeting returns OK (200)

I create meetings on the Web (C#) with type=2 and approval_type=0

Meetings are created well, but when i try to add registrants via: /meetings/{meetingId}/registrants

post returns OK (200), having empty contents

I have a PRO account in Zoom

my source code:

var client = new RestClient(“https://api.zoom.us/v2/users/**************/meetings/”+ meetingID + “/registrants”);
var request = new RestRequest(Method.POST);
request.RequestFormat = DataFormat.Json;
request.AddJsonBody(new { email = emailPerson, first_name = namePerson, last_name = namePerson });
request.AddHeader(“authorization”, String.Format(“Bearer {0}”, tokenString));

        IRestResponse restResponse = client.Execute(request);
        HttpStatusCode statusCode = restResponse.StatusCode;
        int numericStatusCode = (int)statusCode;
        var jObject = JObject.Parse(restResponse.Content);

JObject is empty

any idea what my cause this behaviour??

How do I have to setup parametersof a meeting via API in order to be able to add registrants via API later on the same meeting?

Hey @energytelia,

Thanks for reaching out about adding registrants to your meetings! To clarify, if successful, our Add Meeting Registrants endpoints should return a 201 response.

Here is an example request in C# — let me know if this helps:

var client = new RestClient("https://api.zoom.us/v2/meetings/{meetingId}/registrants");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {token}");
request.AddParameter("application/json", "{\n  \"email\":\"someone@example.com\",\n  \"first_name\": \"Someone\",\n  \"last_name\": \"Somewhere\"\n}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Thanks!
Will

thanks…your code worked…cheers…

Awesome, glad that helps! :slight_smile:

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