Create a new workflow definition
POST https://automation.8x8.com/api/v1/accounts/:accountId/definitions
Use this resource to create and activate a new workflow definition.
Request
Path Parameters
Account id
Body
- inbound_sms (starts workflows when the account receives a SMS.)
- inbound_chat_apps (starts workflows when the account receives a message via a chat apps channel).
- http_request (starts workflows when a HTTP request is made to the trigger).
- enabled (this workflow definition is active and will start based on the trigger)
- disabled (this workflow definition is not active and will not start, regardless of the trigger)
- Array [
anyOf
- AUTO (automatically detect encoding)
- GSM7
- UCS2
- AUTO (automatically detect encoding)
- GSM7
- UCS2
- ]
8x8 subaccount id. If subaccount id is set, workflows with triggers like inbound message will only be started when that subaccount receives a message. If the subaccount id is null, workflows will be started when any subaccount under your account receives an inbound message.
Triggers are external events that start workflows. Supported triggers are
Possible values: [inbound_sms, inbound_chat_apps, http_request]
The status property allows to deactivate an existing workflow definition or to save a new one, without making it active.
Possible values: [enabled, disabled]
disabled
definition objectrequired
Descriptive name for the definition. Name does not need to be unique.
steps object[]required
Collection of steps that defines the activities to be executed when a workflow from the definition is run.
Type of the step.
Possible values: [SMS]
SMS
inputs object
Input parameters supported by the SMS step. All input parameters can be dynamically computed using JavaScript expressions.
SMS enabled 8x8 subaccount.
Valid phone number.
Content of the SMS.
Two letter country code of the destination phone number.
Sender id.
Client message id to identify the SMS on the client platform.
Messaging encoding type. Supported encodings are
ISO 8601 formatted date and time to send the SMS at a future time.
ISO 8601 formatted date and time after which the message will not be sent.
Callback URL to receive delivery receipts.
outputs object
Step output values that are available for saving to workflow context.
Unique message id assigned by the 8x8 messaging platform.
Last known status of the message.
Detailed description of the message status.
Phone number to which the message was sent.
Encoding used to send the message.
Client message id sent when the message was being sent.
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [SMS]
SMS
inputs object
Input parameters supported by the SMS step. All input parameters can be dynamically computed using JavaScript expressions.
SMS enabled 8x8 subaccount.
Valid phone number.
Content of the SMS.
Two letter country code of the destination phone number.
Sender id.
Client message id to identify the SMS on the client platform.
Messaging encoding type. Supported encodings are
ISO 8601 formatted date and time to send the SMS at a future time.
ISO 8601 formatted date and time after which the message will not be sent.
Callback URL to receive delivery receipts.
outputs object
Step output values that are available for saving to workflow context.
Unique message id assigned by the 8x8 messaging platform.
Last known status of the message.
Detailed description of the message status.
Phone number to which the message was sent.
Encoding used to send the message.
Client message id sent when the message was being sent.
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.
Type of the step.
Possible values: [ChatAppsMessage]
ChatAppsMessage
inputs objectrequired
Input parameters supported by the chat apps message step. All input parameters can be dynamically computed using JavaScript expressions.
Chat apps enabled 8x8 subaccount id.
Recipient details. User object depends on the channel message is being sent to. Refer to chat apps documentation for more information.
Message content type. For a list of supported content types, please refer to chat apps documentation.
Message content. Message content depends on the type of content being sent. Refer to chat apps documentation for more information.
Unique message identifier provided by the client.
outputs object
Output properties supported by ChatAppsMessage step.
Unique message id assigned by the 8x8 messaging platform.
Last known status of the message.
Detailed description of the message status.
Unique id of the chat apps message request. If the request failed before a umid is assigned by the messaging platform, request id can be used to troubleshoot the error.
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [ChatAppsMessage]
ChatAppsMessage
inputs objectrequired
Input parameters supported by the chat apps message step. All input parameters can be dynamically computed using JavaScript expressions.
Chat apps enabled 8x8 subaccount id.
Recipient details. User object depends on the channel message is being sent to. Refer to chat apps documentation for more information.
Message content type. For a list of supported content types, please refer to chat apps documentation.
Message content. Message content depends on the type of content being sent. Refer to chat apps documentation for more information.
Unique message identifier provided by the client.
outputs object
Output properties supported by ChatAppsMessage step.
Unique message id assigned by the 8x8 messaging platform.
Last known status of the message.
Detailed description of the message status.
Unique id of the chat apps message request. If the request failed before a umid is assigned by the messaging platform, request id can be used to troubleshoot the error.
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.
Type of the step.
Possible values: [HttpRequest]
HttpRequest
inputs objectrequired
Input properties supported by HTTP request step.
URL to make the HTTP request to.
HTTP method to use when making the HTTP request. All standard HTTP methods like GET, POST, PUT, DELETE, PATCH, etc are supported.
headers object
Map of HTTP headers to use in the request. Note that for Content-Type header, we only currently support application/json.
Authorization header.
Accept header.
parameters object
Map of query parameters to use in the request.
An example query parameter.
Object containing request data. The object will be serialized as JSON before sending the request.
HTTP request timeout. Default timeout is 5 seconds.
outputs object
Output properties supported by http request step.
HTTP response status code received from the server.
HTTP response message that summarizes the meaning of the HTTP status code.
HTTP response data.
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [HttpRequest]
HttpRequest
inputs objectrequired
Input properties supported by HTTP request step.
URL to make the HTTP request to.
HTTP method to use when making the HTTP request. All standard HTTP methods like GET, POST, PUT, DELETE, PATCH, etc are supported.
headers object
Map of HTTP headers to use in the request. Note that for Content-Type header, we only currently support application/json.
Authorization header.
Accept header.
parameters object
Map of query parameters to use in the request.
An example query parameter.
Object containing request data. The object will be serialized as JSON before sending the request.
HTTP request timeout. Default timeout is 5 seconds.
outputs object
Output properties supported by http request step.
HTTP response status code received from the server.
HTTP response message that summarizes the meaning of the HTTP status code.
HTTP response data.
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.
Type of the step.
Possible values: [Branch]
Branch
Map containing step ids as keys and JavaScript expressions as values to dynamically choose the next steps to execute. All conditions are evaluated and tried. Therefore, if more than one condition evaluates to true, more than one step will be executed. For the default branch, condition can be set to null.
null
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [Branch]
Branch
Map containing step ids as keys and JavaScript expressions as values to dynamically choose the next steps to execute. All conditions are evaluated and tried. Therefore, if more than one condition evaluates to true, more than one step will be executed. For the default branch, condition can be set to null.
null
Type of the step.
Possible values: [Wait]
Wait
inputs objectrequired
Input properties supported by wait step.
Timespan in the format "d.HH:mm:ss" to pause the workflow for. For example, "1.6:30:15" makes the workflow pause for 1 day, 6 hours, 30 minutes, and 15 seconds. If the timespan is in days, "HH:mm:ss" can be omitted. For instance, "2" pauses the workflow for two days.
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [Wait]
Wait
inputs objectrequired
Input properties supported by wait step.
Timespan in the format "d.HH:mm:ss" to pause the workflow for. For example, "1.6:30:15" makes the workflow pause for 1 day, 6 hours, 30 minutes, and 15 seconds. If the timespan is in days, "HH:mm:ss" can be omitted. For instance, "2" pauses the workflow for two days.
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.
Type of the step.
Possible values: [WaitForReply]
WaitForReply
inputs objectrequired
Input properties supported by wait for reply step.
Phone number or channel user id of the user for whose reply the workflow is waiting for. If the channel is SMS, from should be the msisdn. If the channel is a chat apps channel, from should be based on the channel user id of the inbound message.
Messaging channel like sms, whatsapp, etc. For a complete list, refer to channel type values.
Timeout in the format "d.HH:mm:ss". For example, "1.6:30:15" indicates the workflow to move on if a reply from the user is not received within 1 day, 6 hours, 30 minutes, and 15 seconds. If the timeout is in days, "HH:mm:ss" can be omitted. For instance, "2" waits for 2 days before timing out.
1.00:00:00
outputs objectrequired
Outputs supported by wait for reply step.
Inbound message data. Exact nature of the payload depends on the version of the inbound message webhook configured for your account. Refer to webhook object structure for more information.
Steps to execute depending on whether a reply is received or not. Presence or absence of the reply in the outputs indicates whether a reply was received within the timeout. Alternatively, you can set the nextStepId to a Branch step and check the conditions there.
{"reply_received":"{{data.reply != null}}","no_reply_received":"{{data.reply == null}}"}
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step. Do not use nextStepId and selectNextStep at the same time. Use one or the other.
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [WaitForReply]
WaitForReply
inputs objectrequired
Input properties supported by wait for reply step.
Phone number or channel user id of the user for whose reply the workflow is waiting for. If the channel is SMS, from should be the msisdn. If the channel is a chat apps channel, from should be based on the channel user id of the inbound message.
Messaging channel like sms, whatsapp, etc. For a complete list, refer to channel type values.
Timeout in the format "d.HH:mm:ss". For example, "1.6:30:15" indicates the workflow to move on if a reply from the user is not received within 1 day, 6 hours, 30 minutes, and 15 seconds. If the timeout is in days, "HH:mm:ss" can be omitted. For instance, "2" waits for 2 days before timing out.
1.00:00:00
outputs objectrequired
Outputs supported by wait for reply step.
Inbound message data. Exact nature of the payload depends on the version of the inbound message webhook configured for your account. Refer to webhook object structure for more information.
Steps to execute depending on whether a reply is received or not. Presence or absence of the reply in the outputs indicates whether a reply was received within the timeout. Alternatively, you can set the nextStepId to a Branch step and check the conditions there.
{"reply_received":"{{data.reply != null}}","no_reply_received":"{{data.reply == null}}"}
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step. Do not use nextStepId and selectNextStep at the same time. Use one or the other.
Type of the step.
Possible values: [VoiceMessage]
VoiceMessage
inputs objectrequired
Input properties supported by the voice message step.
Voice enabled subaccount id.
Unique identifier to reference the voice the message. JavaScript helper function uuid() can be used to generate a uuid.
Action to be performed as part of the voice message. Refer to voice messaging API documentation for more information.
Possible values: [say, say&capture, playFile]
say
Voice message parameters. Depends on the voice message action. Refer to voice messaging API documentation for supported voice message parameters.
outputs object
Supported output properties by the voice message step.
HTTP response message received from the voice messaging API. Refer to voice messaging API documentation for more information.
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step. Do not use nextStepId and selectNextStep at the same time. Use one or the other.
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [VoiceMessage]
VoiceMessage
inputs objectrequired
Input properties supported by the voice message step.
Voice enabled subaccount id.
Unique identifier to reference the voice the message. JavaScript helper function uuid() can be used to generate a uuid.
Action to be performed as part of the voice message. Refer to voice messaging API documentation for more information.
Possible values: [say, say&capture, playFile]
say
Voice message parameters. Depends on the voice message action. Refer to voice messaging API documentation for supported voice message parameters.
outputs object
Supported output properties by the voice message step.
HTTP response message received from the voice messaging API. Refer to voice messaging API documentation for more information.
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step. Do not use nextStepId and selectNextStep at the same time. Use one or the other.
Type of the step.
Possible values: [WaitForDTMF]
WaitForDTMF
inputs objectrequired
Input properties supported by the wait for DTMF step.
Client request id or the uid of the DTMF response. Recommendation is to set the client request id in the voice message step, save it to workflow context and reference it here. If you did not set a client request id in the voice message step, save the uid of the voice message response to workflow context and reference it here.
Timeout in the format "d.HH:mm:ss". For example, "1.6:30:15" indicates the workflow to move on if a reply from the user is not received within 1 day, 6 hours, 30 minutes, and 15 seconds. If the timeout is in days, "HH:mm:ss" can be omitted. For instance, "2" waits for 2 days before timing out.
1.00:00:00
outputs objectrequired
Output properties supported by the wait for DTMF step.
DTMF response data returned by the voice messaging API. Refer to voice messaging API documentation for more information.
{"uid":"AA562920-DD44-11EB-8FDE-A7A1C7823C5F","status":{"code":"DTMF","timestamp":"2021-07-05T03:54:31.271Z"},"destination":"xxxxxxxxxx","clientRequestId":"974eccfc-0607-4a99-a129-f9ee718e5fc1","actionDetails":{"dtmf":"2"}}
Steps to execute depending on the DTMF code. Presence or absence of the dtmfData in the outputs indicates whether a reply was received within the timeout. Alternatively, you can set the nextStepId to a Branch step and check the conditions there.
{"dtmf_1":"{{data.dtmf == '1'}}","dtmf_2":"{{data.dtmf == '2'}}","no_reply":"{{data.dtmf == null}}","invalid_dtmf":"{{data.dtmf != null && data.dtmf != '1' && data.dtmf != '2'}}"}
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [WaitForDTMF]
WaitForDTMF
inputs objectrequired
Input properties supported by the wait for DTMF step.
Client request id or the uid of the DTMF response. Recommendation is to set the client request id in the voice message step, save it to workflow context and reference it here. If you did not set a client request id in the voice message step, save the uid of the voice message response to workflow context and reference it here.
Timeout in the format "d.HH:mm:ss". For example, "1.6:30:15" indicates the workflow to move on if a reply from the user is not received within 1 day, 6 hours, 30 minutes, and 15 seconds. If the timeout is in days, "HH:mm:ss" can be omitted. For instance, "2" waits for 2 days before timing out.
1.00:00:00
outputs objectrequired
Output properties supported by the wait for DTMF step.
DTMF response data returned by the voice messaging API. Refer to voice messaging API documentation for more information.
{"uid":"AA562920-DD44-11EB-8FDE-A7A1C7823C5F","status":{"code":"DTMF","timestamp":"2021-07-05T03:54:31.271Z"},"destination":"xxxxxxxxxx","clientRequestId":"974eccfc-0607-4a99-a129-f9ee718e5fc1","actionDetails":{"dtmf":"2"}}
Steps to execute depending on the DTMF code. Presence or absence of the dtmfData in the outputs indicates whether a reply was received within the timeout. Alternatively, you can set the nextStepId to a Branch step and check the conditions there.
{"dtmf_1":"{{data.dtmf == '1'}}","dtmf_2":"{{data.dtmf == '2'}}","no_reply":"{{data.dtmf == null}}","invalid_dtmf":"{{data.dtmf != null && data.dtmf != '1' && data.dtmf != '2'}}"}
Newly created workflow definition.
Response Headers
Path to the newly created workflow definition
Schema
- inbound_sms (starts workflows when the account receives a SMS.)
- inbound_chat_apps (starts workflows when the account receives a message via a chat apps channel).
- http_request (starts workflows when a HTTP request is made to the trigger).
- enabled (this workflow definition is active and will start based on the trigger)
- disabled (this workflow definition is not active and will not start, regardless of the trigger)
- Array [
anyOf
- AUTO (automatically detect encoding)
- GSM7
- UCS2
- ]
8x8 subaccount id. If subaccount id is set, workflows with triggers like inbound message will only be started when that subaccount receives a message. If the subaccount id is null, workflows will be started when any subaccount under your account receives an inbound message.
Triggers are external events that start workflows. Supported triggers are
Possible values: [inbound_sms, inbound_chat_apps, http_request]
The status property allows to deactivate an existing workflow definition or to save a new one, without making it active.
Possible values: [enabled, disabled]
disabled
definition objectrequired
Descriptive name for the definition. Name does not need to be unique.
steps object[]required
Collection of steps that defines the activities to be executed when a workflow from the definition is run.
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [SMS]
SMS
inputs object
Input parameters supported by the SMS step. All input parameters can be dynamically computed using JavaScript expressions.
SMS enabled 8x8 subaccount.
Valid phone number.
Content of the SMS.
Two letter country code of the destination phone number.
Sender id.
Client message id to identify the SMS on the client platform.
Messaging encoding type. Supported encodings are
ISO 8601 formatted date and time to send the SMS at a future time.
ISO 8601 formatted date and time after which the message will not be sent.
Callback URL to receive delivery receipts.
outputs object
Step output values that are available for saving to workflow context.
Unique message id assigned by the 8x8 messaging platform.
Last known status of the message.
Detailed description of the message status.
Phone number to which the message was sent.
Encoding used to send the message.
Client message id sent when the message was being sent.
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [ChatAppsMessage]
ChatAppsMessage
inputs objectrequired
Input parameters supported by the chat apps message step. All input parameters can be dynamically computed using JavaScript expressions.
Chat apps enabled 8x8 subaccount id.
Recipient details. User object depends on the channel message is being sent to. Refer to chat apps documentation for more information.
Message content type. For a list of supported content types, please refer to chat apps documentation.
Message content. Message content depends on the type of content being sent. Refer to chat apps documentation for more information.
Unique message identifier provided by the client.
outputs object
Output properties supported by ChatAppsMessage step.
Unique message id assigned by the 8x8 messaging platform.
Last known status of the message.
Detailed description of the message status.
Unique id of the chat apps message request. If the request failed before a umid is assigned by the messaging platform, request id can be used to troubleshoot the error.
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [HttpRequest]
HttpRequest
inputs objectrequired
Input properties supported by HTTP request step.
URL to make the HTTP request to.
HTTP method to use when making the HTTP request. All standard HTTP methods like GET, POST, PUT, DELETE, PATCH, etc are supported.
headers object
Map of HTTP headers to use in the request. Note that for Content-Type header, we only currently support application/json.
Authorization header.
Accept header.
parameters object
Map of query parameters to use in the request.
An example query parameter.
Object containing request data. The object will be serialized as JSON before sending the request.
HTTP request timeout. Default timeout is 5 seconds.
outputs object
Output properties supported by http request step.
HTTP response status code received from the server.
HTTP response message that summarizes the meaning of the HTTP status code.
HTTP response data.
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [Branch]
Branch
Map containing step ids as keys and JavaScript expressions as values to dynamically choose the next steps to execute. All conditions are evaluated and tried. Therefore, if more than one condition evaluates to true, more than one step will be executed. For the default branch, condition can be set to null.
null
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [Wait]
Wait
inputs objectrequired
Input properties supported by wait step.
Timespan in the format "d.HH:mm:ss" to pause the workflow for. For example, "1.6:30:15" makes the workflow pause for 1 day, 6 hours, 30 minutes, and 15 seconds. If the timespan is in days, "HH:mm:ss" can be omitted. For instance, "2" pauses the workflow for two days.
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [WaitForReply]
WaitForReply
inputs objectrequired
Input properties supported by wait for reply step.
Phone number or channel user id of the user for whose reply the workflow is waiting for. If the channel is SMS, from should be the msisdn. If the channel is a chat apps channel, from should be based on the channel user id of the inbound message.
Messaging channel like sms, whatsapp, etc. For a complete list, refer to channel type values.
Timeout in the format "d.HH:mm:ss". For example, "1.6:30:15" indicates the workflow to move on if a reply from the user is not received within 1 day, 6 hours, 30 minutes, and 15 seconds. If the timeout is in days, "HH:mm:ss" can be omitted. For instance, "2" waits for 2 days before timing out.
1.00:00:00
outputs objectrequired
Outputs supported by wait for reply step.
Inbound message data. Exact nature of the payload depends on the version of the inbound message webhook configured for your account. Refer to webhook object structure for more information.
Steps to execute depending on whether a reply is received or not. Presence or absence of the reply in the outputs indicates whether a reply was received within the timeout. Alternatively, you can set the nextStepId to a Branch step and check the conditions there.
{"reply_received":"{{data.reply != null}}","no_reply_received":"{{data.reply == null}}"}
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step. Do not use nextStepId and selectNextStep at the same time. Use one or the other.
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [VoiceMessage]
VoiceMessage
inputs objectrequired
Input properties supported by the voice message step.
Voice enabled subaccount id.
Unique identifier to reference the voice the message. JavaScript helper function uuid() can be used to generate a uuid.
Action to be performed as part of the voice message. Refer to voice messaging API documentation for more information.
Possible values: [say, say&capture, playFile]
say
Voice message parameters. Depends on the voice message action. Refer to voice messaging API documentation for supported voice message parameters.
outputs object
Supported output properties by the voice message step.
HTTP response message received from the voice messaging API. Refer to voice messaging API documentation for more information.
Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step. Do not use nextStepId and selectNextStep at the same time. Use one or the other.
Step id. Step id must be unique within the workflow definition.
Type of the step.
Possible values: [WaitForDTMF]
WaitForDTMF
inputs objectrequired
Input properties supported by the wait for DTMF step.
Client request id or the uid of the DTMF response. Recommendation is to set the client request id in the voice message step, save it to workflow context and reference it here. If you did not set a client request id in the voice message step, save the uid of the voice message response to workflow context and reference it here.
Timeout in the format "d.HH:mm:ss". For example, "1.6:30:15" indicates the workflow to move on if a reply from the user is not received within 1 day, 6 hours, 30 minutes, and 15 seconds. If the timeout is in days, "HH:mm:ss" can be omitted. For instance, "2" waits for 2 days before timing out.
1.00:00:00
outputs objectrequired
Output properties supported by the wait for DTMF step.
DTMF response data returned by the voice messaging API. Refer to voice messaging API documentation for more information.
{"uid":"AA562920-DD44-11EB-8FDE-A7A1C7823C5F","status":{"code":"DTMF","timestamp":"2021-07-05T03:54:31.271Z"},"destination":"xxxxxxxxxx","clientRequestId":"974eccfc-0607-4a99-a129-f9ee718e5fc1","actionDetails":{"dtmf":"2"}}
Steps to execute depending on the DTMF code. Presence or absence of the dtmfData in the outputs indicates whether a reply was received within the timeout. Alternatively, you can set the nextStepId to a Branch step and check the conditions there.
{"dtmf_1":"{{data.dtmf == '1'}}","dtmf_2":"{{data.dtmf == '2'}}","no_reply":"{{data.dtmf == null}}","invalid_dtmf":"{{data.dtmf != null && data.dtmf != '1' && data.dtmf != '2'}}"}
8x8 account id.
Unique definition id.
Version of the definition. When a definition is updated, version number is automatically incremented.
Possible values: >= 1
Timestamp when the definition was created.
Possible values: non-empty
{
"subAccountId":"string",
"trigger":"inbound_sms",
"status":"disabled",
"definition":{
"name":"string",
"steps":[
{
"id":"string",
"stepType":"SMS",
"inputs":{
"subAccountId":"string",
"destination":"string",
"text":"string",
"country":"string",
"source":"string",
"clientMessageId":"string",
"encoding":"string",
"scheduled":"string",
"expiry":"string",
"dlrCallbackUrl":"string"
},
"outputs":{
"umid":"string",
"status":"string",
"description":"string",
"destination":"string",
"encoding":"string",
"clientMessageId":"string"
},
"nextStepId":"string"
},
{
"id":"string",
"stepType":"ChatAppsMessage",
"inputs":{
"subAccountId":"string",
"user":{},
"type":"string",
"content":{},
"clientMessageId":"string"
},
"outputs":{
"umid":"string",
"status":"string",
"description":"string",
"requestId":"string"
},
"nextStepId":"string"
},
{
"id":"string",
"stepType":"HttpRequest",
"inputs":{
"url":"string",
"method":"string",
"headers":{
"Authorization":"string",
"Accept":"string"
},
"parameters":{
"query_param1":"string"
},
"body":{},
"timeoutSeconds":0
},
"outputs":{
"responseCode":0,
"reasonPhrase":"string",
"responseBody":{}
},
"nextStepId":"string"
},
{
"id":"string",
"stepType":"Branch",
"selectNextStep":{}
},
{
"id":"string",
"stepType":"Wait",
"inputs":{
"duration":"string"
},
"nextStepId":"string"
},
{
"id":"string",
"stepType":"WaitForReply",
"inputs":{
"from":"string",
"channel":"string",
"timeout":"1.00:00:00"
},
"outputs":{
"reply":{}
},
"selectNextStep":{
"reply_received":"{{data.reply != null}}",
"no_reply_received":"{{data.reply == null}}"
},
"nextStepId":"string"
},
{
"id":"string",
"stepType":"VoiceMessage",
"inputs":{
"subAccountId":"string",
"clientRequestId":"string",
"action":"say",
"params":{}
},
"outputs":{
"response":{}
},
"nextStepId":"string"
},
{
"id":"string",
"stepType":"WaitForDTMF",
"inputs":{
"dtmfRequestId":"string",
"timeout":"1.00:00:00"
},
"outputs":{
"dtmfData":{
"uid":"AA562920-DD44-11EB-8FDE-A7A1C7823C5F",
"status":{
"code":"DTMF",
"timestamp":"2021-07-05T03:54:31.271Z"
},
"destination":"xxxxxxxxxx",
"clientRequestId":"974eccfc-0607-4a99-a129-f9ee718e5fc1",
"actionDetails":{
"dtmf":"2"
}
}
},
"selectNextStep":{
"dtmf_1":"{{data.dtmf == '1'}}",
"dtmf_2":"{{data.dtmf == '2'}}",
"no_reply":"{{data.dtmf == null}}",
"invalid_dtmf":"{{data.dtmf != null && data.dtmf != '1' && data.dtmf != '2'}}"
}
}
]
},
"accountId":"string",
"id":"string",
"version":0,
"createdAt":"string"
}
{
"accountId":"8x8_test_account",
"subaccountId":"8x8_test_subaccount",
"trigger":"inbound_chat_apps",
"status":"enabled",
"createdAt":"2021-07-12T04:49:30.27Z",
"definition":{
"id":"ae54eaf1-b86d-43c5-8982-2818f9bbe52c",
"name":"Send automatic reply",
"version":1,
"steps":[
{
"id":"step1",
"stepType":"Wait",
"inputs":{
"duration":"00:02:00"
},
"nextStepId":"step2"
},
{
"id":"step2",
"stepType":"ChatAppsMessage",
"inputs":{
"subAccountId":"8x8_subaccount_id",
"user":{
"msisdn":"{{data.payload.user.msisdn}}"
},
"type":"text",
"content":{
"text":"Hello, world!"
}
},
"nextStepId":"step3"
}
]
}
}
Invalid request.
Schema
Error code.
Description of the error.
Unique error id.
Timestamp when the error occurred.
{
"code":0,
"message":"string",
"errorId":"string",
"timestamp":"string"
}
{
"code":5001,
"message":"Workflow name is required.",
"errorId":"e1e9961a-2d5f-4221-9a18-ad6300846626",
"timestamp":"2021-07-12T08:02:03.03Z"
}
Source: https://developer.8x8.com/connect/reference/create-definition · 8x8 CPaaS Developer Docs. Synced for support deflection.
0 Comments