Use Mustangserver with C#/.net

Install node.js and use

npm install @openapitools/openapi-generator-cli -g

to install the Openapi Tech swagger generator. Then, create your .net project usung

openapi-generator-cli generate -i "swagger.json" -g csharp -o "csharpproject"

This will create a Library which uses RestSharp to access Mustang. Then use Microsoft Visual Studio Community or higher (not Visual Studio Code) to open Org.OpenAPITools.sln .

Get yourself an Api Key(see the according description in the PHP Tutorial).

Uncomment e.g. the ping test in src\Org.OpenAPITools.Test\Api\MustangControllerApiTests.cs

And change the constructor to

public MustangControllerApiTests()

{

Configuration c = new Configuration();

c.DefaultHeader.Add("apikey", "<your api key>");

instance = new MustangControllerApi(c);

}

Alternatively, to use oauth,

see „Allowing Client Credentials“, use

public MustangControllerApiTests()

{

Configuration c = new Configuration();

		c.OAuthFlow = OAuthFlow.APPLICATION;
       		c.OAuthTokenUrl = "https://api.usegroup.de:9443/oauth2/token";
               c.OAuthClientId = "<your client id>";
               c.OAuthClientSecret = "<your client secret>";

instance = new MustangControllerApi(c);

}

If you want to use an API Key. With CTRL+E, T you can see the test explorer and with CTRL+R, A you can run all tests, of which only pingTest will be enabled at that time.