| Required role: | SystemAdministrator |
| All Verbs | /ai/usage |
|---|
namespace Voice.Api.AI
open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations
[<AllowNullLiteral>]
type AIAccountUsage() =
///<summary>
///The account ID this customer belongs to
///</summary>
[<ApiMember(Description="The account ID this customer belongs to")>]
member val AccountId:String = null with 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")>]
member val AIMinutes:Int32 = new Int32() with get,set
[<AllowNullLiteral>]
type AICustomerUsage() =
///<summary>
///The account ID this customer belongs to
///</summary>
[<ApiMember(Description="The account ID this customer belongs to")>]
member val AccountId:String = null with get,set
///<summary>
///The customer ID for this uage
///</summary>
[<ApiMember(Description="The customer ID for this uage")>]
member val CustomerId:String = null with 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")>]
member val AIMinutes:Int32 = new Int32() with get,set
[<AllowNullLiteral>]
type AIUsage() =
member val AccountUsage:ResizeArray<AIAccountUsage> = null with get,set
member val CustomerUsage:ResizeArray<AICustomerUsage> = null with get,set
[<AllowNullLiteral>]
type GetAIUsage() =
interface 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")>]
member val AccountId:String = null with 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")>]
member val CustomerId:String = null with get,set
///<summary>
///The start of the date range to consider
///</summary>
[<ApiMember(Description="The start of the date range to consider")>]
member val StartDate:String = null with get,set
///<summary>
///The end of the date range to consider
///</summary>
[<ApiMember(Description="The end of the date range to consider")>]
member val EndDate:String = null with get,set
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=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
}
]
}