Evo Voice

<back to all web services

NewCustomer

Creates a new customer

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager, Customer
The following routes are available for this service:
POST/customers
"use strict";
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 NewCustomer {
    /** @param {{accountId?:string,name?:string,parentCustomerId?:string,referenceId?:string,data?:Struct}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description The account ID to associate this customer with */
    accountId;
    /**
     * @type {string}
     * @description The name of the customer */
    name;
    /**
     * @type {string}
     * @description The parent customer for this customer */
    parentCustomerId;
    /**
     * @type {string}
     * @description The reference ID for this customer (e.g. in a third party system) */
    referenceId;
    /**
     * @type {Struct}
     * @description Data values for this customer */
    data;
}

JavaScript NewCustomer 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 /customers HTTP/1.1 
Host: team.evovoice.io 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	accountId: String,
	name: String,
	parentCustomerId: String,
	referenceId: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	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
}