| Required role: | SystemAdministrator |
| All Verbs | /ai/usage |
|---|
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*
open class GetAIUsage : IGet
{
/**
* Filter by account ID. If not specified will return entries for all customers in all accounts in the date range
*/
@ApiMember(Description="Filter by account ID. If not specified will return entries for all customers in all accounts in the date range")
open var accountId:String? = null
/**
* Filter by customer ID. If not specified, will return all customers for the accounts considered
*/
@ApiMember(Description="Filter by customer ID. If not specified, will return all customers for the accounts considered")
open var customerId:String? = null
/**
* The start of the date range to consider
*/
@ApiMember(Description="The start of the date range to consider")
open var startDate:String? = null
/**
* The end of the date range to consider
*/
@ApiMember(Description="The end of the date range to consider")
open var endDate:String? = null
}
open class AIUsage
{
open var accountUsage:ArrayList<AIAccountUsage>? = null
open var customerUsage:ArrayList<AICustomerUsage>? = null
}
open class AIAccountUsage
{
/**
* The account ID this customer belongs to
*/
@ApiMember(Description="The account ID this customer belongs to")
open var accountId:String? = null
/**
* The total number of AI minutes used in the date range
*/
@ApiMember(Description="The total number of AI minutes used in the date range")
open var aiMinutes:Int? = null
}
open class AICustomerUsage
{
/**
* The account ID this customer belongs to
*/
@ApiMember(Description="The account ID this customer belongs to")
open var accountId:String? = null
/**
* The customer ID for this uage
*/
@ApiMember(Description="The customer ID for this uage")
open var customerId:String? = null
/**
* The total number of AI minutes used in the date range
*/
@ApiMember(Description="The total number of AI minutes used in the date range")
open var aiMinutes:Int? = null
}
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
}
]
}