Evo Voice

<back to all web services

ImportPackage

Import the specified package

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager, Customer
The following routes are available for this service:
POST/packages


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); }
}

export class CustomerDataField extends DataField
{
    public showInSearch: boolean;

    public constructor(init?: Partial<CustomerDataField>) { super(init); (Object as any).assign(this, init); }
}

export enum EndpointTypes
{
    PhoneNumber = 'PhoneNumber',
    User = 'User',
    FaxNumber = 'FaxNumber',
    EmailAddress = 'EmailAddress',
    Unused_1 = 'Unused_1',
    Unused_2 = 'Unused_2',
    Unused_3 = 'Unused_3',
    Unused_4 = 'Unused_4',
    Unused_5 = 'Unused_5',
    Team = 'Team',
    Assistant = 'Assistant',
}

export class EndpointDataField extends DataField
{
    public showInSearch: boolean;
    public showInLists: boolean;
    public endpointType?: EndpointTypes;
    public isCallerId: boolean;
    public isKnob: boolean;

    public constructor(init?: Partial<EndpointDataField>) { super(init); (Object as any).assign(this, init); }
}

export class SystemSettingsField extends DataField
{
    public value: Value;

    public constructor(init?: Partial<SystemSettingsField>) { super(init); (Object as any).assign(this, init); }
}

export class PackageInfo
{
    public flows: FlowInfo[];
    public customerFields: CustomerDataField[];
    public endpointFields: EndpointDataField[];
    public systemFields: SystemSettingsField[];

    public constructor(init?: Partial<PackageInfo>) { (Object as any).assign(this, init); }
}

/** @description Import the specified package */
// @Api(Description="Import the specified package")
export class ImportPackage
{
    /** @description The account you want to import the package into */
    // @ApiMember(Description="The account you want to import the package into")
    public accountId: string;

    /** @description The package you want to import (should be from a previous export) */
    // @ApiMember(Description="The package you want to import (should be from a previous export)")
    public package: PackageInfo;

    public constructor(init?: Partial<ImportPackage>) { (Object as any).assign(this, init); }
}

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

{
	accountId: String,
	package: 
	{
		flows: 
		[
			{
				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
			}
		],
		customerFields: 
		[
			{
				showInSearch: 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
			}
		],
		endpointFields: 
		[
			{
				showInSearch: False,
				showInLists: False,
				endpointType: PhoneNumber,
				isCallerId: 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
			}
		],
		systemFields: 
		[
			{
				value: 
				{
					boolValue: False,
					stringValue: String,
					numberValue: 0,
					listValue: 
					[
						null
					]
				},
				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
			}
		]
	}
}