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
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AIAccountUsage:
    # @ApiMember(Description="The account ID this customer belongs to")
    account_id: Optional[str] = None
    """
    The account ID this customer belongs to
    """


    # @ApiMember(Description="The total number of AI minutes used in the date range")
    ai_minutes: int = 0
    """
    The total number of AI minutes used in the date range
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AICustomerUsage:
    # @ApiMember(Description="The account ID this customer belongs to")
    account_id: Optional[str] = None
    """
    The account ID this customer belongs to
    """


    # @ApiMember(Description="The customer ID for this uage")
    customer_id: Optional[str] = None
    """
    The customer ID for this uage
    """


    # @ApiMember(Description="The total number of AI minutes used in the date range")
    ai_minutes: int = 0
    """
    The total number of AI minutes used in the date range
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class AIUsage:
    account_usage: Optional[List[AIAccountUsage]] = None
    customer_usage: Optional[List[AICustomerUsage]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetAIUsage(IGet):
    # @ApiMember(Description="Filter by account ID. If not specified will return entries for all customers in all accounts in the date range")
    account_id: Optional[str] = None
    """
    Filter by account ID. If not specified will return entries for all customers in all accounts in the date range
    """


    # @ApiMember(Description="Filter by customer ID. If not specified, will return all customers for the accounts considered")
    customer_id: Optional[str] = None
    """
    Filter by customer ID. If not specified, will return all customers for the accounts considered
    """


    # @ApiMember(Description="The start of the date range to consider")
    start_date: Optional[str] = None
    """
    The start of the date range to consider
    """


    # @ApiMember(Description="The end of the date range to consider")
    end_date: Optional[str] = None
    """
    The end of the date range to consider
    """

Python 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
		}
	]
}