Evo Voice

<back to all web services

ListCustomers

Retrieve customers

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager, Customer
The following routes are available for this service:
GET/customers
"use strict";
/** @typedef {'Ascend'|'Descend'} */
export var SortOrders;
(function (SortOrders) {
    SortOrders["Ascend"] = "Ascend"
    SortOrders["Descend"] = "Descend"
})(SortOrders || (SortOrders = {}));
/** @typedef T {any} */
export class ListRequest {
    /** @param {{page?:number,all?:boolean,countPerPage?:number,specificIds?:string[],sortField?:string,sortOrder?:SortOrders,simplifiedPaging?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description The page of data to retrieve */
    page;
    /**
     * @type {boolean}
     * @description If you want all objects to be returned. This should be used with care */
    all;
    /**
     * @type {number}
     * @description The number per page to retrieve */
    countPerPage;
    /**
     * @type {string[]}
     * @description Specific IDs */
    specificIds;
    /**
     * @type {string}
     * @description Specify a sort field */
    sortField;
    /**
     * @type {SortOrders}
     * @description Specify a sort order */
    sortOrder;
    /**
     * @type {boolean}
     * @description Disables total / page counts - improves performance. Returns only data. If there is no more data, Items will be empty array */
    simplifiedPaging;
}
export class EntityInfo {
    /** @param {{id?:string,dateCreated?:string,dateLastModified?:string,createdBy?:string,lastModifiedBy?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description The ID of the object */
    id;
    /**
     * @type {string}
     * @description The date the object was created */
    dateCreated;
    /**
     * @type {string}
     * @description The date the object was last modified */
    dateLastModified;
    /**
     * @type {string}
     * @description The user that created this object */
    createdBy;
    /**
     * @type {string}
     * @description The user that last modified this object */
    lastModifiedBy;
}
export class CustomerBreadcrumb {
    /** @param {{id?:string,name?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string} */
    name;
}
export class Value {
    /** @param {{boolValue?:boolean,stringValue?:string,numberValue?:number,listValue?:Struct[],structValue?:Struct}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {?boolean} */
    boolValue;
    /** @type {string} */
    stringValue;
    /** @type {?number} */
    numberValue;
    /** @type {Struct[]} */
    listValue;
    /** @type {Struct} */
    structValue;
}
class Dictionary {}
export class Struct extends Dictionary {
    constructor(init) { super(init); Object.assign(this, init) }
}
/** @typedef {'Magenta'|'Red'|'Volcano'|'Orange'|'Gold'|'Lime'|'Green'|'Cyan'|'Blue'|'GeekBlue'|'Purple'} */
export var TagColors;
(function (TagColors) {
    TagColors["Magenta"] = "Magenta"
    TagColors["Red"] = "Red"
    TagColors["Volcano"] = "Volcano"
    TagColors["Orange"] = "Orange"
    TagColors["Gold"] = "Gold"
    TagColors["Lime"] = "Lime"
    TagColors["Green"] = "Green"
    TagColors["Cyan"] = "Cyan"
    TagColors["Blue"] = "Blue"
    TagColors["GeekBlue"] = "GeekBlue"
    TagColors["Purple"] = "Purple"
})(TagColors || (TagColors = {}));
export class Tag {
    /** @param {{id?:string,name?:string,color?:TagColors}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string} */
    name;
    /** @type {TagColors} */
    color;
}
/** @typedef {'Always'|'CustomerState'|'Time'} */
export var SimpleSchedulingRuleTypes;
(function (SimpleSchedulingRuleTypes) {
    SimpleSchedulingRuleTypes["Always"] = "Always"
    SimpleSchedulingRuleTypes["CustomerState"] = "CustomerState"
    SimpleSchedulingRuleTypes["Time"] = "Time"
})(SimpleSchedulingRuleTypes || (SimpleSchedulingRuleTypes = {}));
export class ScheduleDay {
    /** @param {{offset?:number,dayOfWeek?:DayOfWeek}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    offset;
    /** @type {DayOfWeek} */
    dayOfWeek;
}
/** @typedef {'None'|'Secondly'|'Minutely'|'Hourly'|'Daily'|'Weekly'|'Monthly'|'Yearly'} */
export var SchedulingRuleFrequency;
(function (SchedulingRuleFrequency) {
    SchedulingRuleFrequency["None"] = "None"
    SchedulingRuleFrequency["Secondly"] = "Secondly"
    SchedulingRuleFrequency["Minutely"] = "Minutely"
    SchedulingRuleFrequency["Hourly"] = "Hourly"
    SchedulingRuleFrequency["Daily"] = "Daily"
    SchedulingRuleFrequency["Weekly"] = "Weekly"
    SchedulingRuleFrequency["Monthly"] = "Monthly"
    SchedulingRuleFrequency["Yearly"] = "Yearly"
})(SchedulingRuleFrequency || (SchedulingRuleFrequency = {}));
export class SchedulingRule {
    /** @param {{id?:string,name?:string,priority?:number,state?:string,source?:string,condition?:string,simpleRuleType?:SimpleSchedulingRuleTypes,customerState?:string,flowId?:string,flowParams?:Struct,isAllDay?:boolean,startDate?:string,startTime?:string,endTime?:string,bySetPosition?:number[],byMonth?:number[],byWeekNo?:number[],byYearDay?:number[],byMonthDay?:number[],byDay?:ScheduleDay[],byHour?:number[],byMinute?:number[],interval?:number,count?:number,untilDate?:string,frequency?:SchedulingRuleFrequency}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string} */
    name;
    /** @type {number} */
    priority;
    /** @type {string} */
    state;
    /** @type {string} */
    source;
    /** @type {string} */
    condition;
    /** @type {SimpleSchedulingRuleTypes} */
    simpleRuleType;
    /** @type {string} */
    customerState;
    /** @type {string} */
    flowId;
    /** @type {Struct} */
    flowParams;
    /** @type {boolean} */
    isAllDay;
    /** @type {string} */
    startDate;
    /** @type {string} */
    startTime;
    /** @type {string} */
    endTime;
    /** @type {number[]} */
    bySetPosition;
    /** @type {number[]} */
    byMonth;
    /** @type {number[]} */
    byWeekNo;
    /** @type {number[]} */
    byYearDay;
    /** @type {number[]} */
    byMonthDay;
    /** @type {ScheduleDay[]} */
    byDay;
    /** @type {number[]} */
    byHour;
    /** @type {number[]} */
    byMinute;
    /** @type {number} */
    interval;
    /** @type {number} */
    count;
    /** @type {string} */
    untilDate;
    /** @type {SchedulingRuleFrequency} */
    frequency;
}
export class Schedule {
    /** @param {{timeZoneId?:string,inherit?:boolean,forceClosed?:boolean,rules?:SchedulingRule[],defaultState?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    timeZoneId;
    /** @type {boolean} */
    inherit;
    /** @type {boolean} */
    forceClosed;
    /** @type {SchedulingRule[]} */
    rules;
    /** @type {string} */
    defaultState;
}
export class IntegrationData {
    /** @param {{thirdPartyId?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    thirdPartyId;
}
export class EntityIntegrationData extends Dictionary {
    constructor(init) { super(init); Object.assign(this, init) }
}
export class BillingItem {
    /** @param {{baseCost?:number,rawUnitMultiplier?:number,unitCost?:number,allowance?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    baseCost;
    /** @type {number} */
    rawUnitMultiplier;
    /** @type {number} */
    unitCost;
    /** @type {number} */
    allowance;
}
export class BillingSettings {
    /** @param {{base?:BillingItem,localNumbers?:BillingItem,tollFreeNumbers?:BillingItem,inboundVoiceCalls?:BillingItem,outboundVoiceCalls?:BillingItem,inboundFaxes?:BillingItem,outboundFaxes?:BillingItem,inboundSmsMessages?:BillingItem,outboundSmsMessages?:BillingItem,aiInsights?:BillingItem,aiLiveMinutes?:BillingItem}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {BillingItem} */
    base;
    /** @type {BillingItem} */
    localNumbers;
    /** @type {BillingItem} */
    tollFreeNumbers;
    /** @type {BillingItem} */
    inboundVoiceCalls;
    /** @type {BillingItem} */
    outboundVoiceCalls;
    /** @type {BillingItem} */
    inboundFaxes;
    /** @type {BillingItem} */
    outboundFaxes;
    /** @type {BillingItem} */
    inboundSmsMessages;
    /** @type {BillingItem} */
    outboundSmsMessages;
    /** @type {BillingItem} */
    aiInsights;
    /** @type {BillingItem} */
    aiLiveMinutes;
}
export class AppSettings {
    /** @param {{enablePhoneNumberManagement?:boolean,enableDeviceManagement?:boolean,enableDialer?:boolean,enableCallHistory?:boolean,enableAssistants?:boolean,showFileNameInMessageCenter?:boolean,chakraTheme?:string,customCss?:string,pageTitle?:string,stringMappings?:string,logoutUrl?:string,portMyNumberUrl?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {boolean} */
    enablePhoneNumberManagement;
    /** @type {boolean} */
    enableDeviceManagement;
    /** @type {boolean} */
    enableDialer;
    /** @type {boolean} */
    enableCallHistory;
    /** @type {boolean} */
    enableAssistants;
    /** @type {boolean} */
    showFileNameInMessageCenter;
    /** @type {string} */
    chakraTheme;
    /** @type {string} */
    customCss;
    /** @type {string} */
    pageTitle;
    /** @type {string} */
    stringMappings;
    /** @type {string} */
    logoutUrl;
    /** @type {string} */
    portMyNumberUrl;
}
export class CustomerInfo extends EntityInfo {
    /** @param {{accountId?:string,parentCustomerId?:string,breadcrumb?:CustomerBreadcrumb[],accountName?:string,isStaging?:boolean,name?:string,referenceId?:string,data?:Struct,tags?:Tag[],schedule?:Schedule,integrationData?:EntityIntegrationData,overrideBillingSettings?:boolean,billingSettings?:BillingSettings,overrideAppSettings?:boolean,appSettings?:AppSettings,id?:string,dateCreated?:string,dateLastModified?:string,createdBy?:string,lastModifiedBy?:string}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
    /**
     * @type {string}
     * @description The ID of the account associated with this customer */
    accountId;
    /**
     * @type {string}
     * @description The parent customer ID for this customer */
    parentCustomerId;
    /**
     * @type {CustomerBreadcrumb[]}
     * @description The breadcrumb to this customer */
    breadcrumb;
    /**
     * @type {string}
     * @description The name of the account associated with this customer */
    accountName;
    /**
     * @type {boolean}
     * @description Is this customer staging or production? */
    isStaging;
    /**
     * @type {string}
     * @description The name of the company */
    name;
    /**
     * @type {string}
     * @description The reference ID for this company */
    referenceId;
    /**
     * @type {Struct}
     * @description This customer's data values */
    data;
    /**
     * @type {Tag[]}
     * @description The list of tags for this customer */
    tags;
    /**
     * @type {Schedule}
     * @description This customer's schedule */
    schedule;
    /**
     * @type {EntityIntegrationData}
     * @description Integration data for this customer */
    integrationData;
    /**
     * @type {boolean}
     * @description Override this customer's billing settings? Otherwise inherits from parent */
    overrideBillingSettings;
    /**
     * @type {BillingSettings}
     * @description Billing settings for this customer */
    billingSettings;
    /**
     * @type {boolean}
     * @description Should this customer override the parent customer's app settings */
    overrideAppSettings;
    /**
     * @type {AppSettings}
     * @description App / Portal settings for this customer */
    appSettings;
}
export class ListCustomers extends ListRequest {
    /** @param {{accountIds?:string[],nameFilter?:string,parentCustomerIds?:string[],shallowParent?:boolean,tagIds?:string[],page?:number,all?:boolean,countPerPage?:number,specificIds?:string[],sortField?:string,sortOrder?:SortOrders,simplifiedPaging?:boolean}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
    /**
     * @type {string[]}
     * @description Filter by accounts */
    accountIds;
    /**
     * @type {string}
     * @description Filter by name */
    nameFilter;
    /**
     * @type {string[]}
     * @description The IDs of the parent customers you want to filter by */
    parentCustomerIds;
    /**
     * @type {boolean}
     * @description If you want a shall parent customer filter (e.g. no deep children) */
    shallowParent;
    /**
     * @type {string[]}
     * @description The list of tag IDs to filter by (must contain all) */
    tagIds;
}
export class AccountInfo extends EntityInfo {
    /** @param {{name?:string,parentAccountId?:string,twilioAccountSid?:string,ancestorIds?:string[],maxPhoneNumbers?:number,isBYOA?:boolean,trustHubProfileSid?:string,logoId?:string,logoUri?:string,billingSettings?:BillingSettings,id?:string,dateCreated?:string,dateLastModified?:string,createdBy?:string,lastModifiedBy?:string}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
    /**
     * @type {string}
     * @description The name of this account */
    name;
    /**
     * @type {string}
     * @description The ID of this account's parent */
    parentAccountId;
    /**
     * @type {string}
     * @description The twilio account SID */
    twilioAccountSid;
    /**
     * @type {string[]}
     * @description The ancestors of this account. Useful for breadcrumbs */
    ancestorIds;
    /**
     * @type {number}
     * @description The max number of phone numbers this account can have */
    maxPhoneNumbers;
    /**
     * @type {boolean}
     * @description This account is BYOA */
    isBYOA;
    /**
     * @type {string}
     * @description TrustHub Profile Sid */
    trustHubProfileSid;
    /**
     * @type {string}
     * @description The ID of the logo file */
    logoId;
    /**
     * @type {string}
     * @description The URI of the logo file */
    logoUri;
    /**
     * @type {BillingSettings}
     * @description The billing settings for this account */
    billingSettings;
}
/** @typedef T {any} */
export class ListResponse {
    /** @param {{items?:AccountInfo[],totalCount?:number,totalPages?:number,hasMorePages?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {AccountInfo[]}
     * @description The items */
    items;
    /**
     * @type {number}
     * @description The total number of items */
    totalCount;
    /**
     * @type {number}
     * @description The total number of pages */
    totalPages;
    /**
     * @type {boolean}
     * @description Are there more pages of items? Used with simplified paging */
    hasMorePages;
}

JavaScript ListCustomers DTOs

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

HTTP + CSV

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

GET /customers HTTP/1.1 
Host: team.evovoice.io 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"items":[{"accountId":"String","parentCustomerId":"String","breadcrumb":[{"id":"String","name":"String"}],"accountName":"String","isStaging":false,"name":"String","referenceId":"String","tags":[{"id":"String","name":"String","color":"Magenta"}],"schedule":{"timeZoneId":"String","inherit":false,"forceClosed":false,"rules":[{"id":"String","name":"String","priority":0,"state":"String","source":"String","condition":"String","simpleRuleType":"Always","customerState":"String","flowId":"String","isAllDay":false,"startDate":"String","startTime":"String","endTime":"String","bySetPosition":[0],"byMonth":[0],"byWeekNo":[0],"byYearDay":[0],"byMonthDay":[0],"byDay":[{"offset":0,"dayOfWeek":"Sunday"}],"byHour":[0],"byMinute":[0],"interval":0,"count":0,"untilDate":"String","frequency":"None"}],"defaultState":"String"},"integrationData":{"String":{"thirdPartyId":"String"}},"overrideBillingSettings":false,"billingSettings":{"base":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"localNumbers":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"tollFreeNumbers":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"inboundVoiceCalls":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"outboundVoiceCalls":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"inboundFaxes":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"outboundFaxes":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"inboundSmsMessages":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"outboundSmsMessages":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"aiInsights":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0},"aiLiveMinutes":{"baseCost":0,"rawUnitMultiplier":0,"unitCost":0,"allowance":0}},"overrideAppSettings":false,"appSettings":{"enablePhoneNumberManagement":false,"enableDeviceManagement":false,"enableDialer":false,"enableCallHistory":false,"enableAssistants":false,"showFileNameInMessageCenter":false,"chakraTheme":"String","customCss":"String","pageTitle":"String","stringMappings":"String","logoutUrl":"String","portMyNumberUrl":"String"},"id":"String","dateCreated":"String","dateLastModified":"String","createdBy":"String","lastModifiedBy":"String"}],"totalCount":0,"totalPages":0,"hasMorePages":false}