Evo Voice

<back to all web services

GetAIUsage

Requires Authentication
Required role:SystemAdministrator
The following routes are available for this service:
All Verbs/ai/usage
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Voice.Api.AI;

namespace Voice.Api.AI
{
    public partial class AIAccountUsage
    {
        ///<summary>
        ///The account ID this customer belongs to
        ///</summary>
        [ApiMember(Description="The account ID this customer belongs to")]
        public virtual string AccountId { get; set; }

        ///<summary>
        ///The total number of AI minutes used in the date range
        ///</summary>
        [ApiMember(Description="The total number of AI minutes used in the date range")]
        public virtual int AIMinutes { get; set; }
    }

    public partial class AICustomerUsage
    {
        ///<summary>
        ///The account ID this customer belongs to
        ///</summary>
        [ApiMember(Description="The account ID this customer belongs to")]
        public virtual string AccountId { get; set; }

        ///<summary>
        ///The customer ID for this uage
        ///</summary>
        [ApiMember(Description="The customer ID for this uage")]
        public virtual string CustomerId { get; set; }

        ///<summary>
        ///The total number of AI minutes used in the date range
        ///</summary>
        [ApiMember(Description="The total number of AI minutes used in the date range")]
        public virtual int AIMinutes { get; set; }
    }

    public partial class AIUsage
    {
        public virtual List<AIAccountUsage> AccountUsage { get; set; }
        public virtual List<AICustomerUsage> CustomerUsage { get; set; }
    }

    public partial class GetAIUsage
        : IGet
    {
        ///<summary>
        ///Filter by account ID. If not specified will return entries for all customers in all accounts in the date range
        ///</summary>
        [ApiMember(Description="Filter by account ID. If not specified will return entries for all customers in all accounts in the date range")]
        public virtual string AccountId { get; set; }

        ///<summary>
        ///Filter by customer ID. If not specified, will return all customers for the accounts considered
        ///</summary>
        [ApiMember(Description="Filter by customer ID. If not specified, will return all customers for the accounts considered")]
        public virtual string CustomerId { get; set; }

        ///<summary>
        ///The start of the date range to consider
        ///</summary>
        [ApiMember(Description="The start of the date range to consider")]
        public virtual string StartDate { get; set; }

        ///<summary>
        ///The end of the date range to consider
        ///</summary>
        [ApiMember(Description="The end of the date range to consider")]
        public virtual string EndDate { get; set; }
    }

}

C# GetAIUsage DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /ai/usage HTTP/1.1 
Host: team.evovoice.io 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	accountId: String,
	customerId: String,
	startDate: String,
	endDate: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	accountUsage: 
	[
		{
			accountId: String,
			aiMinutes: 0
		}
	],
	customerUsage: 
	[
		{
			accountId: String,
			customerId: String,
			aiMinutes: 0
		}
	]
}