Evo Voice

<back to all web services

NewFlowMessage

The following routes are available for this service:
All Verbs/flows/message
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    public static class NewFlowMessage
    {
        /**
        * The ID of the endpoint that received the message
        */
        @ApiMember(Description="The ID of the endpoint that received the message")
        public String endpointId = null;

        /**
        * The session values
        */
        @ApiMember(Description="The session values")
        public Struct sessionParameters = null;

        /**
        * The from address
        */
        @ApiMember(Description="The from address")
        public String fromAddress = null;

        /**
        * The to address
        */
        @ApiMember(Description="The to address")
        public String toAddress = null;

        /**
        * The identity of the sender
        */
        @ApiMember(Description="The identity of the sender")
        public String identity = null;

        /**
        * The display name of the sender (will default to identity if not specified
        */
        @ApiMember(Description="The display name of the sender (will default to identity if not specified")
        public String displayName = null;

        /**
        * The URL to call when replies need to be sent back
        */
        @ApiMember(Description="The URL to call when replies need to be sent back")
        public String messageUrl = null;
        
        public String getEndpointId() { return endpointId; }
        public NewFlowMessage setEndpointId(String value) { this.endpointId = value; return this; }
        public Struct getSessionParameters() { return sessionParameters; }
        public NewFlowMessage setSessionParameters(Struct value) { this.sessionParameters = value; return this; }
        public String getFromAddress() { return fromAddress; }
        public NewFlowMessage setFromAddress(String value) { this.fromAddress = value; return this; }
        public String getToAddress() { return toAddress; }
        public NewFlowMessage setToAddress(String value) { this.toAddress = value; return this; }
        public String getIdentity() { return identity; }
        public NewFlowMessage setIdentity(String value) { this.identity = value; return this; }
        public String getDisplayName() { return displayName; }
        public NewFlowMessage setDisplayName(String value) { this.displayName = value; return this; }
        public String getMessageUrl() { return messageUrl; }
        public NewFlowMessage setMessageUrl(String value) { this.messageUrl = value; return this; }
    }

    public static class Struct extends HashMap<String,Value>
    {
        
    }

    public static class Value
    {
        public Boolean boolValue = null;
        public String stringValue = null;
        public Double numberValue = null;
        public ArrayList<Struct> listValue = null;
        public Struct structValue = null;
        
        public Boolean isBoolValue() { return boolValue; }
        public Value setBoolValue(Boolean value) { this.boolValue = value; return this; }
        public String getStringValue() { return stringValue; }
        public Value setStringValue(String value) { this.stringValue = value; return this; }
        public Double getNumberValue() { return numberValue; }
        public Value setNumberValue(Double value) { this.numberValue = value; return this; }
        public ArrayList<Struct> getListValue() { return listValue; }
        public Value setListValue(ArrayList<Struct> value) { this.listValue = value; return this; }
        public Struct getStructValue() { return structValue; }
        public Value setStructValue(Struct value) { this.structValue = value; return this; }
    }

    public static class HttpResult
    {
        public String responseText = null;
        public InputStream responseStream = null;
        public FileInfo fileInfo = null;
        public IVirtualFile virtualFile = null;
        public String contentType = null;
        public HashMap<String,String> headers = null;
        public ArrayList<Cookie> cookies = null;
        public String eTag = null;
        public TimeSpan age = null;
        public TimeSpan maxAge = null;
        public Date expires = null;
        public Date lastModified = null;
        public CacheControl cacheControl = null;
        public Func<IDisposable> resultScope = null;
        public Boolean allowsPartialResponse = null;
        public HashMap<String,String> options = null;
        public Integer status = null;
        public HttpStatusCode statusCode = null;
        public String statusDescription = null;
        public Object response = null;
        public IContentTypeWriter responseFilter = null;
        public IRequest requestContext = null;
        public String view = null;
        public String template = null;
        public Integer paddingLength = null;
        public Boolean isPartialRequest = null;
        
        public String getResponseText() { return responseText; }
        public HttpResult setResponseText(String value) { this.responseText = value; return this; }
        public InputStream getResponseStream() { return responseStream; }
        public HttpResult setResponseStream(InputStream value) { this.responseStream = value; return this; }
        public FileInfo getFileInfo() { return fileInfo; }
        public HttpResult setFileInfo(FileInfo value) { this.fileInfo = value; return this; }
        public IVirtualFile getVirtualFile() { return virtualFile; }
        public HttpResult setVirtualFile(IVirtualFile value) { this.virtualFile = value; return this; }
        public String getContentType() { return contentType; }
        public HttpResult setContentType(String value) { this.contentType = value; return this; }
        public HashMap<String,String> getHeaders() { return headers; }
        public HttpResult setHeaders(HashMap<String,String> value) { this.headers = value; return this; }
        public ArrayList<Cookie> getCookies() { return cookies; }
        public HttpResult setCookies(ArrayList<Cookie> value) { this.cookies = value; return this; }
        public String getETag() { return eTag; }
        public HttpResult setETag(String value) { this.eTag = value; return this; }
        public TimeSpan getAge() { return age; }
        public HttpResult setAge(TimeSpan value) { this.age = value; return this; }
        public TimeSpan getMaxAge() { return maxAge; }
        public HttpResult setMaxAge(TimeSpan value) { this.maxAge = value; return this; }
        public Date getExpires() { return expires; }
        public HttpResult setExpires(Date value) { this.expires = value; return this; }
        public Date getLastModified() { return lastModified; }
        public HttpResult setLastModified(Date value) { this.lastModified = value; return this; }
        public CacheControl getCacheControl() { return cacheControl; }
        public HttpResult setCacheControl(CacheControl value) { this.cacheControl = value; return this; }
        public Func<IDisposable> getResultScope() { return resultScope; }
        public HttpResult setResultScope(Func<IDisposable> value) { this.resultScope = value; return this; }
        public Boolean isAllowsPartialResponse() { return allowsPartialResponse; }
        public HttpResult setAllowsPartialResponse(Boolean value) { this.allowsPartialResponse = value; return this; }
        public HashMap<String,String> getOptions() { return options; }
        public HttpResult setOptions(HashMap<String,String> value) { this.options = value; return this; }
        public Integer getStatus() { return status; }
        public HttpResult setStatus(Integer value) { this.status = value; return this; }
        public HttpStatusCode getStatusCode() { return statusCode; }
        public HttpResult setStatusCode(HttpStatusCode value) { this.statusCode = value; return this; }
        public String getStatusDescription() { return statusDescription; }
        public HttpResult setStatusDescription(String value) { this.statusDescription = value; return this; }
        public Object getResponse() { return response; }
        public HttpResult setResponse(Object value) { this.response = value; return this; }
        public IContentTypeWriter getResponseFilter() { return responseFilter; }
        public HttpResult setResponseFilter(IContentTypeWriter value) { this.responseFilter = value; return this; }
        public IRequest getRequestContext() { return requestContext; }
        public HttpResult setRequestContext(IRequest value) { this.requestContext = value; return this; }
        public String getView() { return view; }
        public HttpResult setView(String value) { this.view = value; return this; }
        public String getTemplate() { return template; }
        public HttpResult setTemplate(String value) { this.template = value; return this; }
        public Integer getPaddingLength() { return paddingLength; }
        public HttpResult setPaddingLength(Integer value) { this.paddingLength = value; return this; }
        public Boolean getIsPartialRequest() { return isPartialRequest; }
        public HttpResult setIsPartialRequest(Boolean value) { this.isPartialRequest = value; return this; }
    }

    public static interface IVirtualFile
    {
        public IVirtualPathProvider virtualPathProvider = null;
        public String extension = null;
        public Long length = null;
    }

    public static interface IVirtualPathProvider
    {
        public IVirtualDirectory rootDirectory = null;
        public String virtualPathSeparator = null;
        public String realPathSeparator = null;
    }

    public static interface IVirtualDirectory
    {
    }

    @Flags()
    public static enum CacheControl
    {
        @SerializedName("0") None(0),
        @SerializedName("1") Public(1),
        @SerializedName("2") Private(2),
        @SerializedName("4") MustRevalidate(4),
        @SerializedName("8") NoCache(8),
        @SerializedName("16") NoStore(16),
        @SerializedName("32") NoTransform(32),
        @SerializedName("64") ProxyRevalidate(64);

        private final int value;
        CacheControl(final int intValue) { value = intValue; }
        public int getValue() { return value; }
    }

    public static interface IContentTypeWriter
    {
    }

    public static interface IRequest
    {
        public Object originalRequest = null;
        public IResponse response = null;
        public String operationName = null;
        public String verb = null;
        public RequestAttributes requestAttributes = null;
        public IRequestPreferences requestPreferences = null;
        public Object dto = null;
        public String contentType = null;
        public Boolean isLocal = null;
        public String userAgent = null;
        public HashMap<String,Cookie> cookies = null;
        public String responseContentType = null;
        public Boolean hasExplicitResponseContentType = null;
        public HashMap<String,Object> items = null;
        public NameValueCollection headers = null;
        public NameValueCollection queryString = null;
        public NameValueCollection formData = null;
        public Boolean useBufferedStream = null;
        public String rawUrl = null;
        public String absoluteUri = null;
        public String userHostAddress = null;
        public String remoteIp = null;
        public String authorization = null;
        public Boolean isSecureConnection = null;
        public ArrayList<String> acceptTypes = null;
        public String pathInfo = null;
        public String originalPathInfo = null;
        public InputStream inputStream = null;
        public Long contentLength = null;
        public ArrayList<IHttpFile> files = null;
        public Uri urlReferrer = null;
    }

    public static interface IResponse
    {
        public Object originalResponse = null;
        public IRequest request = null;
        public Integer statusCode = null;
        public String statusDescription = null;
        public String contentType = null;
        public InputStream outputStream = null;
        public Object dto = null;
        public Boolean useBufferedStream = null;
        public Boolean isClosed = null;
        public Boolean keepAlive = null;
        public Boolean hasStarted = null;
        public HashMap<String,Object> items = null;
    }

    @Flags()
    public static enum RequestAttributes
    {
        @SerializedName("0") None(0),
        @SerializedName("1") Localhost(1),
        @SerializedName("2") LocalSubnet(2),
        @SerializedName("4") External(4),
        @SerializedName("8") Secure(8),
        @SerializedName("16") InSecure(16),
        @SerializedName("24") AnySecurityMode(24),
        @SerializedName("32") HttpHead(32),
        @SerializedName("64") HttpGet(64),
        @SerializedName("128") HttpPost(128),
        @SerializedName("256") HttpPut(256),
        @SerializedName("512") HttpDelete(512),
        @SerializedName("1024") HttpPatch(1024),
        @SerializedName("2048") HttpOptions(2048),
        @SerializedName("4096") HttpOther(4096),
        @SerializedName("8160") AnyHttpMethod(8160),
        @SerializedName("8192") OneWay(8192),
        @SerializedName("16384") Reply(16384),
        @SerializedName("24576") AnyCallStyle(24576),
        @SerializedName("32768") Soap11(32768),
        @SerializedName("65536") Soap12(65536),
        @SerializedName("131072") Xml(131072),
        @SerializedName("262144") Json(262144),
        @SerializedName("524288") Jsv(524288),
        @SerializedName("1048576") ProtoBuf(1048576),
        @SerializedName("2097152") Csv(2097152),
        @SerializedName("4194304") Html(4194304),
        @SerializedName("8388608") Wire(8388608),
        @SerializedName("16777216") MsgPack(16777216),
        @SerializedName("33554432") FormatOther(33554432),
        @SerializedName("67076096") AnyFormat(67076096),
        @SerializedName("67108864") Http(67108864),
        @SerializedName("134217728") MessageQueue(134217728),
        @SerializedName("268435456") Tcp(268435456),
        @SerializedName("536870912") Grpc(536870912),
        @SerializedName("1073741824") EndpointOther(1073741824),
        @SerializedName("2080374784") AnyEndpoint(2080374784),
        @SerializedName("-2147483648") InProcess(-2147483648),
        @SerializedName("-2147483645") InternalNetworkAccess(-2147483645),
        @SerializedName("-2147483641") AnyNetworkAccessType(-2147483641),
        @SerializedName("-1") Any(-1);

        private final int value;
        RequestAttributes(final int intValue) { value = intValue; }
        public int getValue() { return value; }
    }

    public static interface IRequestPreferences
    {
        public Boolean acceptsBrotli = null;
        public Boolean acceptsDeflate = null;
        public Boolean acceptsGzip = null;
    }

    public static interface IHttpFile
    {
        public String name = null;
        public String fileName = null;
        public Long contentLength = null;
        public String contentType = null;
        public InputStream inputStream = null;
    }

}

Java NewFlowMessage 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.

POST /flows/message HTTP/1.1 
Host: evovoice.io 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<NewFlowMessage xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Flows">
  <DisplayName>String</DisplayName>
  <EndpointId>String</EndpointId>
  <FromAddress>String</FromAddress>
  <Identity>String</Identity>
  <MessageUrl>String</MessageUrl>
  <SessionParameters xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringValue8Ahp2kgT>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value xmlns:d4p1="http://schemas.datacontract.org/2004/07/Voice.Api.Flows.Data">
        <d4p1:BoolValue>false</d4p1:BoolValue>
        <d4p1:ListValue>
          <d2p1:ArrayOfKeyValueOfstringValue8Ahp2kgT>
            <d2p1:KeyValueOfstringValue8Ahp2kgT>
              <d2p1:Key>String</d2p1:Key>
              <d2p1:Value>
                <d4p1:BoolValue>false</d4p1:BoolValue>
                <d4p1:ListValue>
                  <d2p1:ArrayOfKeyValueOfstringValue8Ahp2kgT>
                    <d2p1:KeyValueOfstringValue8Ahp2kgT>
                      <d2p1:Key>String</d2p1:Key>
                      <d2p1:Value>
                        <d4p1:BoolValue>false</d4p1:BoolValue>
                        <d4p1:ListValue>
                          <d2p1:ArrayOfKeyValueOfstringValue8Ahp2kgT i:nil="true" />
                        </d4p1:ListValue>
                        <d4p1:NumberValue>0</d4p1:NumberValue>
                        <d4p1:StringValue>String</d4p1:StringValue>
                        <d4p1:StructValue i:nil="true" />
                      </d2p1:Value>
                    </d2p1:KeyValueOfstringValue8Ahp2kgT>
                  </d2p1:ArrayOfKeyValueOfstringValue8Ahp2kgT>
                </d4p1:ListValue>
                <d4p1:NumberValue>0</d4p1:NumberValue>
                <d4p1:StringValue>String</d4p1:StringValue>
                <d4p1:StructValue>
                  <d2p1:KeyValueOfstringValue8Ahp2kgT>
                    <d2p1:Key>String</d2p1:Key>
                    <d2p1:Value>
                      <d4p1:BoolValue>false</d4p1:BoolValue>
                      <d4p1:ListValue>
                        <d2p1:ArrayOfKeyValueOfstringValue8Ahp2kgT i:nil="true" />
                      </d4p1:ListValue>
                      <d4p1:NumberValue>0</d4p1:NumberValue>
                      <d4p1:StringValue>String</d4p1:StringValue>
                      <d4p1:StructValue i:nil="true" />
                    </d2p1:Value>
                  </d2p1:KeyValueOfstringValue8Ahp2kgT>
                </d4p1:StructValue>
              </d2p1:Value>
            </d2p1:KeyValueOfstringValue8Ahp2kgT>
          </d2p1:ArrayOfKeyValueOfstringValue8Ahp2kgT>
        </d4p1:ListValue>
        <d4p1:NumberValue>0</d4p1:NumberValue>
        <d4p1:StringValue>String</d4p1:StringValue>
        <d4p1:StructValue>
          <d2p1:KeyValueOfstringValue8Ahp2kgT>
            <d2p1:Key>String</d2p1:Key>
            <d2p1:Value>
              <d4p1:BoolValue>false</d4p1:BoolValue>
              <d4p1:ListValue>
                <d2p1:ArrayOfKeyValueOfstringValue8Ahp2kgT>
                  <d2p1:KeyValueOfstringValue8Ahp2kgT>
                    <d2p1:Key>String</d2p1:Key>
                    <d2p1:Value>
                      <d4p1:BoolValue>false</d4p1:BoolValue>
                      <d4p1:ListValue>
                        <d2p1:ArrayOfKeyValueOfstringValue8Ahp2kgT i:nil="true" />
                      </d4p1:ListValue>
                      <d4p1:NumberValue>0</d4p1:NumberValue>
                      <d4p1:StringValue>String</d4p1:StringValue>
                      <d4p1:StructValue i:nil="true" />
                    </d2p1:Value>
                  </d2p1:KeyValueOfstringValue8Ahp2kgT>
                </d2p1:ArrayOfKeyValueOfstringValue8Ahp2kgT>
              </d4p1:ListValue>
              <d4p1:NumberValue>0</d4p1:NumberValue>
              <d4p1:StringValue>String</d4p1:StringValue>
              <d4p1:StructValue>
                <d2p1:KeyValueOfstringValue8Ahp2kgT>
                  <d2p1:Key>String</d2p1:Key>
                  <d2p1:Value>
                    <d4p1:BoolValue>false</d4p1:BoolValue>
                    <d4p1:ListValue>
                      <d2p1:ArrayOfKeyValueOfstringValue8Ahp2kgT i:nil="true" />
                    </d4p1:ListValue>
                    <d4p1:NumberValue>0</d4p1:NumberValue>
                    <d4p1:StringValue>String</d4p1:StringValue>
                    <d4p1:StructValue i:nil="true" />
                  </d2p1:Value>
                </d2p1:KeyValueOfstringValue8Ahp2kgT>
              </d4p1:StructValue>
            </d2p1:Value>
          </d2p1:KeyValueOfstringValue8Ahp2kgT>
        </d4p1:StructValue>
      </d2p1:Value>
    </d2p1:KeyValueOfstringValue8Ahp2kgT>
  </SessionParameters>
  <ToAddress>String</ToAddress>
</NewFlowMessage>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CustomHttpResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types" />