| Required role: | SystemAdministrator |
| All Verbs | /ai/usage |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
public static class GetAIUsage implements 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")
public String accountId = 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")
public String customerId = null;
/**
* The start of the date range to consider
*/
@ApiMember(Description="The start of the date range to consider")
public String startDate = null;
/**
* The end of the date range to consider
*/
@ApiMember(Description="The end of the date range to consider")
public String endDate = null;
public String getAccountId() { return accountId; }
public GetAIUsage setAccountId(String value) { this.accountId = value; return this; }
public String getCustomerId() { return customerId; }
public GetAIUsage setCustomerId(String value) { this.customerId = value; return this; }
public String getStartDate() { return startDate; }
public GetAIUsage setStartDate(String value) { this.startDate = value; return this; }
public String getEndDate() { return endDate; }
public GetAIUsage setEndDate(String value) { this.endDate = value; return this; }
}
public static class AIUsage
{
public ArrayList<AIAccountUsage> accountUsage = null;
public ArrayList<AICustomerUsage> customerUsage = null;
public ArrayList<AIAccountUsage> getAccountUsage() { return accountUsage; }
public AIUsage setAccountUsage(ArrayList<AIAccountUsage> value) { this.accountUsage = value; return this; }
public ArrayList<AICustomerUsage> getCustomerUsage() { return customerUsage; }
public AIUsage setCustomerUsage(ArrayList<AICustomerUsage> value) { this.customerUsage = value; return this; }
}
public static class AIAccountUsage
{
/**
* The account ID this customer belongs to
*/
@ApiMember(Description="The account ID this customer belongs to")
public String accountId = 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")
public Integer aiMinutes = null;
public String getAccountId() { return accountId; }
public AIAccountUsage setAccountId(String value) { this.accountId = value; return this; }
public Integer getAiMinutes() { return aiMinutes; }
public AIAccountUsage setAiMinutes(Integer value) { this.aiMinutes = value; return this; }
}
public static class AICustomerUsage
{
/**
* The account ID this customer belongs to
*/
@ApiMember(Description="The account ID this customer belongs to")
public String accountId = null;
/**
* The customer ID for this uage
*/
@ApiMember(Description="The customer ID for this uage")
public String customerId = 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")
public Integer aiMinutes = null;
public String getAccountId() { return accountId; }
public AICustomerUsage setAccountId(String value) { this.accountId = value; return this; }
public String getCustomerId() { return customerId; }
public AICustomerUsage setCustomerId(String value) { this.customerId = value; return this; }
public Integer getAiMinutes() { return aiMinutes; }
public AICustomerUsage setAiMinutes(Integer value) { this.aiMinutes = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
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/csv
Content-Type: text/csv
Content-Length: length
{"accountId":"String","customerId":"String","startDate":"String","endDate":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"accountUsage":[{"accountId":"String","aiMinutes":0}],"customerUsage":[{"accountId":"String","customerId":"String","aiMinutes":0}]}