Usage API

The Usage API is a free REST API that provides programmatic access and visibility into activity consumption across products for your account. It is the most important and best tool for helping to monitor and manage usage across the different APIs under your account.

Get usage

public static async Task<APIUsage> GetAsync()

This call retrieves the API usage for current month.

Arguments

None

Returns

This call returns an APIUsage object, and throws an APIException otherwise.

Example

using System;
using Objectia;
using Objectia.Api;
using Objectia.Exceptions;

class Program 
{
    static void Main(string[] args)
    {
        var apiKey = Environment.GetEnvironmentVariable("OBJECTIA_APIKEY");
        try 
        {
            ObjectiaClient.Init(apiKey);
            var usage = await Api.Usage.GetAsync(); 
            Console.WriteLine("Mail requests: " + usage.MailRequests);
        } catch (ResponseException e) {
            Console.WriteLine("Failed to get usage");
        }
    }
}