Retrieve the version history of a workflow definition.

GET https://automation.8x8.com/api/v1/accounts/:accountId/definitions/:definitionId

Use this resource to explore different versions of a workflow definition. Results are ordered in the descending order of the version.

Request

Path Parameters

    accountId stringrequired

    Account id

    definitionId stringrequired

    Workflow definition id.

Query Parameters

    limit integer

    Possible values: >= 1 and <= 500

    Number of items to include in the response.

    Default value: 100
    offset integer

    Possible values: >= 0

    Page offset. Setting limit to 10 and offset to 0 returns the first 10 items. Increment offset to retrieve more items.

    Default value: 0

List of definitions. If there are no definitions by the specified definition id, an empty list is returned.

Schema

  • Array [
  • subAccountIdstring

    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.

    triggertrigger (string)required

    Triggers are external events that start workflows. Supported triggers are

    • 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).

    Possible values: [inbound_sms, inbound_chat_apps, http_request]

    statusstatus (string)

    The status property allows to deactivate an existing workflow definition or to save a new one, without making it active.

    • 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)

    Possible values: [enabled, disabled]

    Default value: disabled

    definition objectrequired

    namestringrequired

    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.

  • Array [
  • anyOf
    idstringrequired

    Step id. Step id must be unique within the workflow definition.

    stepTypestring

    Type of the step.

    Possible values: [SMS]

    Default value: SMS

    inputs object

    Input parameters supported by the SMS step. All input parameters can be dynamically computed using JavaScript expressions.

    subAccountIdstringrequired

    SMS enabled 8x8 subaccount.

    destinationstringrequired

    Valid phone number.

    textstringrequired

    Content of the SMS.

    countrystring

    Two letter country code of the destination phone number.

    sourcestring

    Sender id.

    clientMessageIdstring

    Client message id to identify the SMS on the client platform.

    encodingstring

    Messaging encoding type. Supported encodings are

    • AUTO (automatically detect encoding)
    • GSM7
    • UCS2
    scheduledstring

    ISO 8601 formatted date and time to send the SMS at a future time.

    expirystring

    ISO 8601 formatted date and time after which the message will not be sent.

    dlrCallbackUrlstring

    Callback URL to receive delivery receipts.

    outputs object

    Step output values that are available for saving to workflow context.

    umidstring

    Unique message id assigned by the 8x8 messaging platform.

    statusstring

    Last known status of the message.

    descriptionstring

    Detailed description of the message status.

    destinationstring

    Phone number to which the message was sent.

    encodingstring

    Encoding used to send the message.

    clientMessageIdstring

    Client message id sent when the message was being sent.

    nextStepIdstring

    Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.

    idstringrequired

    Step id. Step id must be unique within the workflow definition.

    stepTypestringrequired

    Type of the step.

    Possible values: [ChatAppsMessage]

    Default value: ChatAppsMessage

    inputs objectrequired

    Input parameters supported by the chat apps message step. All input parameters can be dynamically computed using JavaScript expressions.

    subAccountIdstringrequired

    Chat apps enabled 8x8 subaccount id.

    userobjectrequired

    Recipient details. User object depends on the channel message is being sent to. Refer to chat apps documentation for more information.

    typestringrequired

    Message content type. For a list of supported content types, please refer to chat apps documentation.

    contentobjectrequired

    Message content. Message content depends on the type of content being sent. Refer to chat apps documentation for more information.

    clientMessageIdstring

    Unique message identifier provided by the client.

    outputs object

    Output properties supported by ChatAppsMessage step.

    umidstring

    Unique message id assigned by the 8x8 messaging platform.

    statusstring

    Last known status of the message.

    descriptionstring

    Detailed description of the message status.

    requestIdstring

    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.

    nextStepIdstring

    Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.

    idstringrequired

    Step id. Step id must be unique within the workflow definition.

    stepTypestringrequired

    Type of the step.

    Possible values: [HttpRequest]

    Default value: HttpRequest

    inputs objectrequired

    Input properties supported by HTTP request step.

    urlstringrequired

    URL to make the HTTP request to.

    methodstringrequired

    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.

    Authorizationstring

    Authorization header.

    Acceptstring

    Accept header.

    parameters object

    Map of query parameters to use in the request.

    query_param1string

    An example query parameter.

    bodyobject

    Object containing request data. The object will be serialized as JSON before sending the request.

    timeoutSecondsinteger

    HTTP request timeout. Default timeout is 5 seconds.

    outputs object

    Output properties supported by http request step.

    responseCodeinteger

    HTTP response status code received from the server.

    reasonPhrasestring

    HTTP response message that summarizes the meaning of the HTTP status code.

    responseBodyobject

    HTTP response data.

    nextStepIdstring

    Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.

    idstringrequired

    Step id. Step id must be unique within the workflow definition.

    stepTypestringrequired

    Type of the step.

    Possible values: [Branch]

    Default value: Branch
    selectNextStepobjectrequired

    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.

    Default value: null
    idstringrequired

    Step id. Step id must be unique within the workflow definition.

    stepTypestringrequired

    Type of the step.

    Possible values: [Wait]

    Default value: Wait

    inputs objectrequired

    Input properties supported by wait step.

    durationstringrequired

    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.

    nextStepIdstring

    Step id of the step to be executed after the current step. If not set, workflow terminates after executing the current step.

    idstringrequired

    Step id. Step id must be unique within the workflow definition.

    stepTypestringrequired

    Type of the step.

    Possible values: [WaitForReply]

    Default value: WaitForReply

    inputs objectrequired

    Input properties supported by wait for reply step.

    fromstringrequired

    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.

    channelstringrequired

    Messaging channel like sms, whatsapp, etc. For a complete list, refer to channel type values.

    timeoutstring

    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.

    Default value: 1.00:00:00

    outputs objectrequired

    Outputs supported by wait for reply step.

    replyobjectrequired

    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.

    selectNextStepobject

    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.

    Example: {"reply_received":"{{data.reply != null}}","no_reply_received":"{{data.reply == null}}"}
    nextStepIdstring

    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.

    idstringrequired

    Step id. Step id must be unique within the workflow definition.

    stepTypestringrequired

    Type of the step.

    Possible values: [VoiceMessage]

    Default value: VoiceMessage

    inputs objectrequired

    Input properties supported by the voice message step.

    subAccountIdstring

    Voice enabled subaccount id.

    clientRequestIdstring

    Unique identifier to reference the voice the message. JavaScript helper function uuid() can be used to generate a uuid.

    actionstringrequired

    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]

    Default value: say
    paramsobjectrequired

    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.

    responseobjectrequired

    HTTP response message received from the voice messaging API. Refer to voice messaging API documentation for more information.

    nextStepIdstring

    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.

    idstringrequired

    Step id. Step id must be unique within the workflow definition.

    stepTypestringrequired

    Type of the step.

    Possible values: [WaitForDTMF]

    Default value: WaitForDTMF

    inputs objectrequired

    Input properties supported by the wait for DTMF step.

    dtmfRequestIdstring

    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.

    timeoutstring

    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.

    Default value: 1.00:00:00

    outputs objectrequired

    Output properties supported by the wait for DTMF step.

    dtmfDataobjectrequired

    DTMF response data returned by the voice messaging API. Refer to voice messaging API documentation for more information.

    Example: {"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"}}
    selectNextStepobject

    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.

    Example: {"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'}}"}
  • ]
  • accountIdstringrequired

    8x8 account id.

    idstringrequired

    Unique definition id.

    versionintegerrequired

    Version of the definition. When a definition is updated, version number is automatically incremented.

    Possible values: >= 1

    createdAtstringrequired

    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":2,
"steps":[
{
"id":"step1",
"stepType":"ChatAppsMessage",
"inputs":{
"subAccountId":"8x8_subaccount_id",
"user":{
"msisdn":"{{data.payload.user.msisdn}}"
},
"type":"text",
"content":{
"text":"Updated hello, world!"
}
}
}
]
}
},
{
"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":"ChatAppsMessage",
"inputs":{
"subAccountId":"8x8_subaccount_id",
"user":{
"msisdn":"{{data.payload.user.msisdn}}"
},
"type":"text",
"content":{
"text":"Hello, world!"
}
}
}
]
}
}
]

Definition id is invalid (not a valid uuid).

Schema

    codeintegerrequired

    Error code.

    messagestringrequired

    Description of the error.

    errorIdstringrequired

    Unique error id.

    timestampstringrequired

    Timestamp when the error occurred.

{
"code":0,
"message":"string",
"errorId":"string",
"timestamp":"string"
}
{
"code":1000,
"message":"Invalid definition id.",
"errorId":"2558ff83-c8db-4890-805e-ad64001857a1",
"timestamp":"2021-07-13T01:28:37.66Z"
}

Source: https://developer.8x8.com/connect/reference/get-specific-definition · 8x8 CPaaS Developer Docs. Synced for support deflection.

Was this article helpful?
or
0 out of 0 found this helpful

0 Comments

Please sign in to leave a comment.

Didn't find what you were looking for?

Submit a request