| Required role: | SystemAdministrator |
| All Verbs | /ai/usage |
|---|
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Voice.Api.AI
Namespace Global
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 Overridable Property AccountId As String
'''<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 Overridable Property AIMinutes As Integer
End Class
Public Partial Class AICustomerUsage
'''<Summary>
'''The account ID this customer belongs to
'''</Summary>
<ApiMember(Description:="The account ID this customer belongs to")>
Public Overridable Property AccountId As String
'''<Summary>
'''The customer ID for this uage
'''</Summary>
<ApiMember(Description:="The customer ID for this uage")>
Public Overridable Property CustomerId As String
'''<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 Overridable Property AIMinutes As Integer
End Class
Public Partial Class AIUsage
Public Overridable Property AccountUsage As List(Of AIAccountUsage)
Public Overridable Property CustomerUsage As List(Of AICustomerUsage)
End Class
Public Partial Class GetAIUsage
Implements 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 Overridable Property AccountId As String
'''<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 Overridable Property CustomerId As String
'''<Summary>
'''The start of the date range to consider
'''</Summary>
<ApiMember(Description:="The start of the date range to consider")>
Public Overridable Property StartDate As String
'''<Summary>
'''The end of the date range to consider
'''</Summary>
<ApiMember(Description:="The end of the date range to consider")>
Public Overridable Property EndDate As String
End Class
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
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: application/xml
Content-Type: application/xml
Content-Length: length
<GetAIUsage xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.AI">
<AccountId>String</AccountId>
<CustomerId>String</CustomerId>
<EndDate>String</EndDate>
<StartDate>String</StartDate>
</GetAIUsage>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<AIUsage xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.AI">
<AccountUsage>
<AIAccountUsage>
<AIMinutes>0</AIMinutes>
<AccountId>String</AccountId>
</AIAccountUsage>
</AccountUsage>
<CustomerUsage>
<AICustomerUsage>
<AIMinutes>0</AIMinutes>
<AccountId>String</AccountId>
<CustomerId>String</CustomerId>
</AICustomerUsage>
</CustomerUsage>
</AIUsage>