Simple application to create meetings (.NET)

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

can you please tell me what exactly to look for? wich settings?

thanks in advance,
Hagai.

will.zoom
December 1

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

Hey @hagaih,

You can check your account-level settings by navigating to https://zoom.us/account/setting. If you don’t have access to this page then you’ll need to check with your admin.

Thanks,
Max

Hi @MaxM and @Will,

I was unable to access the https://zoom.us/account/settings, I’m getting “Access restricted. (200)”

I’m able to access https://zoom.us/profile/setting what the different between them?

As for profile settings, I do see that the USE PMI settings are turn off as you can see below.

What settings / permissions I need to ask for, from our organization admin?

Thanks,

Hagai

Hey @hagaih,

Thanks for sharing this. I just took some time to investigate your account further, and I can confirm that this setting doesn’t appear to be the issue.

I’ve just DM’d you to offer some 1:1 support so that we can help get to the bottom of this for you.

Thanks,
Will

hey @tommy.test, i want to integrate zoom meeting to my school website in which i have teachers and students(both have separate logins). The teachers should be able to add a meeting and accordingly that should be reflected to the student dashboard and join the meeting as per the meeting time. I have done all the stuff. But my question is, what is the best way that each teacher should be able to create their own meeting and schedule it on recurring based.
Please help that will be highly appreciated
Thanks

Hey @sheikh.shuaib666,

Thank you for reaching out to the Zoom Developer Forum. When it comes to scheduling meetings you have a couple of options. You can build a custom form and use the details of that to call the Create Meeting API, or, your can direct users to the Schedule Meeting form in their Zoom portal.

I hope that helps! Let me know if you have any questions.

Thanks,
Max