C# Example
The following example shows an API usage basis developed on C#.
- Proceed as follows to make use of and reproduce the example:
- Download the example file from here and extract it to a separate folder.
- Open the App.config file included in the example and adjust it as follows:
- Change the ServerContextGuid to the local server context GUID (it is equal to the installation GUID).
- Change AcrossIdentityServerUrl to the address of your Across Identity Server.
- Change CrossTankAPIUrl to the address of your crossTank API.
- Adjust CrossTankAPIClientId to the configured client ID from appsettings.json.
- Adjust UserName to the required user name.
- Adjust UserPassword to the required user password.
- Save the file.
- Adjust the appsettings.json file as follows (see also Authentication basics):
"Clients": [ { "ClientName": "CrossTank API Tests", "ClientId": "CrossTankAPI.Tests", "AlwaysIncludeUserClaimsInIdToken": "true", "AllowAccessTokensViaBrowser": "true", "AllowedScopes": [ "openid", "profile", "email", "rights", "crosstank.api.readonly", "crosstank.api.writeonly" ], "RemoveNonLicensedApiScopes": [ "crosstank.api.writeonly" ], "RequireClientSecret": "false", "AllowedGrantTypes": [ "password" ] } ],
- Open the ApiExample.sln file in Microsoft Visual Studio 2017 or later and compile it.