Providers and webhooks designer

Within the Workflow Designer, we can find the activities that allow creating providers and webhooks for uContact.

The provider and webhooks flows have some of the activities detailed in the bots, plus a couple of exclusive extra activities for their development, these will be explained in each use case.


When starting the Workflow Designer, we can see the Start activities.

These are the start activity of any flow, dragging one to the work board defines what type of flow it will be.

Types of start activity:

  1. Start Activity — For telephony flows.

  2. Bot Start Activity — For bot flows.

  3. BotFunction Start Activity — To create bots extensions.

  4. Webhook Start Activity — To receive information from a third party.

  5. ChannelProvider Start Activity — To send information from a third party.

     

Once the desired start activity is placed, the activities related to its channel and necessary for the creation of the flow will be displayed.

 

 

 


ChannelProvider Start Activity

Settings field

  • name
    It will be the name of the provider, it will appear in the SMS/WhatsApp campaigns and in the dialers of the same channel.

Available variables

  • AGENT
    Name of the agent if there is an interaction.

  • MESSAGE
    Message.

  • TO
    Recipient number.

  • ATTACHMENTS
    Array of objects, each containing an attachment.

    [ { "extension":"png", "path":"20210226/8b5eb91a-2799-4c30-a712-9cfbbd333f49.1584030188436.png", "url":"https://example.ucontactcloud.com/attachments/20210226/8b5eb91a-2799-4c30-a712-9cfbbd333f49.1584030188436.png", "type":"image/png" } ]
  • CAMPAIGN
    Interaction campaign.

  • GUID
    Interactions' GUID.

  • SMS_GUID
    SMS unique GUID.

MessageResult

To inform the system that the SMS was sent correctly or with error, the MessageResult application must be used, it requires two parameters:

  • result
    Result of the delivery (can be any value).

  • id
    Unique message ID if applicable (this ID is normally returned to the provider's API call).


Webhook Start Activity

Settings field

  • name
    It is the name of the webhook that, at the same time, will correspond to the POST path to be able to execute the flow.

POST https://instance.ucontactcloud.com/IntegraChannels/resources/webhook/{name}

Available variables

BODY

  • type: Obj

  • example:

{ "name": "Daniel" }

HEADERS

  • type: Obj

  • example:

{ "Accept"🙁 "/" ], "Cache-Control"🙁 "no-cache" ], "Connection"🙁 "close" ], "User-Agent"🙁 "PostmanRuntime/7.26.8" ] }

ReceiveNewMessage

The webhook can be used to run many applications, from executing a query, a call to a webservice, to injecting an incoming SMS/WhatsApp into the system.

  • message
    Message, if appropriate

  • attachment
    Attachment URL

  • from
    The number that sends the message.

  • did
    The number the message is sent to. It has to match the did of the campaign.

  • id
    Unique ID of the message.

MessageStatus

This activity allows you to update the status of WhatsApp messages, two parameters must be sent:

  • id
    Unique ID of the message (it is the same ID as in MessageResult).

  • status
    The statuses that can be updated are: sent, delivered, read, error, invalid_session y invalid_number.

Log de flows

Log4j2 is used as a library for the flow log, and the file where you can see everything related to bots is found in var/log / IntegraFlows.log

This file not only logs the errors but, similarly to what is done in it, it logs all the activities that are being traversed as the flow is traversed.

The format in which the information is written in IntegraFlows.log is as follows:

YYYY-MM-DD HH: mm: ss — [Thread number] — [Flow name — flow guide] [Activity step number]

First, the execution of the activity will be logged and then the parameters of the activity that was executed will be logged.

When the flow ends, the FINISH message shows.

Example:


Logger

Once a flow with bots, channel providers, or webhooks is loaded in Workflow Designer, the Logger option will be displayed, which allows you to see the log of all the executions of the flow that is loading.

By default, the logger is deactivated, to activate it you have to press the switch in the upper left corner.

It also has the possibility to filter the messages in the workflow console according to the level of error. The available levels are Info, Warning, and Severe.

 

Logger example: