WhatsApp Broadcast

Component Explanation :

Field Name

Description

Required

Authorization

Generated token id

Yes

name

Name of your broadcast

Yes

channel

Channel id of your used channel

Yes

sendingMode

The sending method you will use. Currently there are 2 sending mode, i.e : send immediately (now) and scheduled send (scheduled)

possible value: Now, Scheduled

Yes

scheduledDate

The date and time scheduled for sending broadcast

Field format: "yyyy-mm-dd hh:mm:sss"

Yes, when sending mode is 'Scheduled'

templateId

Id of the template that you want to use for your broadcast

wa-template-id must defined first in 3Dolphins UI

Yes

recipient

your recipient id

acquired from creating recipient with Recipient endpoint

Yes

headerVariables

Variable object of your header

Yes, only when WhatsApp template being used has macro in Header

bodyVariables

Variable object of your body

Yes, only when WhatsApp template being used has macro in Body

content

the contents of your broadcast message.

Note : For WhatsApp broadcast you can only attach one media on a single broadcast

Yes

botId

your bot id when the dialog trigger is used.

No

dialogId

your dialog id that will be used as trigger dialog.

No

whatsappRecipient

your phone number's recipients.

Yes

You don't need to use whatsappRecipient field if you already use recipient field. This also applies in a reverse way.

Create Recipients

Method
POST

Media Type

application/json

URL

https://[server]/dolphin/apiv1/graph/broadcast/upload/recipient

Header

Authorization : Bearer [generatedToken]

Body Create Recipients

To create recipients, you must upload your recipient number with format xlsx. You must fill the recipients data and save it with format xlsx, like image below.

You can choose form-data format on Body and fill the key with 'uploadFile', change the type with file then you can click select files button to select recipient document on your device. Click Send button to upload file.

You can choose form-data format on Body and fill the key with 'uploadFile', change the type with file then you can click select files button to select recipient document on your device. Click Send button to upload file.

Response

Response status: 200

Response status: 200

{
  "recipient_id": "[recipient id]" *generated automatically by system
}

Verify Phone Number

Method

POST

Media Type

application/json

URL

https://[server]/dolphin/apiv1/graph/broadcast/verify/{your-channel-id}

Header

Authorization : Bearer [generatedToken]

Body

["{phone-number-1}", "{phone-number-2}" , .... ]

Note: Phone number must filled with format '62' (country code) or '0',

Can't filled with '+'

Response:

Response status: 200

Response status: 200

{
  "status": "success",
  "data": [
    {
      "input": "phone-number-1",
      "status": "valid"
    },
    {
      "input": "phone-number-2",
      "status": "invalid"
    }
  ],
  "hasMore": false,
  "nextIndex": 0,
  "prevIndex": 0,
  "totalResults": 0
}

Send Broadcast Text

Method

POST

Media Type

application/json

URL

https://[server]/dolphin/apiv1/graph/broadcast

Header

Authorization: Bearer [generatedToken]

Body:

Body:

{
    "name":"your-broadcast-name",
    "channel":"channel-used-for-broadcast",
    "sendingMode":"sending-mode",
    "scheduledDate":"2021-01-01 23:30:334",
    "templateId" : "wa-template-id", 
    "recipient": "recipient-id",  
    "content" : [
        
    ]
}

Response: 200

Response:

Response status: 200

{
  "status": "success",
  "data": {
    "id": "[broadcast-id]"
  },
  "message": "Successfully make Broadcast Item",
  "hasMore": false,
  "nextIndex": 0,
  "prevIndex": 0,
  "totalResults": 0
}

Example Send Broadcast Text

Below is a representation when using the WhatsApp broadcast API for sending a broadcast text on the 3Dolphins application.

When you enter the channel field using the channel id in the API, it will be like selecting an account on the application and the templateId field like selecting the notification template. The name field will also be the title for your notification. SendingMode field is like specifying the sending option to be used (if you use 'schedule', you can choose when the notification will be sent).

Send Broadcast Image

Example Send Broadcast Text

Body:

Below is a representation when using the WhatsApp broadcast API for sending a broadcast text on the 3Dolphins application.

When you enter the channel field using the channel id in the API, it will be like selecting an account on the application and the templateId field like selecting the notification template. The name field will also be the title for your notification. SendingMode field is like specifying the sending option to be used (if you use 'schedule', you can choose when the notification will be sent).

Send Broadcast Image

Method

POST

Media Type

application/json

URL

https://[server]/dolphin/apiv1/graph/broadcast

Header

Authorization: Bearer [generatedToken]

Body:

{
    "name":"your-broadcast-name",
    "channel":"channel-used-for-broadcast",
    "sendingMode":"sending-mode",
    "scheduledDate":"2021-01-01 23:30:334",
    "templateId" : "wa-template-id", 
    "recipient": "recipient-id",  
    "content" : [
       {     
            "type": "image",
            "url": "your-url-for-image", | url https, format jpg/png
        }
    ]
}

Response: 200

Response:

Response status: 200

{
  "status": "success",
  "data": {
    "id": "[broadcast-id]"
  },
  "message": "Successfully make Broadcast Item",
  "hasMore": false,
  "nextIndex": 0,
  "prevIndex": 0,
  "totalResults": 0
}

Example Send Broadcast Image

Below is a representation when using the WhatsApp broadcast API for sending a broadcast image on the 3Dolphins application.

When you enter the channel field using the channel id in the API, it will be like selecting an account on the application and the templateId field like selecting the notification template (when using images notification template, you must fill in the 'type' field with 'image' and your image url with https format and image extension type). The name field will also be the title for your notification. SendingMode field is like specifying the sending option to be used (if you use 'schedule', you can choose when the notification will be sent).

Send Broadcast Video

Example Send Broadcast Image

Body:

Below is a representation when using the WhatsApp broadcast API for sending a broadcast image on the 3Dolphins application.

When you enter the channel field using the channel id in the API, it will be like selecting an account on the application and the templateId field like selecting the notification template (when using images notification template, you must fill in the 'type' field with 'image' and your image url with https format and image extension type). The name field will also be the title for your notification. SendingMode field is like specifying the sending option to be used (if you use 'schedule', you can choose when the notification will be sent).

Send Broadcast Video

Method

POST

Media Type

application/json

URL

https://[server]/dolphin/apiv1/graph/broadcast

Header

Authorization: Bearer [generatedToken]

Body:

{
    "name":"your-broadcast-name",
    "channel":"channel-used-for-broadcast",
    "sendingMode":"sending-mode",
    "scheduledDate":"2021-01-01 23:30:334",
    "templateId" : "wa-template-id", 
    "recipient": "recipient-id",  
    "content" : [
        {
            "type": "video",
            "url": "your-url-for-video", | url https, format mp4
            "thumbnailUrl" : "your-url-for-thumbnail"
        }
    ]
}

Response: 200

Response:

Response status: 200

{
  "status": "success",
  "data": {
    "id": "[broadcast-id]"
  },
  "message": "Successfully make Broadcast Item",
  "hasMore": false,
  "nextIndex": 0,
  "prevIndex": 0,
  "totalResults": 0
}

Example Send Broadcast Video

Below is a representation when using the WhatsApp broadcast API for sending a broadcast video on the 3Dolphins application.

When you enter the channel field using the channel id in the API, it will be like selecting an account on the application, as well as the templateId field like selecting the notification template (when using video notification template, you must fill in the 'type' field with 'video' and your video url with https format and video extension type). The name field will also be the title for your notification. SendingMode field is like specifying the sending option to be used (if you use 'schedule', you can choose when the notification will be sent).

Send Broadcast Document

Example Send Broadcast Video

Body:

Below is a representation when using the WhatsApp broadcast API for sending a broadcast video on the 3Dolphins application.

When you enter the channel field using the channel id in the API, it will be like selecting an account on the application and the templateId field like selecting the notification template (when using video notification template, you must fill in the 'type' field with 'video' and your video url with https format and video extension type). The name field will also be the title for your notification. SendingMode field is like specifying the sending option to be used (if you use 'schedule', you can choose when the notification will be sent).

Send Broadcast Document

Method
POST

Media Type

application/json

URL

https://[server]/dolphin/apiv1/graph/broadcast

Header

Authorization : Bearer [generatedToken]

Body:

{
    "name":"your-broadcast-name",
    "channel":"channel-used-for-broadcast",
    "sendingMode":"sending-mode",
    "scheduledDate":"2021-01-01 23:30:334",
    "templateId" : "wa-template-id", 
    "recipient": "recipient-id",  
    "content" : [
        {
            "type": "document",
            "url": "your-url-for-document", | url https, format pdf
        }
    ]
}

Response:

Response status: 200

Response status: 200

{
  "status": "success",
  "data": {
    "id": "[broadcast-id]"
  },
  "message": "Successfully make Broadcast Item",
  "hasMore": false,
  "nextIndex": 0,
  "prevIndex": 0,
  "totalResults": 0
}

Example Send Broadcast Document

Below is a representation when using the WhatsApp broadcast API for sending a broadcast document on the 3Dolphins application.

When you enter the channel field using the channel id in the API, it will be like selecting an account on the application and the templateId field like selecting the notification template (when using document notification template, you must fill in the 'type' field with 'document' and your document url with https format and document extension type). The name field will also be the title for your notification. SendingMode field is like specifying the sending option to be used (if you use 'schedule', you can choose when the notification will be sent).

Send Broadcast Quick Reply

Example Send Broadcast Document

Body:

Below is a representation when using the WhatsApp broadcast API for sending a broadcast document on the 3Dolphins application.

When you enter the channel field using the channel id in the API, it will be like selecting an account on the application snd the templateId field like selecting the notification template (when using document notification template, you must fill in the 'type' field with 'document' and your document url with https format and document extension type). The name field will also be the title for your notification. SendingMode field is like specifying the sending option to be used (if you use 'schedule', you can choose when the notification will be sent).

Send Broadcast Quick Reply

Method
POST

Media Type

application/json

URL

https://[server]/dolphin/apiv1/graph/broadcast

Header

Authorization : Bearer [generatedToken]

Body:

{
    "name":"your-broadcast-name",
    "channel":"channel-used-for-broadcast",
    "sendingMode":"sending-mode",
    "scheduledDate":"2021-01-01 23:30:334",
    "templateId" : "wa-template-id", 
    "recipient": "recipient-id",