Program.cs
/// <summary>
/// Some sort of work using our API that requires the use of a license token.
/// </summary>
/// <param name="token"></param>
/// <returns></returns>
Some sort of work using our API that requires the use of a license token.
Some sort of work using our API that requires the use of a license token .
private static async Task SomeInteractionWithOurApi(ApiConfig config, string token)
        {
             Just make your calls to our API with your valid license, which you can optionally release from being
             active when done if you won't be using it again for an extended period. If you will be continuing to use
             the token signiicantly it is recommended you leave it active to reduce total SQL Server load.
             For our example we are just going to get a list of the databases with our user.
             For more documentaion on available API endpoints, check https:square-9.com/api for a guide on REST API Resources.
            var databases = await Databases.GetAllAsync(config, token);
            Console.WriteLine("=== Databases ===");
            databases.ForEach(db => Console.WriteLine($"{db.Id}: {db.Name}"));
            Console.WriteLine("=================");
            Console.WriteLine($"Work was completed with token: {token}. Exiting.");
        }
private static async Task SomeInteractionWithOurApi ( ApiConfig config , string token ) { var databases = await Databases . GetAllAsync ( config , token ) ; Console . WriteLine ( " " ) ; databases . ForEach ( db => Console . WriteLine ( $" { db . Id } :  { db . Name } " ) ) ; Console . WriteLine ( " " ) ; Console . WriteLine ( $" Work was completed with token:  { token } . Exiting. " ) ; }
Some sort of work using our API that requires the use of a license token.
Some sort of work using our API that requires the use of a license token .
// As long as your license token is valid and a seat is available, it will be accepted and reactivated by the token. // You do not need to create a license for each run, this flow significantly speeds up performance by // reducing interaction with the API. // // Just make your calls to our API with your valid license, which you can optionally release from being // active when done if you won't be using it again for an extended period. If you will be continuing to use // the token signiicantly it is recommended you leave it active to reduce total SQL Server load. // For our example we are just going to get a list of the databases with our user. // For more documentaion on available API endpoints, check https://square-9.com/api for a guide on REST API Resources.
None
config
ApiConfig
token
string
None