Xenioo Official Docs
  • Welcome!
  • Product Overview
    • Definitions
    • Building & Sending
    • All Integrations
    • Mobile App
    • Artificial Intelligence
    • Reporting Dashboard
    • Professional Service & Support
    • Privacy & Security
    • GDPR
  • Basic Concepts
    • Your Account
      • The Trial plan
      • Upgrading your trial
      • Additional Packages
      • Canceling your current plan
      • Deleting your account
      • Messages Count
      • Data Retention
      • Multi-factor Authentication (MFA)
        • MFA Configuration
        • MFA Login
      • Multiple Owners
    • Designing your Chatbot
      • My Bots
      • Introduction
      • Flow Design
      • Behaviors
      • Interactions
      • Actions and Operations
    • Chatbot Details
      • Chatbot Settings
        • General Settings
        • Localization Settings
        • Conversation Settings
        • Integration Settings
        • Payment Integration Settings
        • Developers Setting
      • Teams
        • Team Permissions
        • Team Message Templates
        • Availability Calendars
        • Takeover Default Message
        • Team Member Access
      • Backup & Restore
      • Master and Child Bot
    • Publishing
      • Live & Draft Chatbots
      • Publish Your Bot
      • Channels
        • Web
          • Web Variables
          • WordPress
          • Widget Customization
            • Initialization
            • Scripting
        • WhatsApp
          • WhatsApp Variables
          • First Message Processing
          • Opt-in QR code generation
        • RCS
          • RCS Variables
          • Configuring Providers
            • LINK Mobility
          • Opt-in QR code generation
        • Google Business Messages (Deprecated)
          • Google Business Messages Variables
        • SMS
          • SMS Variables
          • Configuring Providers
            • LINK Mobility
        • Facebook
          • Facebook Ads Integration
          • Feed Integration
          • Messenger Referral
          • Facebook Variables
          • Moving users from an existing bot to Xenioo
        • Instagram
          • Instagram Variables
        • Telegram
          • Telegram Deep Linking
          • Telegram Variables
        • Slack
          • Configuring Slack
          • Slack Variables
        • Microsoft Teams
          • Microsoft Teams Variables
        • Discord
          • Discord Variables
        • Alexa
          • Troubleshooting
          • Alexa Variables
        • Phone
          • Phone Variables
          • Configuring Providers
            • Voximplant
        • Genesys
          • Genesys Variables
        • Viber
          • Viber Variables
        • Custom
          • REST Reference Guide
          • API Variables
  • Artificial Intelligence
    • NLP
      • Intents
      • Expressions
      • Entities
        • Creating Manually
        • Entity Types
        • Synonims
      • Training & Testing your Model
        • Using the NLP Parse Logs
        • Importing Intents From File
      • NLP Master
    • Large Language Models
      • Settings
      • Guidelines
      • Resources
      • Functions
      • Train & Test
  • Database
    • Xenioo Database
    • Collections
      • Import And Export Collections Data
    • Database API Interface
      • Url Filtering Syntax
      • Read Record
      • Save To Collection
      • Delete From Collection
      • Query Collection
        • Open Query
        • Read Records
      • CSV Direct Data
  • Broadcasts
    • Broadcasts
      • Settings
        • On Demand
          • HubSpot
        • On Date And Time
        • On Time
        • On Trigger
        • On Interval
        • On Conversation State Changed
    • Broadcast Widget Page
    • Campaigns
    • Distribution Lists
    • Audiences
    • Distribution Logs
  • Conversations
    • Conversations
    • My Conversations
    • Contacts
    • Chat Commands
    • Contact Details
  • Analytics
    • Dashboards
    • Goals
    • Audit Logs
    • Widgets
      • List of Widgets
  • Actions And Operations
    • Execution
      • Execution Diagram
    • Actions Availability
    • Variables and Tags
    • Dynamic Parsing And Content
    • Content
      • Text Action
      • Random Text Action
      • Quick Reply Action
      • Database Quick Reply Buttons Action
      • Quick Reply Array Action
      • Chat Delay Action
      • Phone Quick Reply Action
      • Email Quick Reply Action
      • Location Quick Reply Action
      • Display Location
      • Image Action
      • QR Code Action
      • Video Action
      • Audio Action
      • File Action
      • Url Action
      • NLP Topics Summary Action
      • Highly Structured Message
      • Custom Class
      • Comment Action
    • Input
      • Voice Recognition Action
      • Global Detection
        • Text Parse Action
        • NLP Processing Action
        • Dialogflow Detection Action
        • IBM Watson Assistant Intent Detection Action
        • OpenAI Assistant Detection
        • AI Detection
      • Generic Input Action
      • NLP Input Action
      • Number Input Action
      • Email Input Action
      • Phone Number Action
      • Media Attachment Action
      • Voice Input Action
      • Global Detection Action
      • OpenAI
        • OpenAI Assistant Input
        • OpenAI Assistant Detection
      • Dialogflow
        • Dialogflow Input Action
        • Dialogflow Detection Action
      • IBM Watson Assistant
        • IBM Watson Assistant Input Action
        • IBM Watson Assistant Detection Action
      • Large Language Models
        • AI Detection
        • AI Input
    • Flow
      • Agent State Check
      • Calendar Check
      • Channel Check
      • Conversation Bookmark Action
      • Create Conversation URL Action
      • Flow Control Action
      • Go To Action
      • Goal
      • Include Interaction Action
      • Log Message
      • Random Split Action
      • Reset Conversation Action
      • Set Chat Operator State Action
      • Schedule Behaviour Action
      • Tag Switch Action
      • Variable Switch Action
      • Set Context Action
      • Control Conversation Transfer Action
        • Forward Variable Value Action
    • Forms
      • Form Container
      • Fields
        • Text Box
        • Password
        • Text Area
        • Dropdown
        • Checkbox
        • Number
        • Date Picker
        • Time Picker
        • Calendar
        • File Upload
      • Layout
        • Image
        • Literal
        • Divider
        • Html Content
        • Custom CSS
    • Database
      • Load Single Record
      • Delete Records
      • Save Record
      • Save Raw Model
      • Query Collection Data
      • Move To Next Record
      • Set Field Filter Value
      • Order By Field
      • Set Field Value
      • Database Function
    • Cards
      • Carousel Template Action
      • List Card Template Action
      • Buttons Card Template Action
      • Card Container Action
      • Interactive Message Action
      • One-Time Notification Request Action
      • Database Carousel Action
      • Dynamic Carousel Action
      • Card And Menu Buttons
        • Postback Button Action
        • URL Button Action
        • Call Phone Button
        • Share Button Action
        • Nested Button Action
        • Interactive Button
    • Profile
      • Set Variable Action
      • Delete Variable Action
      • Set Tag Action
      • Delete Tag Action
      • Set Campaign Subscription Action
    • Privacy
      • Forget User
      • Privacy Opt-In
      • Privacy Flag Condition
    • IoT
      • Control Device State
      • Device State Switch
    • Integration
      • Call API Service Action
      • Execute Cloud Script Action
        • Base Conversation object methods
        • Firebase Connection methods
        • Xenioo Database Collection Methods
      • Execute Client Script Action
      • Send SMS Message
      • LINK Mobility Payment API Action
      • Marketing Platform Action
      • Dynamic Content Action
      • Post To Facebook Action
      • Firebase Database Action
      • ActiveCampaign Action
      • Zapier Webhook Action
      • Microsoft Teams Webhook Action
      • MailChimp Contact Action
      • Marketing Platform Action
      • Wordpress Search Action
      • RSS & Podcast Feed Action
      • SendGrid Mail Action
      • Send Mail Action
      • Send Custom Mail Action
  • Xenioo API
    • Choosing your API
    • Global Platform API
      • Authorization
      • Platform SSO
      • Bots
        • List
        • Publishing
          • Publish
          • Get Channel Settings
          • Set Channel Settings
        • Variables
        • Cloning and Referencing
          • Clone
          • Reference Clone
          • Attach Child
          • Detach Child
        • Backup And Restore
          • Backup
          • Restore
          • Restore With Overwrite
      • Teams
        • Members
          • List
          • Add Or Update
          • Delete
        • Profiles
          • List
          • Add Or Update
          • Delete
      • Conversations
        • Audiences
        • Audience Contacts
        • Entries
        • Share Url
      • NLP Query
      • Large Language Models
        • Settings
        • Guidelines
        • Add Resource
        • Delete Resource
        • Add Function
        • Delete Function
        • Train
        • Train State Check
        • Test
      • Statistics
        • Account Statistics Data
        • Bot Statistics Data
        • Report Files
        • Download Report File
      • Broadcasts
        • Broadcasts List
        • Broadcast State
  • Changelog
Powered by GitBook
On this page
  • Broadcast Specific Settings
  • Launch Web Hook
  • Calling the Web Hook
  • Audience and Values
  • The set_conversation parameter
  • Multiple Users Creation and Targeting
  • Delaying Delivery

Was this helpful?

  1. Broadcasts
  2. Broadcasts
  3. Settings

On Demand

PreviousSettingsNextHubSpot

Last updated 1 year ago

Was this helpful?

On Demand broadcasts are never sent automatically by Xenioo but can only be triggered by calling a very specific Launch Web Hook that will be dynamically generated for you. Invoked On Demand broadcasts are sent by Xenioo as soon as possible to all targeted users. The order of targets in each call is not guaranteed to be respected: if you need to send multiple broadcasts to the same user, .

Broadcast Specific Settings

The following additional settings will be available when configuring this type of broadcast.

  • Enable Direct Mode Enable or Disable direct mode for the web hook. If enabled, the broadcast web hook can be called directly while if disabled, the web hook will require a to be supplied for each call.

  • Allow GET API verb Enable or disable calling the broadcast hook using a simple GET of the URL.

  • Allow POST API verb Enable or disable calling the broadcast hook using a POST call to the URL.

  • Require a Valid Filter in POST Payload If enabled, Xenioo will validate the incoming payload to make sure that the sent data is building a valid filter. If disabled, any json sent to the endpoint will be accepted and forwarded to the flow. Disabling this basically let you forward arbitrary payload that can be parsed by a to a selected flow audience.

  • Enforce execution on a single contact regardless of filter When enabled, this flag will force the broadcast to always target a single conversation, regardless of the number of targets that are contained in the or in the audience.

  • Disable direct execution UI Button This setting will disable, or enable the execution button that appears beside each broadcast entry in the .

  • Visible to Mobile Operators If enabled, this broadcast will be available to all users accessing the bot from the Xenioo mobile application.

Launch Web Hook

This field contains the hook URL that Xenioo will generate for you. Use this hook in your integration systems to invoke this broadcast.

Calling the Web Hook

The web hook supplied by Xenioo can be called using either GET or POST standard http methods. In order to authenticate your request, a complete must be created first.

When using POST, you have two ways of invoking the web hook using two different payloads: approach lets you specify a dynamic audience and a set of value that will target one or more contacts using multiple filters while the mass users payload will let you users at once by specifying their unique id.

Xenioo 2.0 has added to On Demand invocation a full authorization header requirement. If you're integrating a service supporting only the previous version of Xenioo please make sure to activate the "Enable Legacy Mode" flag.

POST payload size cannot exceed 1MB total. Please take this into consideration when pushing to multiple simultaneous targets.

Audience and Values

Invoking the web hook using POST you can supply a number of parameters that can override the configured Audience or automatically set one or more variables for all targeted users. You can find an example of the full JSON payload below:

{
    "audience_filters":"favorite_color",
    "audience_criteria":"Equals",
    "audience_values":"red",
    "set_variables":"new_favorite_color",
    "set_variables_values":"magenta"
}

The above JSON, when posted to the Launch Web Hook will filter users to target only those with favorite_color equal to red and will create on all those users the variable new_favorite_color equal to magenta.

Using multiple values and variables is possible by just concatenating each entry with a semicolon (;). In the following example, we are using two filters and setting multiple variables:

{
    "audience_filters":"favorite_color;user_id",
    "audience_criteria":"Equals;Equals",
    "audience_values":"red;3030391",
    "set_variables":"new_favorite_color;someother_var",
    "set_variables_values":"magenta;the_other_var_value"
}

In the example above, the target broadcast audience will be overridden by the dynamic parameters supplied: only the user with id equal to 3030391 and favorite_color equal to red will be targeted by the broadcast.

The JSON fields you may configure are:

Field

Description

audience_filters

A list of filter fields as a single, comma separated string that will be dynamically used ad audience filter.

audience_criteria

The criteria to be used in the filters. Check table below for full reference.

audience_values

The list of values for each of the field reference.

audience_join

The list of logical operators that join the different filters. Can be either AND or OR. By default, or operators are AND.

set_variables

The list of variables to be set automatically for each targeted user.

set_variables_values

The values supplied for each variable.

When specifying the criteria field, you can use the following values:

Operator

Equals

Different

GreaterThan

LesserThan

Cointains

DoesNotContain

StartsWith

DoesNotStartWith

HasValue

EmptyOrUnset

IsLongerThan

IsShorterThan

The hook will return different http error codes depending on the call result:

Value

200 OK

The call has been successful and the broadcast has been scheduled.

400 Bad Request

The call contains invalid data that cannot be correctly parsed. This may happen if the payload is invalid or some of the mandatory fields are incomplete.

404 Not Found

The specified broadcast has not been found or the broadcast is not enabled.

The set_conversation parameter

When invoking the OnDemand webhook using POST an additional boolean parameter named set_conversation can be specified. This parameter will ignore the audience filters and attempt to create a brand new conversation using the values supplied inside the set_variables and set_variables_values parameters.

Le't look at the following example:

{
    "set_variables":"bot_channel;user_phone_number",
    "set_variables_values":"WhatsAppChannel;34655555555",
    "set_conversation":true
}

Using the data above, Xenioo will execute the OnDemand broadcast trying to:

  • Search for an existing conversation for the targeted chatbot that has the specified user_id. If user_id is not supplied, it will try to use the user_phone_number;

  • If the conversation is found, it will target the found conversation for the broadcast and leave execution;

  • If the conversation is not found, it will create new conversation using the supplied variables and target it with the current broadcast.

Keep in mind that not all channels allow unattended or unsolicited messaging from unknown contacts and while the conversation can be created, the message delivery may still fail.

To create a brand new conversation at least bot_channel and user_phone_number (or user_id) must be supplied. If these parameters are missing the conversation won't be created.

If the targeted broadcast is called without the specified parameter, the specified Audience will be used instead for distribution.

Multiple Users Creation and Targeting

If you need to target multiple potentially new users with the very same broadcast you can use the targets payload mode when invoking the broadcast using POST.

The expected targets payload could look similar to the following example:

{
    "targets":[
        {
            "user_id":"221123030303",
            "bot_channel":"WhatsApp",
            "some_variable":"test"
        },
        {
            "user_id":"342342342311",
            "bot_channel":"WhatsApp",
            "other_variable":"some other test value"
        }
    ]
}

In the above example, the on demand broadcast will be sent to two different users. If the users do not exist, they will be created. Variables set in the payload do not need to be homogeneous: different contacts can have different variables. To create a new contact at least the user id and bot channel variables must be specified.

On WhatsApp, SMS and RCS, the user id of the contact is equal the user phone number variable. To create a new contact on these channels either user id or user phone number can be specified.

Delaying Delivery

You can enforce a delay in the broadcast delivery by specifying the delayminutes field in the payload.

{
    "targets":[
        {
            "user_id":"221123030303",
            "bot_channel":"WhatsApp",
            "some_variable":"...and 5 minutes later..."
        }
    ],
    "delayminutes":5
}

The delay will affect the full execution of the broadcast, for all the specified targets.

The set_conversation parameter format is being deprecated and still exist solely for legacy support. Please do not use this kind of integration on V2 bots and always prefer the format.

Multiple Users Creation and Targeting
bot api token
script
broadcasts view
use a small delay
payload
the audience and values
target multiple
Bot Level Authorization Token