v1

latestOpenAPI 3.1.02026-07-2414238909.1 KB

Send a Viber Campaign

Send viber messages to multiple recipients. This is a paid service.

post/viber/campaign

Headers

Authorizationstring required

Bearer {access_token}

Content-Typestring required

application/json

Request body

senderInfoTrackingIdstring required

The unique sender id. You can find it at Routee Platform-applications page.

tostring[]

The phone numbers (array) the message is about to be sent to. Format with a '+' and country code e.g., +306948530920 (E.164 format). Max length: 1000. One of "groups", "to", "contacts" parameters are required.

contactsstring[]

The contact ids that the message will be sent to. Max length: 1000. One of "groups", "to", "contacts" parameters are required.

groupsstring[]

The groups of contacts in the account selected as recipients. Groups have to be created at the system. Max length: 1000. One of "groups", "to", "contacts" parameters are required.

campaignNamestring

The name of the viber campaign. If you want to be able to track the whole campaign from Routee web platform use a name. Must be between 2 and 30 characters and contain only latin letters, numbers, spaces and -

isSessionMessageboolean

Indicates a Viber Campaign is initiated to be a Viber Session. The session rate is applied ONLY after recipient response. Billed per session not per each delivered message. Supported session types are: Text-Only, Image and File. Default value false. Learn more about it at our documention

scheduledDatestring date

Defines the scheduled date and time in UTC. (eg YYYY-MM-DDThh:mm:ssTZD where TZD is the time zone designator (Z or +hh:mm or -hh:mm))

ttlinteger

Time range until message expires. TTL range in seconds: 30 - 86400 seconds. If it is not set, the default range is 14 days. TTL range in seconds for web clients: 300 - 86400 seconds.

callbackUrlstring

Defines the callback URL that will receive all the individual messages' progress of the Viber campaign. Check here for details.

inboundUrlstring

Defines the callback URL that will receive the inbound messages. Check here for details.

labelstring

A generic label which can be used for tagging the Viber message. Maximum length is 350 characters.

Response

200

trackingIdstring
typestring
statestring
createdAtstring
respectQuietHoursboolean
scheduledDatestring
senderInfoTrackingIdstring
senderInfoNamestring
tostring[]
groupsstring[]
campaignNamestring
ttlinteger
costinteger
totalMessagesinteger
inboundUrlstring
callbackUrlstring
isSessionMessageboolean
labelstring

Example response

{
  "trackingId": "x1xx0x00-xxx1-0x1x-x111-0111100xxx00",
  "type": "Viber",
  "state": "Scheduled",
  "createdAt": "2022-01-17T14:34:13.47Z",
  "scheduledDate": "2022-08-11T12:36:45.393Z",
  "senderInfoTrackingId": "x1xx0x00-xxx1-0x1x-x111-0111100xxx00",
  "senderInfoName": "viber",
  "to": [
    "+37xxxxxxxxxx"
  ],
  "groups": [
    "Group name"
  ],
  "campaignName": "Campaign1243",
  "body": {
    "text": "This is a test, please ignore!",
    "imageURL": "https://www.xxxxxxxxx.com/css/xxxxx.jpg",
    "action": {
      "caption": "Go",
      "targetUrl": "https://www.routee.net/"
    }
  },
  "ttl": 30,
  "totalMessages": 2,
  "viberAnalysis": {
    "numberOfRecipients": 2,
    "recipientsPerCountry": {
      "XX": 1
    },
    "recipientCountries": {
      "+37xxxxxxxxxx": "XX"
    },
    "recipientsPerGroup": {
      "Group name": 1
    },
    "totalInGroups": 1,
    "bodyAnalysis": {
      "characters": 30
    }
  },
  "inboundUrl": "http://www.yourserver.com/inbound-messages",
  "callbackUrl": "http://www.yourserver.com/callback",
  "label": "Test"
}