Evo Voice

<back to all web services

GetFlow

Get the specified flow

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager, Customer
The following routes are available for this service:
GET/flows/{flowId}
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class EntityInfo:
    # @ApiMember(Description="The ID of the object")
    id: Optional[str] = None
    """
    The ID of the object
    """


    # @ApiMember(Description="The date the object was created")
    date_created: Optional[str] = None
    """
    The date the object was created
    """


    # @ApiMember(Description="The date the object was last modified")
    date_last_modified: Optional[str] = None
    """
    The date the object was last modified
    """


    # @ApiMember(Description="The user that created this object")
    created_by: Optional[str] = None
    """
    The user that created this object
    """


    # @ApiMember(Description="The user that last modified this object")
    last_modified_by: Optional[str] = None
    """
    The user that last modified this object
    """


class FlowRoles(str, Enum):
    UI = 'UI'
    REFERENCE = 'Reference'
    PHONE_NUMBER_ROUTING = 'PhoneNumberRouting'
    USER_DIAL_OUT = 'UserDialOut'
    FAX_NUMBER_ROUTING = 'FaxNumberRouting'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CustomerBreadcrumb:
    id: Optional[str] = None
    name: Optional[str] = None


class FlowNodeCategories(str, Enum):
    GENERAL = 'General'
    VOICE = 'Voice'
    LOGIC = 'Logic'
    DATE_AND_TIME = 'DateAndTime'
    AUDIO = 'Audio'
    MESSAGING = 'Messaging'
    ASSISTANT = 'Assistant'
    FLOWS = 'Flows'
    FAX = 'Fax'
    NETWORK = 'Network'
    COOKIES = 'Cookies'
    CALL_CENTER = 'CallCenter'
    INTELLIGENCE = 'Intelligence'


class ValueTypes(str, Enum):
    NOT_SPECIFIED = 'NotSpecified'
    STRING = 'String'
    BOOLEAN = 'Boolean'
    NUMBER = 'Number'
    LIST = 'List'
    STRUCT = 'Struct'
    TRANSITION = 'Transition'
    CUSTOM = 'Custom'
    DATE = 'Date'
    AUDIO_FILE = 'AudioFile'
    TIME_ZONE_ID = 'TimeZoneId'
    PHONE_NUMBER = 'PhoneNumber'
    USER = 'User'
    ENDPOINT = 'Endpoint'
    TIME = 'Time'
    FILE = 'File'
    FAX_NUMBER = 'FaxNumber'
    EMAIL_ACCOUNT = 'EmailAccount'
    CUSTOMER = 'Customer'
    FLOW = 'Flow'
    TEAM = 'Team'
    FLOW_REFERENCE = 'FlowReference'
    INTEGRATION = 'Integration'
    ASSISTANT = 'Assistant'


class UIHints(str, Enum):
    NONE = 'None'
    LARGE_TEXT = 'LargeText'
    INLINE_FORM = 'InlineForm'
    PASSWORD = 'Password'
    INLINE_STRUCT = 'InlineStruct'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Struct(Dict[str,Value]):
    pass


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Value:
    bool_value: Optional[bool] = None
    string_value: Optional[str] = None
    number_value: Optional[float] = None
    list_value: Optional[List[Struct]] = None
    struct_value: Optional[Struct] = None


class DataFieldUniqueness(str, Enum):
    NOT_UNIQUE = 'NotUnique'
    UNIQUE = 'Unique'
    UNIQUE_TO_CUSTOMER = 'UniqueToCustomer'


class UserDataFieldModes(str, Enum):
    HIDDEN = 'Hidden'
    READ_ONLY = 'ReadOnly'
    READ_WRITE = 'ReadWrite'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DataField:
    id: Optional[str] = None
    name: Optional[str] = None
    type: Optional[ValueTypes] = None
    ui_hint: Optional[UIHints] = None
    ui_tab: Optional[str] = None
    is_async: bool = False
    disable_binding: bool = False
    struct_type: Optional[DataType] = None
    list_type: Optional[DataType] = None
    description: Optional[str] = None
    possible_values: Optional[List[str]] = None
    is_output: bool = False
    custom_field_values_url: Optional[str] = None
    default_value: Optional[Value] = None
    transition_name_format: Optional[str] = None
    uniqueness: Optional[DataFieldUniqueness] = None
    voice_only: bool = False
    conditional_visibility_field: Optional[str] = None
    conditional_visibility_value: Optional[str] = None
    no_eval_template: bool = False
    user_mode: Optional[UserDataFieldModes] = None
    any_value_type: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DataType:
    type_name: Optional[str] = None
    fields: Optional[List[DataField]] = None


class FlowChannels(str, Enum):
    VOICE = 'Voice'
    CHAT = 'Chat'
    FAX = 'Fax'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FlowNodeSpec:
    # @ApiMember(Description="The name of this node")
    name: Optional[str] = None
    """
    The name of this node
    """


    # @ApiMember(Description="A description of this node")
    description: Optional[str] = None
    """
    A description of this node
    """


    # @ApiMember(Description="Icon class for this node (FontAwesome)")
    icon_class: Optional[str] = None
    """
    Icon class for this node (FontAwesome)
    """


    # @ApiMember(Description="The type name for this node")
    type_name: Optional[str] = None
    """
    The type name for this node
    """


    # @ApiMember(Description="The category this node should be grouped under")
    category: Optional[FlowNodeCategories] = None
    """
    The category this node should be grouped under
    """


    # @ApiMember(Description="The URL where this node is located")
    url: Optional[str] = None
    """
    The URL where this node is located
    """


    # @ApiMember(Description="The data type for this node")
    data_type: Optional[DataType] = None
    """
    The data type for this node
    """


    # @ApiMember(Description="URL for documentation for this node")
    documentation_url: Optional[str] = None
    """
    URL for documentation for this node
    """


    # @ApiMember(Description="The channels that this node is restricted to")
    restrict_to_channels: Optional[List[FlowChannels]] = None
    """
    The channels that this node is restricted to
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FlowNodeUI:
    # @ApiMember(Description="The X position of the node")
    x: float = 0.0
    """
    The X position of the node
    """


    # @ApiMember(Description="The Y position of the node")
    y: float = 0.0
    """
    The Y position of the node
    """


    # @ApiMember(Description="Notes for this node")
    notes: Optional[str] = None
    """
    Notes for this node
    """


class ValueSources(str, Enum):
    VALUE = 'Value'
    FLOW = 'Flow'
    SYSTEM = 'System'
    CUSTOMER = 'Customer'
    SESSION = 'Session'
    ENDPOINT = 'Endpoint'
    EXPRESSION = 'Expression'
    USER = 'User'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class NodeParameter:
    id: Optional[str] = None
    type: Optional[ValueTypes] = None
    source: Optional[ValueSources] = None
    is_async: bool = False
    reference_id: Optional[str] = None
    value: Optional[Value] = None
    no_eval_template: bool = False
    list_parameters: Optional[List[NodeParameterMap]] = None
    struct_parameters: Optional[NodeParameterMap] = None
    is_output: bool = False
    expression: Optional[str] = None
    list_type: Optional[DataType] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class NodeParameterMap(Dict[str,NodeParameter]):
    pass


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FlowNode:
    # @ApiMember(Description="The ID of this node. Must be unique within the flow but can be anything")
    id: Optional[str] = None
    """
    The ID of this node. Must be unique within the flow but can be anything
    """


    # @ApiMember(Description="Is this the starting node for the flow. Only one node can have this set")
    is_start_node: bool = False
    """
    Is this the starting node for the flow. Only one node can have this set
    """


    # @ApiMember(Description="The name of the node, descriptive to be used as a reminder in the GUI")
    name: Optional[str] = None
    """
    The name of the node, descriptive to be used as a reminder in the GUI
    """


    # @ApiMember(Description="The specification for the node")
    spec: Optional[FlowNodeSpec] = None
    """
    The specification for the node
    """


    # @ApiMember(Description="The UI data for the node")
    ui: Optional[FlowNodeUI] = None
    """
    The UI data for the node
    """


    # @ApiMember(Description="The data for this node. These will be POST'd to the endpoint when it is called.")
    parameters: Optional[NodeParameterMap] = None
    """
    The data for this node. These will be POST'd to the endpoint when it is called.
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FlowParameter(DataField):
    is_public: bool = False
    is_knob: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FlowExit:
    # @ApiMember(Description="The unique ID for this exit")
    id: Optional[str] = None
    """
    The unique ID for this exit
    """


    # @ApiMember(Description="The name of this exit")
    name: Optional[str] = None
    """
    The name of this exit
    """


    # @ApiMember(Description="The UI for the exit")
    ui: Optional[FlowNodeUI] = None
    """
    The UI for the exit
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FlowUI:
    selected_node: Optional[str] = None
    canvas_x: float = 0.0
    canvas_y: float = 0.0
    canvas_zoom: float = 0.0


class TagColors(str, Enum):
    MAGENTA = 'Magenta'
    RED = 'Red'
    VOLCANO = 'Volcano'
    ORANGE = 'Orange'
    GOLD = 'Gold'
    LIME = 'Lime'
    GREEN = 'Green'
    CYAN = 'Cyan'
    BLUE = 'Blue'
    GEEK_BLUE = 'GeekBlue'
    PURPLE = 'Purple'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Tag:
    id: Optional[str] = None
    name: Optional[str] = None
    color: Optional[TagColors] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FlowInfo(EntityInfo):
    # @ApiMember(Description="The name of this flow")
    name: Optional[str] = None
    """
    The name of this flow
    """


    # @ApiMember(Description="The roles that this flow has")
    roles: Optional[List[FlowRoles]] = None
    """
    The roles that this flow has
    """


    # @ApiMember(Description="What this flow does")
    description: Optional[str] = None
    """
    What this flow does
    """


    # @ApiMember(Description="Any notes for this flow")
    notes: Optional[str] = None
    """
    Any notes for this flow
    """


    # @ApiMember(Description="The ID of the account associated with the flow")
    account_id: Optional[str] = None
    """
    The ID of the account associated with the flow
    """


    # @ApiMember(Description="The name of the account associated with the flow")
    account_name: Optional[str] = None
    """
    The name of the account associated with the flow
    """


    # @ApiMember(Description="The ID of the customer this flow is associated with")
    customer_id: Optional[str] = None
    """
    The ID of the customer this flow is associated with
    """


    # @ApiMember(Description="The name of the customer this flow is associated with")
    customer_name: Optional[str] = None
    """
    The name of the customer this flow is associated with
    """


    # @ApiMember(Description="The breadcrumb to the flow for this endpoint")
    customer_breadcrumb: Optional[List[CustomerBreadcrumb]] = None
    """
    The breadcrumb to the flow for this endpoint
    """


    # @ApiMember(Description="The nodes in this flow")
    nodes: Optional[List[FlowNode]] = None
    """
    The nodes in this flow
    """


    # @ApiMember(Description="The flow's parameters")
    parameters: Optional[List[FlowParameter]] = None
    """
    The flow's parameters
    """


    # @ApiMember(Description="The flow's exits")
    exits: Optional[List[FlowExit]] = None
    """
    The flow's exits
    """


    # @ApiMember(Description="The UI data for the flow")
    ui: Optional[FlowUI] = None
    """
    The UI data for the flow
    """


    # @ApiMember(Description="The list of tags for this flow")
    tags: Optional[List[Tag]] = None
    """
    The list of tags for this flow
    """


    # @ApiMember(Description="The number of nodes in this flow")
    node_count: int = 0
    """
    The number of nodes in this flow
    """


# @Api(Description="Get the specified flow")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetFlow(IGet):
    """
    Get the specified flow
    """

    # @ApiMember(Description="the ID of the flow to retrieve")
    flow_id: Optional[str] = None
    """
    the ID of the flow to retrieve
    """

Python GetFlow DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /flows/{flowId} HTTP/1.1 
Host: team.evovoice.io 
Accept: application/xml
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>