Evo Voice

<back to all web services

ListFiles

Query for files

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager, Customer
The following routes are available for this service:
GET/files
import 'package:servicestack/servicestack.dart';

enum SortOrders
{
    Ascend,
    Descend,
}

abstract class ListRequest<T> implements IGet
{
    /**
    * The page of data to retrieve
    */
    // @ApiMember(Description="The page of data to retrieve")
    int? page;

    /**
    * If you want all objects to be returned. This should be used with care
    */
    // @ApiMember(Description="If you want all objects to be returned. This should be used with care")
    bool? all;

    /**
    * The number per page to retrieve
    */
    // @ApiMember(Description="The number per page to retrieve")
    int? countPerPage;

    /**
    * Specific IDs
    */
    // @ApiMember(Description="Specific IDs")
    List<String>? specificIds;

    /**
    * Specify a sort field
    */
    // @ApiMember(Description="Specify a sort field")
    String? sortField;

    /**
    * Specify a sort order
    */
    // @ApiMember(Description="Specify a sort order")
    SortOrders? sortOrder;

    /**
    * Disables total / page counts - improves performance. Returns only data. If there is no more data, Items will be empty array
    */
    // @ApiMember(Description="Disables total / page counts - improves performance. Returns only data. If there is no more data, Items will be empty array")
    bool? simplifiedPaging;

    ListRequest({this.page,this.all,this.countPerPage,this.specificIds,this.sortField,this.sortOrder,this.simplifiedPaging});
    ListRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        page = json['page'];
        all = json['all'];
        countPerPage = json['countPerPage'];
        specificIds = JsonConverters.fromJson(json['specificIds'],'List<String>',context!);
        sortField = json['sortField'];
        sortOrder = JsonConverters.fromJson(json['sortOrder'],'SortOrders',context!);
        simplifiedPaging = json['simplifiedPaging'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'page': page,
        'all': all,
        'countPerPage': countPerPage,
        'specificIds': JsonConverters.toJson(specificIds,'List<String>',context!),
        'sortField': sortField,
        'sortOrder': JsonConverters.toJson(sortOrder,'SortOrders',context!),
        'simplifiedPaging': simplifiedPaging
    };

    getTypeName() => "ListRequest<$T>";
    TypeContext? context = _ctx;
}

abstract class EntityInfo
{
    /**
    * The ID of the object
    */
    // @ApiMember(Description="The ID of the object")
    String? id;

    /**
    * The date the object was created
    */
    // @ApiMember(Description="The date the object was created")
    String? dateCreated;

    /**
    * The date the object was last modified
    */
    // @ApiMember(Description="The date the object was last modified")
    String? dateLastModified;

    /**
    * The user that created this object
    */
    // @ApiMember(Description="The user that created this object")
    String? createdBy;

    /**
    * The user that last modified this object
    */
    // @ApiMember(Description="The user that last modified this object")
    String? lastModifiedBy;

    EntityInfo({this.id,this.dateCreated,this.dateLastModified,this.createdBy,this.lastModifiedBy});
    EntityInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        dateCreated = json['dateCreated'];
        dateLastModified = json['dateLastModified'];
        createdBy = json['createdBy'];
        lastModifiedBy = json['lastModifiedBy'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'dateCreated': dateCreated,
        'dateLastModified': dateLastModified,
        'createdBy': createdBy,
        'lastModifiedBy': lastModifiedBy
    };

    getTypeName() => "EntityInfo";
    TypeContext? context = _ctx;
}

enum FileTypes
{
    Upload,
    VoiceMessage,
    CallRecording,
    Fax,
    Attachment,
    FaxOutgoing,
}

class CustomerBreadcrumb implements IConvertible
{
    String? id;
    String? name;

    CustomerBreadcrumb({this.id,this.name});
    CustomerBreadcrumb.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        name = json['name'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'name': name
    };

    getTypeName() => "CustomerBreadcrumb";
    TypeContext? context = _ctx;
}

class FileInfo extends EntityInfo implements IConvertible
{
    /**
    * The type of file this is
    */
    // @ApiMember(Description="The type of file this is")
    FileTypes? type;

    /**
    * The account ID this file is associated with
    */
    // @ApiMember(Description="The account ID this file is associated with")
    String? accountId;

    /**
    * The name of the account this file is associated with
    */
    // @ApiMember(Description="The name of the account this file is associated with")
    String? accountName;

    /**
    * The ID of the customer this file is associated with
    */
    // @ApiMember(Description="The ID of the customer this file is associated with")
    String? customerId;

    /**
    * The name of the customer this file is associated with
    */
    // @ApiMember(Description="The name of the customer this file is associated with")
    String? customerName;

    /**
    * The breadcrumb to the customer for this file
    */
    // @ApiMember(Description="The breadcrumb to the customer for this file")
    List<CustomerBreadcrumb>? customerBreadcrumb;

    /**
    * The ID of the user this file is assocaited with
    */
    // @ApiMember(Description="The ID of the user this file is assocaited with")
    String? userId;

    /**
    * The name of the user this file is associated with
    */
    // @ApiMember(Description="The name of the user this file is associated with")
    String? userName;

    /**
    * The original file name for the file
    */
    // @ApiMember(Description="The original file name for the file")
    String? fileName;

    /**
    * The URI of the file
    */
    // @ApiMember(Description="The URI of the file")
    String? uri;

    /**
    * The Content type of the file
    */
    // @ApiMember(Description="The Content type of the file")
    String? contentType;

    /**
    * The size of the file
    */
    // @ApiMember(Description="The size of the file")
    int? contentLength;

    /**
    * The Twilio ID of the recording
    */
    // @ApiMember(Description="The Twilio ID of the recording")
    String? recordingSid;

    /**
    * The duration of the recording in seconds
    */
    // @ApiMember(Description="The duration of the recording in seconds")
    int? recordingDuration;

    /**
    * Who is the recording from?
    */
    // @ApiMember(Description="Who is the recording from?")
    String? recordingFrom;

    /**
    * Transcription (if available)
    */
    // @ApiMember(Description="Transcription (if available)")
    String? transcription;

    /**
    * From Address (e.g. caller ID) for incoming calls
    */
    // @ApiMember(Description="From Address (e.g. caller ID) for incoming calls")
    String? fromAddress;

    /**
    * To Address (e.g. dialed number) for outgoing calls
    */
    // @ApiMember(Description="To Address (e.g. dialed number) for outgoing calls")
    String? toAddress;

    FileInfo({this.type,this.accountId,this.accountName,this.customerId,this.customerName,this.customerBreadcrumb,this.userId,this.userName,this.fileName,this.uri,this.contentType,this.contentLength,this.recordingSid,this.recordingDuration,this.recordingFrom,this.transcription,this.fromAddress,this.toAddress});
    FileInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        type = JsonConverters.fromJson(json['type'],'FileTypes',context!);
        accountId = json['accountId'];
        accountName = json['accountName'];
        customerId = json['customerId'];
        customerName = json['customerName'];
        customerBreadcrumb = JsonConverters.fromJson(json['customerBreadcrumb'],'List<CustomerBreadcrumb>',context!);
        userId = json['userId'];
        userName = json['userName'];
        fileName = json['fileName'];
        uri = json['uri'];
        contentType = json['contentType'];
        contentLength = json['contentLength'];
        recordingSid = json['recordingSid'];
        recordingDuration = json['recordingDuration'];
        recordingFrom = json['recordingFrom'];
        transcription = json['transcription'];
        fromAddress = json['fromAddress'];
        toAddress = json['toAddress'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'type': JsonConverters.toJson(type,'FileTypes',context!),
        'accountId': accountId,
        'accountName': accountName,
        'customerId': customerId,
        'customerName': customerName,
        'customerBreadcrumb': JsonConverters.toJson(customerBreadcrumb,'List<CustomerBreadcrumb>',context!),
        'userId': userId,
        'userName': userName,
        'fileName': fileName,
        'uri': uri,
        'contentType': contentType,
        'contentLength': contentLength,
        'recordingSid': recordingSid,
        'recordingDuration': recordingDuration,
        'recordingFrom': recordingFrom,
        'transcription': transcription,
        'fromAddress': fromAddress,
        'toAddress': toAddress
    });

    getTypeName() => "FileInfo";
    TypeContext? context = _ctx;
}

/**
* Query for files
*/
// @Api(Description="Query for files")
class ListFiles extends ListRequest<FileInfo> implements IConvertible
{
    /**
    * Filter by account id
    */
    // @ApiMember(Description="Filter by account id")
    List<String>? accountIds;

    /**
    * Filter by customer id
    */
    // @ApiMember(Description="Filter by customer id")
    List<String>? customerIds;

    /**
    * Filter by specific session
    */
    // @ApiMember(Description="Filter by specific session")
    String? sessionId;

    /**
    * Filter by file name (contains filter)
    */
    // @ApiMember(Description="Filter by file name (contains filter)")
    String? fileName;

    /**
    * Filter by content type (contains filter)
    */
    // @ApiMember(Description="Filter by content type (contains filter)")
    String? contentType;

    /**
    * Filter by type
    */
    // @ApiMember(Description="Filter by type")
    FileTypes? type;

    /**
    * Filter by date created (start of range)
    */
    // @ApiMember(Description="Filter by date created (start of range)")
    String? dateCreatedStart;

    /**
    * Filter by date created (end of range)
    */
    // @ApiMember(Description="Filter by date created (end of range)")
    String? dateCreatedEnd;

    /**
    * Filter by agent ID
    */
    // @ApiMember(Description="Filter by agent ID")
    String? userId;

    /**
    * Search transcription
    */
    // @ApiMember(Description="Search transcription")
    String? transcriptionContains;

    ListFiles({this.accountIds,this.customerIds,this.sessionId,this.fileName,this.contentType,this.type,this.dateCreatedStart,this.dateCreatedEnd,this.userId,this.transcriptionContains});
    ListFiles.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        accountIds = JsonConverters.fromJson(json['accountIds'],'List<String>',context!);
        customerIds = JsonConverters.fromJson(json['customerIds'],'List<String>',context!);
        sessionId = json['sessionId'];
        fileName = json['fileName'];
        contentType = json['contentType'];
        type = JsonConverters.fromJson(json['type'],'FileTypes',context!);
        dateCreatedStart = json['dateCreatedStart'];
        dateCreatedEnd = json['dateCreatedEnd'];
        userId = json['userId'];
        transcriptionContains = json['transcriptionContains'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'accountIds': JsonConverters.toJson(accountIds,'List<String>',context!),
        'customerIds': JsonConverters.toJson(customerIds,'List<String>',context!),
        'sessionId': sessionId,
        'fileName': fileName,
        'contentType': contentType,
        'type': JsonConverters.toJson(type,'FileTypes',context!),
        'dateCreatedStart': dateCreatedStart,
        'dateCreatedEnd': dateCreatedEnd,
        'userId': userId,
        'transcriptionContains': transcriptionContains
    });

    getTypeName() => "ListFiles";
    TypeContext? context = _ctx;
}

class BillingItem implements IConvertible
{
    double? baseCost;
    double? rawUnitMultiplier;
    double? unitCost;
    int? allowance;

    BillingItem({this.baseCost,this.rawUnitMultiplier,this.unitCost,this.allowance});
    BillingItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        baseCost = JsonConverters.toDouble(json['baseCost']);
        rawUnitMultiplier = JsonConverters.toDouble(json['rawUnitMultiplier']);
        unitCost = JsonConverters.toDouble(json['unitCost']);
        allowance = json['allowance'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'baseCost': baseCost,
        'rawUnitMultiplier': rawUnitMultiplier,
        'unitCost': unitCost,
        'allowance': allowance
    };

    getTypeName() => "BillingItem";
    TypeContext? context = _ctx;
}

class BillingSettings implements IConvertible
{
    BillingItem? base;
    BillingItem? localNumbers;
    BillingItem? tollFreeNumbers;
    BillingItem? inboundVoiceCalls;
    BillingItem? outboundVoiceCalls;
    BillingItem? inboundFaxes;
    BillingItem? outboundFaxes;
    BillingItem? inboundSmsMessages;
    BillingItem? outboundSmsMessages;

    BillingSettings({this.base,this.localNumbers,this.tollFreeNumbers,this.inboundVoiceCalls,this.outboundVoiceCalls,this.inboundFaxes,this.outboundFaxes,this.inboundSmsMessages,this.outboundSmsMessages});
    BillingSettings.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        base = JsonConverters.fromJson(json['base'],'BillingItem',context!);
        localNumbers = JsonConverters.fromJson(json['localNumbers'],'BillingItem',context!);
        tollFreeNumbers = JsonConverters.fromJson(json['tollFreeNumbers'],'BillingItem',context!);
        inboundVoiceCalls = JsonConverters.fromJson(json['inboundVoiceCalls'],'BillingItem',context!);
        outboundVoiceCalls = JsonConverters.fromJson(json['outboundVoiceCalls'],'BillingItem',context!);
        inboundFaxes = JsonConverters.fromJson(json['inboundFaxes'],'BillingItem',context!);
        outboundFaxes = JsonConverters.fromJson(json['outboundFaxes'],'BillingItem',context!);
        inboundSmsMessages = JsonConverters.fromJson(json['inboundSmsMessages'],'BillingItem',context!);
        outboundSmsMessages = JsonConverters.fromJson(json['outboundSmsMessages'],'BillingItem',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'base': JsonConverters.toJson(base,'BillingItem',context!),
        'localNumbers': JsonConverters.toJson(localNumbers,'BillingItem',context!),
        'tollFreeNumbers': JsonConverters.toJson(tollFreeNumbers,'BillingItem',context!),
        'inboundVoiceCalls': JsonConverters.toJson(inboundVoiceCalls,'BillingItem',context!),
        'outboundVoiceCalls': JsonConverters.toJson(outboundVoiceCalls,'BillingItem',context!),
        'inboundFaxes': JsonConverters.toJson(inboundFaxes,'BillingItem',context!),
        'outboundFaxes': JsonConverters.toJson(outboundFaxes,'BillingItem',context!),
        'inboundSmsMessages': JsonConverters.toJson(inboundSmsMessages,'BillingItem',context!),
        'outboundSmsMessages': JsonConverters.toJson(outboundSmsMessages,'BillingItem',context!)
    };

    getTypeName() => "BillingSettings";
    TypeContext? context = _ctx;
}

class AccountInfo extends EntityInfo implements IConvertible
{
    /**
    * The name of this account
    */
    // @ApiMember(Description="The name of this account")
    String? name;

    /**
    * The ID of this account's parent
    */
    // @ApiMember(Description="The ID of this account's parent")
    String? parentAccountId;

    /**
    * The twilio account SID
    */
    // @ApiMember(Description="The twilio account SID")
    String? twilioAccountSid;

    /**
    * The ancestors of this account. Useful for breadcrumbs
    */
    // @ApiMember(Description="The ancestors of this account. Useful for breadcrumbs")
    List<String>? ancestorIds;

    /**
    * The max number of phone numbers this account can have
    */
    // @ApiMember(Description="The max number of phone numbers this account can have")
    int? maxPhoneNumbers;

    /**
    * This account is BYOA
    */
    // @ApiMember(Description="This account is BYOA")
    bool? isBYOA;

    /**
    * TrustHub Profile Sid
    */
    // @ApiMember(Description="TrustHub Profile Sid")
    String? trustHubProfileSid;

    /**
    * The ID of the logo file
    */
    // @ApiMember(Description="The ID of the logo file")
    String? logoId;

    /**
    * The URI of the logo file
    */
    // @ApiMember(Description="The URI of the logo file")
    String? logoUri;

    /**
    * The billing settings for this account
    */
    // @ApiMember(Description="The billing settings for this account")
    BillingSettings? billingSettings;

    AccountInfo({this.name,this.parentAccountId,this.twilioAccountSid,this.ancestorIds,this.maxPhoneNumbers,this.isBYOA,this.trustHubProfileSid,this.logoId,this.logoUri,this.billingSettings});
    AccountInfo.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        name = json['name'];
        parentAccountId = json['parentAccountId'];
        twilioAccountSid = json['twilioAccountSid'];
        ancestorIds = JsonConverters.fromJson(json['ancestorIds'],'List<String>',context!);
        maxPhoneNumbers = json['maxPhoneNumbers'];
        isBYOA = json['isBYOA'];
        trustHubProfileSid = json['trustHubProfileSid'];
        logoId = json['logoId'];
        logoUri = json['logoUri'];
        billingSettings = JsonConverters.fromJson(json['billingSettings'],'BillingSettings',context!);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'name': name,
        'parentAccountId': parentAccountId,
        'twilioAccountSid': twilioAccountSid,
        'ancestorIds': JsonConverters.toJson(ancestorIds,'List<String>',context!),
        'maxPhoneNumbers': maxPhoneNumbers,
        'isBYOA': isBYOA,
        'trustHubProfileSid': trustHubProfileSid,
        'logoId': logoId,
        'logoUri': logoUri,
        'billingSettings': JsonConverters.toJson(billingSettings,'BillingSettings',context!)
    });

    getTypeName() => "AccountInfo";
    TypeContext? context = _ctx;
}

class ListResponse<AccountInfo> implements IConvertible
{
    /**
    * The items
    */
    // @ApiMember(Description="The items")
    List<AccountInfo>? items;

    /**
    * The total number of items
    */
    // @ApiMember(Description="The total number of items")
    int? totalCount;

    /**
    * The total number of pages
    */
    // @ApiMember(Description="The total number of pages")
    int? totalPages;

    /**
    * Are there more pages of items? Used with simplified paging
    */
    // @ApiMember(Description="Are there more pages of items? Used with simplified paging")
    bool? hasMorePages;

    ListResponse({this.items,this.totalCount,this.totalPages,this.hasMorePages});
    ListResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        items = JsonConverters.fromJson(json['items'],'List<${runtimeGenericTypeDefs(this,[0]).join(",")}>',context!);
        totalCount = json['totalCount'];
        totalPages = json['totalPages'];
        hasMorePages = json['hasMorePages'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'items': JsonConverters.toJson(items,'List<AccountInfo>',context!),
        'totalCount': totalCount,
        'totalPages': totalPages,
        'hasMorePages': hasMorePages
    };

    getTypeName() => "ListResponse<$AccountInfo>";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'evovoice.io', types: <String, TypeInfo> {
    'SortOrders': TypeInfo(TypeOf.Enum, enumValues:SortOrders.values),
    'ListRequest<T>': TypeInfo(TypeOf.AbstractClass),
    'EntityInfo': TypeInfo(TypeOf.AbstractClass),
    'FileTypes': TypeInfo(TypeOf.Enum, enumValues:FileTypes.values),
    'CustomerBreadcrumb': TypeInfo(TypeOf.Class, create:() => CustomerBreadcrumb()),
    'FileInfo': TypeInfo(TypeOf.Class, create:() => FileInfo()),
    'List<CustomerBreadcrumb>': TypeInfo(TypeOf.Class, create:() => <CustomerBreadcrumb>[]),
    'ListFiles': TypeInfo(TypeOf.Class, create:() => ListFiles()),
    'BillingItem': TypeInfo(TypeOf.Class, create:() => BillingItem()),
    'BillingSettings': TypeInfo(TypeOf.Class, create:() => BillingSettings()),
    'AccountInfo': TypeInfo(TypeOf.Class, create:() => AccountInfo()),
    'ListResponse<AccountInfo>': TypeInfo(TypeOf.Class, create:() => ListResponse<AccountInfo>()),
});

Dart ListFiles DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /files HTTP/1.1 
Host: evovoice.io 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ListResponseOfFileInfoS8MZGchS xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">
  <HasMorePages>false</HasMorePages>
  <Items xmlns:d2p1="http://schemas.datacontract.org/2004/07/Voice.Api.Files">
    <d2p1:FileInfo>
      <CreatedBy>String</CreatedBy>
      <DateCreated>String</DateCreated>
      <DateLastModified>String</DateLastModified>
      <Id>String</Id>
      <LastModifiedBy>String</LastModifiedBy>
      <d2p1:AccountId>String</d2p1:AccountId>
      <d2p1:AccountName>String</d2p1:AccountName>
      <d2p1:ContentLength>0</d2p1:ContentLength>
      <d2p1:ContentType>String</d2p1:ContentType>
      <d2p1:CustomerBreadcrumb xmlns:d4p1="http://schemas.datacontract.org/2004/07/Voice.Api.Customers">
        <d4p1:CustomerBreadcrumb>
          <d4p1:Id>String</d4p1:Id>
          <d4p1:Name>String</d4p1:Name>
        </d4p1:CustomerBreadcrumb>
      </d2p1:CustomerBreadcrumb>
      <d2p1:CustomerId>String</d2p1:CustomerId>
      <d2p1:CustomerName>String</d2p1:CustomerName>
      <d2p1:FileName>String</d2p1:FileName>
      <d2p1:FromAddress>String</d2p1:FromAddress>
      <d2p1:RecordingDuration>0</d2p1:RecordingDuration>
      <d2p1:RecordingFrom>String</d2p1:RecordingFrom>
      <d2p1:RecordingSid>String</d2p1:RecordingSid>
      <d2p1:ToAddress>String</d2p1:ToAddress>
      <d2p1:Transcription>String</d2p1:Transcription>
      <d2p1:Type>Upload</d2p1:Type>
      <d2p1:Uri>String</d2p1:Uri>
      <d2p1:UserId>String</d2p1:UserId>
      <d2p1:UserName>String</d2p1:UserName>
    </d2p1:FileInfo>
  </Items>
  <TotalCount>0</TotalCount>
  <TotalPages>0</TotalPages>
</ListResponseOfFileInfoS8MZGchS>