Evo Voice

<back to all web services

NewFlow

Create a new flow

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager, Customer
The following routes are available for this service:
POST/flows
"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;
}
/** @typedef {'UI'|'Reference'|'PhoneNumberRouting'|'UserDialOut'|'FaxNumberRouting'} */
export var FlowRoles;
(function (FlowRoles) {
    FlowRoles["UI"] = "UI"
    FlowRoles["Reference"] = "Reference"
    FlowRoles["PhoneNumberRouting"] = "PhoneNumberRouting"
    FlowRoles["UserDialOut"] = "UserDialOut"
    FlowRoles["FaxNumberRouting"] = "FaxNumberRouting"
})(FlowRoles || (FlowRoles = {}));
export class CustomerBreadcrumb {
    /** @param {{id?:string,name?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string} */
    name;
}
/** @typedef {'General'|'Voice'|'Logic'|'DateAndTime'|'Audio'|'Messaging'|'Assistant'|'Flows'|'Fax'|'Network'|'Cookies'|'CallCenter'|'Intelligence'} */
export var FlowNodeCategories;
(function (FlowNodeCategories) {
    FlowNodeCategories["General"] = "General"
    FlowNodeCategories["Voice"] = "Voice"
    FlowNodeCategories["Logic"] = "Logic"
    FlowNodeCategories["DateAndTime"] = "DateAndTime"
    FlowNodeCategories["Audio"] = "Audio"
    FlowNodeCategories["Messaging"] = "Messaging"
    FlowNodeCategories["Assistant"] = "Assistant"
    FlowNodeCategories["Flows"] = "Flows"
    FlowNodeCategories["Fax"] = "Fax"
    FlowNodeCategories["Network"] = "Network"
    FlowNodeCategories["Cookies"] = "Cookies"
    FlowNodeCategories["CallCenter"] = "CallCenter"
    FlowNodeCategories["Intelligence"] = "Intelligence"
})(FlowNodeCategories || (FlowNodeCategories = {}));
/** @typedef {'NotSpecified'|'String'|'Boolean'|'Number'|'List'|'Struct'|'Transition'|'Custom'|'Date'|'AudioFile'|'TimeZoneId'|'PhoneNumber'|'User'|'Endpoint'|'Time'|'File'|'FaxNumber'|'EmailAccount'|'Customer'|'Flow'|'Team'|'FlowReference'|'Integration'|'Assistant'} */
export var ValueTypes;
(function (ValueTypes) {
    ValueTypes["NotSpecified"] = "NotSpecified"
    ValueTypes["String"] = "String"
    ValueTypes["Boolean"] = "Boolean"
    ValueTypes["Number"] = "Number"
    ValueTypes["List"] = "List"
    ValueTypes["Struct"] = "Struct"
    ValueTypes["Transition"] = "Transition"
    ValueTypes["Custom"] = "Custom"
    ValueTypes["Date"] = "Date"
    ValueTypes["AudioFile"] = "AudioFile"
    ValueTypes["TimeZoneId"] = "TimeZoneId"
    ValueTypes["PhoneNumber"] = "PhoneNumber"
    ValueTypes["User"] = "User"
    ValueTypes["Endpoint"] = "Endpoint"
    ValueTypes["Time"] = "Time"
    ValueTypes["File"] = "File"
    ValueTypes["FaxNumber"] = "FaxNumber"
    ValueTypes["EmailAccount"] = "EmailAccount"
    ValueTypes["Customer"] = "Customer"
    ValueTypes["Flow"] = "Flow"
    ValueTypes["Team"] = "Team"
    ValueTypes["FlowReference"] = "FlowReference"
    ValueTypes["Integration"] = "Integration"
    ValueTypes["Assistant"] = "Assistant"
})(ValueTypes || (ValueTypes = {}));
/** @typedef {'None'|'LargeText'|'InlineForm'|'Password'|'InlineStruct'} */
export var UIHints;
(function (UIHints) {
    UIHints["None"] = "None"
    UIHints["LargeText"] = "LargeText"
    UIHints["InlineForm"] = "InlineForm"
    UIHints["Password"] = "Password"
    UIHints["InlineStruct"] = "InlineStruct"
})(UIHints || (UIHints = {}));
class Dictionary {}
export class Struct extends Dictionary {
    constructor(init) { super(init); Object.assign(this, init) }
}
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;
}
/** @typedef {'NotUnique'|'Unique'|'UniqueToCustomer'} */
export var DataFieldUniqueness;
(function (DataFieldUniqueness) {
    DataFieldUniqueness["NotUnique"] = "NotUnique"
    DataFieldUniqueness["Unique"] = "Unique"
    DataFieldUniqueness["UniqueToCustomer"] = "UniqueToCustomer"
})(DataFieldUniqueness || (DataFieldUniqueness = {}));
/** @typedef {'Hidden'|'ReadOnly'|'ReadWrite'} */
export var UserDataFieldModes;
(function (UserDataFieldModes) {
    UserDataFieldModes["Hidden"] = "Hidden"
    UserDataFieldModes["ReadOnly"] = "ReadOnly"
    UserDataFieldModes["ReadWrite"] = "ReadWrite"
})(UserDataFieldModes || (UserDataFieldModes = {}));
export class DataField {
    /** @param {{id?:string,name?:string,type?:ValueTypes,uiHint?:UIHints,uiTab?:string,isAsync?:boolean,disableBinding?:boolean,structType?:DataType,listType?:DataType,description?:string,possibleValues?:string[],isOutput?:boolean,customFieldValuesUrl?:string,defaultValue?:Value,transitionNameFormat?:string,uniqueness?:DataFieldUniqueness,voiceOnly?:boolean,conditionalVisibilityField?:string,conditionalVisibilityValue?:string,noEvalTemplate?:boolean,userMode?:UserDataFieldModes,anyValueType?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string} */
    name;
    /** @type {ValueTypes} */
    type;
    /** @type {UIHints} */
    uiHint;
    /** @type {string} */
    uiTab;
    /** @type {boolean} */
    isAsync;
    /** @type {boolean} */
    disableBinding;
    /** @type {DataType} */
    structType;
    /** @type {DataType} */
    listType;
    /** @type {string} */
    description;
    /** @type {string[]} */
    possibleValues;
    /** @type {boolean} */
    isOutput;
    /** @type {string} */
    customFieldValuesUrl;
    /** @type {Value} */
    defaultValue;
    /** @type {string} */
    transitionNameFormat;
    /** @type {DataFieldUniqueness} */
    uniqueness;
    /** @type {boolean} */
    voiceOnly;
    /** @type {string} */
    conditionalVisibilityField;
    /** @type {string} */
    conditionalVisibilityValue;
    /** @type {boolean} */
    noEvalTemplate;
    /** @type {UserDataFieldModes} */
    userMode;
    /** @type {boolean} */
    anyValueType;
}
export class DataType {
    /** @param {{typeName?:string,fields?:DataField[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    typeName;
    /** @type {DataField[]} */
    fields;
}
/** @typedef {'Voice'|'Chat'|'Fax'} */
export var FlowChannels;
(function (FlowChannels) {
    FlowChannels["Voice"] = "Voice"
    FlowChannels["Chat"] = "Chat"
    FlowChannels["Fax"] = "Fax"
})(FlowChannels || (FlowChannels = {}));
export class FlowNodeSpec {
    /** @param {{name?:string,description?:string,iconClass?:string,typeName?:string,category?:FlowNodeCategories,url?:string,dataType?:DataType,documentationUrl?:string,restrictToChannels?:FlowChannels[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description The name of this node */
    name;
    /**
     * @type {string}
     * @description A description of this node */
    description;
    /**
     * @type {string}
     * @description Icon class for this node (FontAwesome) */
    iconClass;
    /**
     * @type {string}
     * @description The type name for this node */
    typeName;
    /**
     * @type {FlowNodeCategories}
     * @description The category this node should be grouped under */
    category;
    /**
     * @type {string}
     * @description The URL where this node is located */
    url;
    /**
     * @type {DataType}
     * @description The data type for this node */
    dataType;
    /**
     * @type {string}
     * @description URL for documentation for this node */
    documentationUrl;
    /**
     * @type {FlowChannels[]}
     * @description The channels that this node is restricted to */
    restrictToChannels;
}
export class FlowNodeUI {
    /** @param {{x?:number,y?:number,notes?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {number}
     * @description The X position of the node */
    x;
    /**
     * @type {number}
     * @description The Y position of the node */
    y;
    /**
     * @type {string}
     * @description Notes for this node */
    notes;
}
/** @typedef {'Value'|'Flow'|'System'|'Customer'|'Session'|'Endpoint'|'Expression'|'User'} */
export var ValueSources;
(function (ValueSources) {
    ValueSources["Value"] = "Value"
    ValueSources["Flow"] = "Flow"
    ValueSources["System"] = "System"
    ValueSources["Customer"] = "Customer"
    ValueSources["Session"] = "Session"
    ValueSources["Endpoint"] = "Endpoint"
    ValueSources["Expression"] = "Expression"
    ValueSources["User"] = "User"
})(ValueSources || (ValueSources = {}));
export class NodeParameter {
    /** @param {{id?:string,type?:ValueTypes,source?:ValueSources,isAsync?:boolean,referenceId?:string,value?:Value,noEvalTemplate?:boolean,listParameters?:NodeParameterMap[],structParameters?:NodeParameterMap,isOutput?:boolean,expression?:string,listType?:DataType}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {ValueTypes} */
    type;
    /** @type {ValueSources} */
    source;
    /** @type {boolean} */
    isAsync;
    /** @type {string} */
    referenceId;
    /** @type {Value} */
    value;
    /** @type {boolean} */
    noEvalTemplate;
    /** @type {NodeParameterMap[]} */
    listParameters;
    /** @type {NodeParameterMap} */
    structParameters;
    /** @type {boolean} */
    isOutput;
    /** @type {string} */
    expression;
    /** @type {DataType} */
    listType;
}
export class NodeParameterMap extends Dictionary {
    constructor(init) { super(init); Object.assign(this, init) }
}
export class FlowNode {
    /** @param {{id?:string,isStartNode?:boolean,name?:string,spec?:FlowNodeSpec,ui?:FlowNodeUI,parameters?:NodeParameterMap}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description The ID of this node. Must be unique within the flow but can be anything */
    id;
    /**
     * @type {boolean}
     * @description Is this the starting node for the flow. Only one node can have this set */
    isStartNode;
    /**
     * @type {string}
     * @description The name of the node, descriptive to be used as a reminder in the GUI */
    name;
    /**
     * @type {FlowNodeSpec}
     * @description The specification for the node */
    spec;
    /**
     * @type {FlowNodeUI}
     * @description The UI data for the node */
    ui;
    /**
     * @type {NodeParameterMap}
     * @description The data for this node. These will be POST'd to the endpoint when it is called. */
    parameters;
}
export class FlowParameter extends DataField {
    /** @param {{isPublic?:boolean,isKnob?:boolean,id?:string,name?:string,type?:ValueTypes,uiHint?:UIHints,uiTab?:string,isAsync?:boolean,disableBinding?:boolean,structType?:DataType,listType?:DataType,description?:string,possibleValues?:string[],isOutput?:boolean,customFieldValuesUrl?:string,defaultValue?:Value,transitionNameFormat?:string,uniqueness?:DataFieldUniqueness,voiceOnly?:boolean,conditionalVisibilityField?:string,conditionalVisibilityValue?:string,noEvalTemplate?:boolean,userMode?:UserDataFieldModes,anyValueType?:boolean}} [init] */
    constructor(init) { super(init); Object.assign(this, init) }
    /** @type {boolean} */
    isPublic;
    /** @type {boolean} */
    isKnob;
}
export class FlowExit {
    /** @param {{id?:string,name?:string,ui?:FlowNodeUI}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description The unique ID for this exit */
    id;
    /**
     * @type {string}
     * @description The name of this exit */
    name;
    /**
     * @type {FlowNodeUI}
     * @description The UI for the exit */
    ui;
}
export class FlowUI {
    /** @param {{selectedNode?:string,canvasX?:number,canvasY?:number,canvasZoom?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    selectedNode;
    /** @type {number} */
    canvasX;
    /** @type {number} */
    canvasY;
    /** @type {number} */
    canvasZoom;
}
/** @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;
}
export class FlowInfo extends EntityInfo {
    /** @param {{name?:string,roles?:FlowRoles[],description?:string,notes?:string,accountId?:string,accountName?:string,customerId?:string,customerName?:string,customerBreadcrumb?:CustomerBreadcrumb[],nodes?:FlowNode[],parameters?:FlowParameter[],exits?:FlowExit[],ui?:FlowUI,tags?:Tag[],nodeCount?:number,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 flow */
    name;
    /**
     * @type {FlowRoles[]}
     * @description The roles that this flow has */
    roles;
    /**
     * @type {string}
     * @description What this flow does */
    description;
    /**
     * @type {string}
     * @description Any notes for this flow */
    notes;
    /**
     * @type {string}
     * @description The ID of the account associated with the flow */
    accountId;
    /**
     * @type {string}
     * @description The name of the account associated with the flow */
    accountName;
    /**
     * @type {string}
     * @description The ID of the customer this flow is associated with */
    customerId;
    /**
     * @type {string}
     * @description The name of the customer this flow is associated with */
    customerName;
    /**
     * @type {CustomerBreadcrumb[]}
     * @description The breadcrumb to the flow for this endpoint */
    customerBreadcrumb;
    /**
     * @type {FlowNode[]}
     * @description The nodes in this flow */
    nodes;
    /**
     * @type {FlowParameter[]}
     * @description The flow's parameters */
    parameters;
    /**
     * @type {FlowExit[]}
     * @description The flow's exits */
    exits;
    /**
     * @type {FlowUI}
     * @description The UI data for the flow */
    ui;
    /**
     * @type {Tag[]}
     * @description The list of tags for this flow */
    tags;
    /**
     * @type {number}
     * @description The number of nodes in this flow */
    nodeCount;
}
export class NewFlow {
    /** @param {{accountId?:string,customerId?:string,name?:string,roles?:FlowRoles[],nodes?:FlowNode[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description The account ID to associate with the flow */
    accountId;
    /**
     * @type {string}
     * @description The ID of the customer to associate with the flow */
    customerId;
    /**
     * @type {string}
     * @description The name of the flow */
    name;
    /**
     * @type {FlowRoles[]}
     * @description The roles that this flow has */
    roles;
    /**
     * @type {FlowNode[]}
     * @description The list of nodes for this flow */
    nodes;
}

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

{
	accountId: String,
	customerId: String,
	name: String,
	roles: 
	[
		UI
	],
	nodes: 
	[
		{
			id: String,
			isStartNode: False,
			name: String,
			spec: 
			{
				name: String,
				description: String,
				iconClass: String,
				typeName: String,
				category: General,
				url: String,
				documentationUrl: String,
				restrictToChannels: 
				[
					Voice
				]
			},
			ui: 
			{
				x: 0,
				y: 0,
				notes: String
			},
			parameters: {}
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	name: String,
	roles: 
	[
		UI
	],
	description: String,
	notes: String,
	accountId: String,
	accountName: String,
	customerId: String,
	customerName: String,
	customerBreadcrumb: 
	[
		{
			id: String,
			name: String
		}
	],
	nodes: 
	[
		{
			id: String,
			isStartNode: False,
			name: String,
			spec: 
			{
				name: String,
				description: String,
				iconClass: String,
				typeName: String,
				category: General,
				url: String,
				documentationUrl: String,
				restrictToChannels: 
				[
					Voice
				]
			},
			ui: 
			{
				x: 0,
				y: 0,
				notes: String
			},
			parameters: {}
		}
	],
	parameters: 
	[
		{
			isPublic: False,
			isKnob: False,
			id: String,
			name: String,
			type: NotSpecified,
			uiHint: None,
			uiTab: String,
			isAsync: False,
			disableBinding: False,
			description: String,
			possibleValues: 
			[
				String
			],
			isOutput: False,
			customFieldValuesUrl: String,
			defaultValue: 
			{
				boolValue: False,
				stringValue: String,
				numberValue: 0,
				listValue: 
				[
					null
				]
			},
			transitionNameFormat: String,
			uniqueness: NotUnique,
			voiceOnly: False,
			conditionalVisibilityField: String,
			conditionalVisibilityValue: String,
			noEvalTemplate: False,
			userMode: Hidden,
			anyValueType: False
		}
	],
	exits: 
	[
		{
			id: String,
			name: String,
			ui: 
			{
				x: 0,
				y: 0,
				notes: String
			}
		}
	],
	ui: 
	{
		selectedNode: String,
		canvasX: 0,
		canvasY: 0,
		canvasZoom: 0
	},
	tags: 
	[
		{
			id: String,
			name: String,
			color: Magenta
		}
	],
	nodeCount: 0,
	id: String,
	dateCreated: String,
	dateLastModified: String,
	createdBy: String,
	lastModifiedBy: String
}