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