# Error while Create Meeting call in C#

**URL:** <https://devforum.zoom.us/t/error-while-create-meeting-call-in-c/28568>\
**Category:** API and Webhooks\
**Created:** [August 30, 2020, 2:54pm UTC](https://devforum.zoom.us/t/error-while-create-meeting-call-in-c/28568 "2020-08-30T14:54:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahaq](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ahaq/32/14345_2.png) [@ahaq](https://devforum.zoom.us/u/ahaq)\
**Post date:** [August 30, 2020, 2:54pm UTC](https://devforum.zoom.us/t/error-while-create-meeting-call-in-c/28568/1 "2020-08-30T14:54:18Z")

</div>

Hi All,

I am creating API calls for ZOOM API in C#. If I call CreateMeeting using RestSharp HttpClient it generates me an error unsupported media type ErrorCode:300

Here is my code

```
var client = new RestClient($"https://api.zoom.us/v2/users/{userId}/meetings");
        var request = new RestRequest(Method.POST);
        
        request.AddHeader("authorization", string.Format("Bearer {0}", tokenString));
        var json = JsonConvert.SerializeObject(new CreateMeetingRequest
        {
            Topic= "Test Meeting",
            Agenda = "Test Meeting",
            Duration = 20,
            Password = "Password",
            Type = Common.MeetingType.InstantMeeting,
            Start_Time = DateTime.Now.ToString()
        });
        
        request.AddParameter("application/json", json);
        IRestResponse response = client.Execute(request);
```

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [August 31, 2020, 10:34pm UTC](https://devforum.zoom.us/t/error-while-create-meeting-call-in-c/28568/2 "2020-08-31T22:34:39Z")

</div>

Hey @ahaq,

Is that error coming from the Zoom API?

Can you log the JSON request body you are sending so I can debug your request?

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![ahaq](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ahaq/32/14345_2.png) [@ahaq](https://devforum.zoom.us/u/ahaq)\
**Post date:** [September 4, 2020, 5:30pm UTC](https://devforum.zoom.us/t/error-while-create-meeting-call-in-c/28568/3 "2020-09-04T17:30:16Z")

</div>

Here is the complete object I am using for the create meeting request

---

<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, 9:50pm UTC](https://devforum.zoom.us/t/error-while-create-meeting-call-in-c/28568/4 "2020-09-08T21:50:52Z")

</div>

Hey @ahaq,

It looks like you might have tried to attach the request body for your create meeting call, but nothing came through. Can you attach a code snippet or screen shot of the JSON you’re sending along with your create meeting request here?

Thanks, and we’ll keep an eye out!

Best,  
Will

---

<div class="post-metadata">

**Author:** ![ahaq](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ahaq/32/14345_2.png) [@ahaq](https://devforum.zoom.us/u/ahaq)\
**Post date:** [September 9, 2020, 6:18pm UTC](https://devforum.zoom.us/t/error-while-create-meeting-call-in-c/28568/5 "2020-09-09T18:18:10Z")

</div>

Thanks for your time I got my fix 🙂

---

<div class="post-metadata">

**Author:** ![ahaq](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ahaq/32/14345_2.png) [@ahaq](https://devforum.zoom.us/u/ahaq)\
**Post date:** [September 9, 2020, 6:19pm UTC](https://devforum.zoom.us/t/error-while-create-meeting-call-in-c/28568/6 "2020-09-09T18:19:22Z")

</div>

```
var client = new RestClient($"https://api.zoom.us/v2/users/{userId}/meetings");
        var request = new RestRequest(Method.POST);
        request.AddHeader("content-type", "application/json");
        request.AddHeader("authorization", string.Format("Bearer {0}", tokenString));

        var json = JsonConvert.SerializeObject(new CreateMeetingRequest
        {
            topic = "Test Meeting",
            agenda = "Test Meeting",
            duration = 20,
            password = "PAssword",
            type = (int)MeetingType.InstantMeeting,
            start_time = DateTime.UtcNow.ToString("O"),
            recurrence = new Reccurence
            {
                type = 1,
                repeat_interval = 1,
                monthly_day = 1,
                monthly_week = 1,
                monthly_week_day = 1,
                end_date_time = DateTime.UtcNow.ToString("o")
            },
            settings = new Settings
            {
                host_video = true,
                auto_recording = "local",
                waiting_room = true,

            }
        }, new JsonSerializerSettings
        {
            NullValueHandling = NullValueHandling.Ignore,
        });
        request.AddJsonBody(json);
        //request.AddParameter("application/json", json);
        IRestResponse response = client.Execute<CreateMeetingResponse>(request);
```

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [September 11, 2020, 9:18pm UTC](https://devforum.zoom.us/t/error-while-create-meeting-call-in-c/28568/7 "2020-09-11T21:18:12Z")

</div>

Thanks for sharing your solution @ahaq! 🙂

-Tommy

---

<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 12, 2020, 7:18am UTC](https://devforum.zoom.us/t/error-while-create-meeting-call-in-c/28568/8 "2020-10-12T07:18:20Z")

</div>

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