...
Deleting an API client certificate from this store will revoke access to the Connexion API.
Next, reference the C# client Connexion Core library (Connexion.GatewayCore.Api.dll, both framework and core assemblies are available) and create a proxy to the gateway. You will need the System.ServiceModel.Primitives and System.ServiceModel.Http packages if you’re targeting .NET coreConnexion.
Code Block | ||
---|---|---|
| ||
using System; using System.Security.Cryptography.X509Certificates; using Connexion.Core.WebApi; namespace CxnApiClient { class Program { static void 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 = 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(); } } } |
...
At this point, you can now make API calls. Please use the async/await pattern (the above code is a contrived example only).
View file | ||
---|---|---|
|