Requires any of the roles: | SystemAdministrator, Manager, Customer |
POST | /flows/{flowId}/copy |
---|
"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 CopyFlow {
/** @param {{flowId?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description The ID of the flow to copy */
flowId;
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /flows/{flowId}/copy HTTP/1.1
Host: team.evovoice.io
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CopyFlow xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows">
<FlowId>String</FlowId>
</CopyFlow>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <FlowInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows"> <CreatedBy xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</CreatedBy> <DateCreated xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</DateCreated> <DateLastModified xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</DateLastModified> <Id xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</Id> <LastModifiedBy xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</LastModifiedBy> <AccountId>String</AccountId> <AccountName>String</AccountName> <CustomerBreadcrumb xmlns:d2p1="http://schemas.datacontract.org/2004/07/Voice.Api.Customers"> <d2p1:CustomerBreadcrumb> <d2p1:Id>String</d2p1:Id> <d2p1:Name>String</d2p1:Name> </d2p1:CustomerBreadcrumb> </CustomerBreadcrumb> <CustomerId>String</CustomerId> <CustomerName>String</CustomerName> <Description>String</Description> <Exits> <FlowExit> <Id>String</Id> <Name>String</Name> <UI> <Notes>String</Notes> <X>0</X> <Y>0</Y> </UI> </FlowExit> </Exits> <Name>String</Name> <NodeCount>0</NodeCount> <Nodes> <FlowNode> <Id>String</Id> <IsStartNode>false</IsStartNode> <Name>String</Name> <Parameters xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d4p1:KeyValueOfstringNodeParameteripFhVFNS> <d4p1:Key>String</d4p1:Key> <d4p1:Value i:nil="true" /> </d4p1:KeyValueOfstringNodeParameteripFhVFNS> </Parameters> <Spec> <Category>General</Category> <DataType xmlns:d5p1="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data" i:nil="true" /> <Description>String</Description> <DocumentationUrl>String</DocumentationUrl> <IconClass>String</IconClass> <Name>String</Name> <RestrictToChannels> <FlowChannels>Voice</FlowChannels> </RestrictToChannels> <TypeName>String</TypeName> <Url>String</Url> </Spec> <UI> <Notes>String</Notes> <X>0</X> <Y>0</Y> </UI> </FlowNode> </Nodes> <Notes>String</Notes> <Parameters> <FlowParameter> <AnyValueType xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">false</AnyValueType> <ConditionalVisibilityField xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</ConditionalVisibilityField> <ConditionalVisibilityValue xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</ConditionalVisibilityValue> <CustomFieldValuesUrl xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</CustomFieldValuesUrl> <DefaultValue xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data"> <BoolValue>false</BoolValue> <ListValue xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"> <d5p1:ArrayOfKeyValueOfstringValue8Ahp2kgT i:nil="true" /> </ListValue> <NumberValue>0</NumberValue> <StringValue>String</StringValue> <StructValue xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" /> </DefaultValue> <Description xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</Description> <DisableBinding xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">false</DisableBinding> <Id xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</Id> <IsAsync xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">false</IsAsync> <IsOutput xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">false</IsOutput> <ListType i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data" /> <Name xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</Name> <NoEvalTemplate xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">false</NoEvalTemplate> <PossibleValues xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data"> <d4p1:string>String</d4p1:string> </PossibleValues> <StructType i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data" /> <TransitionNameFormat xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</TransitionNameFormat> <Type xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">NotSpecified</Type> <UIHint xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">None</UIHint> <UITab xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">String</UITab> <Uniqueness xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">NotUnique</Uniqueness> <UserMode xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">Hidden</UserMode> <VoiceOnly xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">false</VoiceOnly> <IsKnob>false</IsKnob> <IsPublic>false</IsPublic> </FlowParameter> </Parameters> <Roles> <FlowRoles>UI</FlowRoles> </Roles> <Tags xmlns:d2p1="http://schemas.datacontract.org/2004/07/Voice.Api.Settings"> <d2p1:Tag> <d2p1:Color>Magenta</d2p1:Color> <d2p1:Id>String</d2p1:Id> <d2p1:Name>String</d2p1:Name> </d2p1:Tag> </Tags> <UI> <CanvasX>0</CanvasX> <CanvasY>0</CanvasY> <CanvasZoom>0</CanvasZoom> <SelectedNode>String</SelectedNode> </UI> </FlowInfo>