Simple application to create meetings (.NET)

I have a WinForms application on .NET and I would need to integrate a simple tool to create user meetings and get the code, just that. What would be the best and easiest way to do it?

I’ve read all the documentation but it’s not very clear to me.

Thank you very much in advance.

Hey @mribera, thanks for posting and using Zoom!

First you’d want to create a JWT App type, which allows you to generate a JWT Token to call the Create Meeting API. Sample code is also provided at the bottom of each endpoint page:

Let me know if that helps!

Thanks,
Tommy

I was able to create a meeting but I have a doubt: I had to create an App in the Marketplace and the meeting is created in my user. In order to make this possible for each of our clients to create their own meetings, each one of them will have to create an App?

Thanks!

Hey @mribera,

If you are looking to share this integration outside your Zoom account, then you can simply use an OAuth app instead and the OAuth install flow so your clients can install your integration.

Does that make sense?

Thanks,
Tommy

Hi,

It’s the same thing, isn’t it? Each client would have to create an OAuth App to get their Client ID and Client Secret.

Thanks!

Hey @mribera,

No, each client would be able to share your OAuth app by simply installing it :slight_smile:

Just like how you can install any of these apps with a button press: http://marketplace.zoom.us/

Please see the OAuth flow here: https://marketplace.zoom.us/docs/guides/auth/oauth

Thanks,
Tommy

Got it! Thanks.

I saw that there is a possibility to create a meeting and force the video to start, but is there any possibility to force the audio to start automatically?

Thanks!

Hey @mribera,

You can also adjust the audio settings in the settings object of the Create Meeting request body.

Thanks,
Tommy

The only audio option in the settings is to enable the audio system, and the default is “both”, so that’s not it.

Please, can you tell me some way to force the audio input to be always active? especially for mobile devices.

Thanks.

Hey @mribera,

Only users can set their default audio settings, otherwise, that would be a privacy issue.

Thanks,
Tommy

Hi Tommy,

I am calling api from c# .net core.

I am using same code as above , i got respones:200 OK , but unable to see the meetings where it is created.
Please help me .

Hey @indreshkumar1988,

I have replied to you here:

Thanks,
Tommy

Hey @tommy,

Is it possible in c# that create meeting should ask for zoom username and password to continue for creating a new meeting and we don’t need to create the app and don’t need to pass the API Key and API Secret. Just like the way it is happening in Android SDK It will just ask user to fill the username and password and meeting will gets created.

Please let me know if this can be achieved in c# also.

Hey @dharminder,

If you are not using the SDKs, then you will need to use OAuth, which will prompt the user for their login, and return you an access token that you can use to call the Zoom API on their behalf.

Thanks,
Tommy

Hello, im now developer

Do you have an example of C# code to create a meeting in http client request .Net? im actually triying to create one but without any good results.

Hey @jcochrane,

Checkout my post here explaining how to see the sample code for any endpoint on our docs :slight_smile:

Thanks,
Tommy

1 Like

Hey, @tommy I’m also trying to write a c# console application that will run and create meetings but it’s not working properly.
As the meeting is created doesn’t show my Topic and instead just Zoom Meeting, Also I’m unable to set the alternate host as It does also not appear in that meeting created and also the time of the meeting is not created correctly.
here is my code:

Meeting request class:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace Zoom.Sync.Api
{
public class Recurrence
{
[JsonPropertyName(“type”)]
public string Type;

    [JsonPropertyName("repeat_interval")]
    public string RepeatInterval;

    [JsonPropertyName("weekly_days")]
    public string WeeklyDays;

    [JsonPropertyName("monthly_day")]
    public string MonthlyDay;

    [JsonPropertyName("monthly_week")]
    public string MonthlyWeek;

    [JsonPropertyName("monthly_week_day")]
    public string MonthlyWeekDay;

    [JsonPropertyName("end_times")]
    public string EndTimes;

    [JsonPropertyName("end_date_time")]
    public string EndDateTime;
}

public class Settings
{
    [JsonPropertyName("host_video")]
    public string HostVideo;

    [JsonPropertyName("participant_video")]
    public string ParticipantVideo;

    [JsonPropertyName("cn_meeting")]
    public string CnMeeting;

    [JsonPropertyName("in_meeting")]
    public string InMeeting;

    [JsonPropertyName("join_before_host")]
    public string JoinBeforeHost;

    [JsonPropertyName("mute_upon_entry")]
    public string MuteUponEntry;

    [JsonPropertyName("watermark")]
    public string Watermark;

    [JsonPropertyName("use_pmi")]
    public string UsePmi;

    [JsonPropertyName("approval_type")]
    public string ApprovalType;

    [JsonPropertyName("registration_type")]
    public string RegistrationType;

    [JsonPropertyName("audio")]
    public string Audio;

    [JsonPropertyName("auto_recording")]
    public string AutoRecording;

    [JsonPropertyName("enforce_login")]
    public string EnforceLogin;

    [JsonPropertyName("enforce_login_domains")]
    public string EnforceLoginDomains;

    [JsonPropertyName("alternative_hosts")]
    public string AlternativeHosts;

    [JsonPropertyName("global_dial_in_countries")]
    public List<string> GlobalDialInCountries;

    [JsonPropertyName("registrants_email_notification")]
    public string RegistrantsEmailNotification;
}

public class Meeting
{
    [JsonPropertyName("topic")]
    public string Topic;

    [JsonPropertyName("type")]
    public string Type;

    [JsonPropertyName("start_time")]
    public string StartTime;

    [JsonPropertyName("duration")]
    public string Duration;

    [JsonPropertyName("schedule_for")]
    public string ScheduleFor;

    [JsonPropertyName("timezone")]
    public string Timezone;

    [JsonPropertyName("password")]
    public string Password;

    [JsonPropertyName("agenda")]
    public string Agenda;

    [JsonPropertyName("recurrence")]
    public Recurrence Recurrence;

    [JsonPropertyName("settings")]

  public Settings Settings;
}

}

Meeting Response class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace Zoom.Sync.Api.Models
{

public class ApprovedOrDeniedCountriesOrRegions
{
    public bool enable { get; set; }
    public string method { get; set; }
    public List<object> approved_list { get; set; }
    public List<object> denied_list { get; set; }
}

public class Settings
{
    public bool host_video { get; set; }
    public bool participant_video { get; set; }
    public bool cn_meeting { get; set; }
    public bool in_meeting { get; set; }
    public bool join_before_host { get; set; }
    public bool mute_upon_entry { get; set; }
    public bool watermark { get; set; }
    public bool use_pmi { get; set; }
    public int approval_type { get; set; }
    public int registration_type { get; set; }
    public string audio { get; set; }
    public string auto_recording { get; set; }
    public bool enforce_login { get; set; }
    public string enforce_login_domains { get; set; }
    public string alternative_hosts { get; set; }
    public bool close_registration { get; set; }
    public bool waiting_room { get; set; }
    public List<object> global_dial_in_countries { get; set; }
    public List<object> global_dial_in_numbers { get; set; }
    public string contact_name { get; set; }
    public string contact_email { get; set; }
    public bool registrants_confirmation_email { get; set; }
    public bool registrants_email_notification { get; set; }
    public bool meeting_authentication { get; set; }
    public string authentication_option { get; set; }
    public string authentication_domains { get; set; }
    public string authentication_name { get; set; }
    public List<object> interpreters { get; set; }
    public bool show_share_button { get; set; }
    public bool allow_multiple_devices { get; set; }
    public string encryption_type { get; set; }
    public ApprovedOrDeniedCountriesOrRegions approved_or_denied_countries_or_regions { get; set; }
}

public class Recurrence
{
    public int type { get; set; }
    public int repeat_interval { get; set; }
    public string weekly_days { get; set; }
    public int monthly_day { get; set; }
    public int monthly_week { get; set; }
    public int monthly_week_day { get; set; }
    public int end_times { get; set; }
    public string end_date_time { get; set; }
}

public class Meeting
{
    public long id { get; set; }
    public string assistant_id { get; set; }
    public string host_email { get; set; }
    public string registration_url { get; set; }
    public string topic { get; set; }
    public int type { get; set; }
    public string start_time { get; set; }
    public int duration { get; set; }
    public string timezone { get; set; }
    public string created_at { get; set; }
    public string agenda { get; set; }
    public string start_url { get; set; }
    public string join_url { get; set; }
    public string password { get; set; }
    public string h323_password { get; set; }
    public int pmi { get; set; }
    public List<object> tracking_fields { get; set; }
    public List<object> occurrences { get; set; }
    public Settings settings { get; set; }
    public Recurrence recurrence { get; set; }
}

}

and the Program class

using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json;
using RestSharp;
using System;
using System.Collections.Generic;
using System.Text;

namespace Zoom.Sync.Api
{
class Program
{
static void Main(string args)
{
var tokenHandler = new System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler();
var now = DateTime.UtcNow;
var apiSecret = “API SECRET”;
byte symmetricKey = Encoding.ASCII.GetBytes(apiSecret);

        var tokenDescriptor = new SecurityTokenDescriptor
        {
            Issuer = "API Key",
            Expires = now.AddSeconds(60),
            SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(symmetricKey), SecurityAlgorithms.HmacSha256),
        };
        var token = tokenHandler.CreateToken(tokenDescriptor);

        var tokenString = tokenHandler.WriteToken(token);           
        Meeting iMeeting = new Meeting();
        
        iMeeting.Topic = $"Test Zoom Meeting Created By Sync App {Environment.MachineName}";
        iMeeting.Type = "2";
        //iMeeting.Timezone = "Asia/Jerusalem";
        iMeeting.StartTime = DateTime.Now.AddHours(8).ToString("yyyy-MM-ddTHH:mm:ss");
        iMeeting.Duration = "60";
        Settings iMeetingSettings = new Settings();

        iMeetingSettings.AlternativeHosts = "meeting-alternate-hostmail@mydomain.com";
        iMeetingSettings.HostVideo = "true";
        iMeetingSettings.JoinBeforeHost = "fasle";
        iMeetingSettings.MuteUponEntry = "true";
        iMeetingSettings.Audio = "both";
        iMeetingSettings.AutoRecording = "cloud";
        iMeetingSettings.GlobalDialInCountries = new List<string>() { "IL", "US" };
        iMeeting.Settings = idcMeetingSettings;
        var client = new RestClient("https://api.zoom.us/v2/users/meetinghostmail@mydomain.com/meetings");
        var request = new RestRequest(Method.POST);
        request.AddHeader("content-type", "application/json");
        request.AddHeader("authorization", String.Format("Bearer {0}", tokenString));
        request.AddJsonBody(iMeeting);
        IRestResponse response = client.Execute(request);
        if(response.StatusCode == System.Net.HttpStatusCode.Created)
        {
            Console.WriteLine(response.Content);
            Zoom.Sync.Api.Models.Meeting createdMeeting = JsonConvert.DeserializeObject<Zoom.Sync.Api.Models.Meeting>(response.Content);
            Console.WriteLine($"ID: {createdMeeting.id} --> Join Url: {createdMeeting.join_url}");
        }
        Console.ReadLine();
    }
}

}

What am I missing?

My meeting time should be at Jerusalem Time Zone, and my user’s emails exist under our organization account.

Looking forward to your reply,
Thanks,
Hagai.

Hi @hagaih,

Can you check your account settings to see if the “Use PMI” setting is enabled?

If it is, it could be overriding your requests. Let me know—thanks!

Best,
Will

@will.zoom, as far as I see it is not enabled

Hey @hagaih,

It looks like these are your user level settings. Can you confirm that it’s not enabled/locked on your account-wide settings? You may need to confirm this with your account owner or admin.

Thanks,
Will