Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagec#
using System;
using System.Security.Cryptography.X509Certificates;
using Connexion.Core.WebApi;

namespace CxnApiClient
{
    class Program
    {
        static voidasync Task Main(string[] args)
        {
            // load the certificate to pass to the cxn api
            var certificate = new X509Certificate2(@"c:\cxnApi\apiCertificate.cer");

            // create a proxy to the api
            using (var proxy = ConnexionApiProxyFactory.CreateProxy("127.0.0.1", 8087, certificate))
            {
                // test the connection
                var result = await proxy.ServiceMethods.GetGroupsAndTabsAsync(new GetGroupsAndTabsRequest(true)).Result;
                foreach (var group in result.Groups)
                {
                    foreach (var tab in group.Tabs)
                    {
                        Console.WriteLine($"{group.Name} ({group.GroupKey}) / {tab.Name} ({tab.TabKey})");
                    }
                }
            }

            Console.ReadLine();
        }
    }
}

...