Click or drag to resize

UsageClient Class

Get usage details for SelectPdf Online API.
Inheritance Hierarchy

Namespace:  SelectPdf.Api
Assembly:  SelectPdf.Api (in SelectPdf.Api.dll) Version: 1.4.0
Syntax
public class UsageClient : ApiClient

The UsageClient type exposes the following members.

Constructors
  NameDescription
Public methodUsageClient
Construct the Usage client.
Top
Methods
  NameDescription
Public methodgetUsage
Get API usage information.
Public methodgetUsage(Boolean)
Get API usage information with history if specified.
Top
Examples
Get usage details for SelectPdf online REST API:
using System;
using SelectPdf.Api;

namespace SelectPdf.Api.Tests
{
    class Program
    {
        static void Main(string[] args)
        {
            string apiKey = "Your API key here";

            Console.WriteLine("This is SelectPdf-{0}.", ApiClient.CLIENT_VERSION);

            try
            {
                // get API usage
                UsageClient usageClient = new UsageClient(apiKey);
                UsageInformation usage = usageClient.getUsage(false);
                Console.WriteLine("Conversions remained this month: {0}.", usage.Available);
            }
            catch (Exception ex)
            {
                Console.WriteLine("An error occurred: " + ex.Message);
            }
        }
    }
}
See Also