# WhatsApp Broadcast

### Definisi Komponen

| Nama Field        | Deskripsi                                                                                                                                                                                                     | Required                                                                               |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| Authorization     | Token id yang tergenerate                                                                                                                                                                                     | Ya                                                                                     |
| name              | Nama dari broadcast Anda                                                                                                                                                                                      | Ya                                                                                     |
| channel           | Channel id dari channel yang Anda gunakan                                                                                                                                                                     | Ya                                                                                     |
| sendingMode       | <p>Metode pengiriman yang akan Anda gunakan. Saat ini ada 2 mode pengiriman, yaitu : pengiriman langsung (now) dan pengiriman terjadwal (scheduled).</p><p></p><p>Possible value: <em>Now, Scheduled</em></p> | Ya                                                                                     |
| scheduledDate     | <p>Tanggal dan waktu yang dijadwalkan untuk mengirim broadcast</p><p></p><p>Format field: "yyyy-mm-dd hh:mm:sss"</p>                                                                                          | Ya, saat mode pengiriman adalah *'Scheduled'*                                          |
| templateId        | <p>Id template yang ingin Anda gunakan untuk broadcast Anda.</p><p></p><p>wa-template-id harus ditentukan terlebih dahulu pada 3Dolphins UI</p>                                                               | <p>Ya</p><p></p>                                                                       |
| recipient         | <p>recipient id Anda</p><p></p><p>diperoleh dari membuat recipient dengan Recipient endpoint</p>                                                                                                              | Ya                                                                                     |
| headerVariables   | Objek variable dari header Anda                                                                                                                                                                               | <p>Ya, </p><p>hanya jika template WhatsApp yang digunakan memiliki makro di Header</p> |
| bodyVariables     | Objek variable dari body Anda                                                                                                                                                                                 | Ya, hanya jika template WhatsApp yang digunakan memiliki makro di Body                 |
| content           | <p>Konten dari pesan broadcast Anda.</p><p></p><p>Catatan : Untuk broadcast WhatsApp Anda hanya dapat melampirkan satu media pada satu broadcast.</p>                                                         | Ya                                                                                     |
| botId             | Id bot ketika trigger dialog akan digunakan.                                                                                                                                                                  | Tidak                                                                                  |
| dialogId          | Id dialog yang digunakan sebagai trigger dialog.                                                                                                                                                              | Tidak                                                                                  |
| whatsappRecipient | Nomor telepon dari recipient Anda.                                                                                                                                                                            | Ya                                                                                     |

{% hint style="info" %}
Anda tidak perlu menggunakan field whatsappRecipient jika sudah menggunakan field recipient. Ini juga berlaku sebaliknya.
{% endhint %}

### Create Recipients

| Method     | POST                                                                                                                                                              |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Media Type | application/json                                                                                                                                                  |
| URL        | https\://\[server]/dolphin/apiv1/graph/broadcast/upload/recipient&#xD;[&#xD;](<https://venom.3dolphins.ai:9443/dolphin/apiv1/graph/broadcast/multiple&#xD;&#xA;>) |
| Header     | Authorization : Bearer \[generatedToken]                                                                                                                          |

#### Body Create Recipients

Untuk membuat recipient, Anda harus mengunggah nomor recipient Anda dengan format xlsx. Anda harus mengisi data recipient dan menyimpannya dengan format xlsx, seperti gambar di bawah ini.

![recipient-import-document.xlsx](/files/-MWXjvZ3SX6D-POV3-Px)

Anda dapat memilih format **form-data** pada **Body** dan mengisi key dengan *'uploadFile'*, mengubah tipe dengan *file* kemudian Anda dapat mengklik button **select file** untuk memilih dokumen recipient pada perangkat Anda. Klik button ***Send*** untuk mengupload file.

![](/files/-MWXjbTk_QuUiTntv5Sv)

#### Response

Response status : 200

```
{
  "recipient_id": "[recipient id]" *digenerate secara otomatis oleh sistem
}
```

### Verify Phone Number

| Method     | POST                                                                                                                                                                              |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Media Type | application/json                                                                                                                                                                  |
| URL        | https\://\[server]/dolphin/apiv1/graph/broadcast/verify/{your-channel-id}&#xD;[&#xD;](<https://venom.3dolphins.ai:9443/dolphin/apiv1/graph/broadcast/multiple&#xD;&#xA;>)         |
| Header     | Authorization : Bearer \[generatedToken]                                                                                                                                          |
| Body       | <p>\["{phone-number-1}", "{phone-number-2}" , .... ]</p><p></p><p>catatan: nomor telepon harus diisi dengan format '62' (kode negara) atau '0', tidak dapat diisi dengan '+'.</p> |
| Status     | 200                                                                                                                                                                               |

#### Response :

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&#xD; |
| 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" : "text", 
        "message": "First broadcast" 
      } 
    ]
}
```

#### Response: 200

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

#### Contoh Send Broadcast Text

Dibawah ini merupakan gambaran ketika Anda menggunakan WhatsApp broadcast API untuk mengirimkan broadcast text pada aplikasi 3Dolphins.&#x20;

![Send Broadcast Text](/files/gjWyGg0qIx2cjp0l8Xas)

Ketika Anda memasukkan field **channel** menggunakan channel id pada API akan seperti memilih **account** pada aplikasi, begitupun dengan field **templateId** untuk memilih **notification** **template** Anda. Field **name** juga akan menjadi **title** untuk notifikasi Anda. Field **sendingMode** untuk menentukan **sending option** yang akan digunakan (apabila menggunakan 'schedule' maka, Anda dapat memilih waktu jadwal pengiriman notifikasi tersebut).&#x20;

### Send Broadcast Image

| Method     | POST                                                  |
| ---------- | ----------------------------------------------------- |
| Media Type | application/json                                      |
| URL        | https\://\[server]/dolphin/apiv1/graph/broadcast&#xD; |
| 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

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

#### Contoh Send Broadcast Image

Dibawah ini merupakan gambaran ketika Anda menggunakan WhatsApp broadcast API untuk  mengirimkan broadcast image pada aplikasi 3Dolphins.&#x20;

![Send Broadcast Image](/files/p09NAvPlOKqvYVD8hyct)

Ketika Anda memasukkan field **channel** menggunakan channel id pada API akan seperti memilih **account** pada aplikasi, begitupun dengan field **templateId** untuk memilih **notification** **template** Anda (ketika Anda memilih template dengan gambar maka Anda harus mengisi field 'type' dengan 'image' dan url gambar Anda menggunakan format https dan tipe ekstensi gambar). Field **name** akan menjadi **title** untuk notifikasi Anda. Sedangkan field **sendingMode** untuk menentukan **sending option** yang akan digunakan (apabila menggunakan 'schedule' maka, Anda dapat memilih waktu jadwal pengiriman notifikasi tersebut).&#x20;

### Send Broadcast Video

| Method     | POST                                                  |
| ---------- | ----------------------------------------------------- |
| Media Type | application/json                                      |
| URL        | https\://\[server]/dolphin/apiv1/graph/broadcast&#xD; |
| 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
        }
    ]
}
```

#### Response: 200

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

#### Example Send Broadcast Video

Dibawah ini merupakan gambaran ketika Anda menggunakan WhatsApp broadcast API untuk mengirimkan broadcast video pada aplikasi 3Dolphins.&#x20;

![Send Broadcast Video ](/files/cSV1c8MasorUNyeFRh5c)

Ketika Anda memasukkan field **channel** menggunakan channel id pada API akan seperti memilih **account** pada aplikasi, begitupun dengan field **templateId** untuk memilih **notification** **template** Anda (ketika Anda memilih template dengan video maka Anda harus mengisi field 'type' dengan 'video' dan url video Anda dengan format https dan tipe ekstensi video). Field **name** akan menjadi **title** untuk notifikasi Anda. Sedangkan field **sendingMode** untuk menentukan **sending option** yang akan digunakan (apabila menggunakan 'schedule' maka, Anda dapat memilih waktu jadwal pengiriman notifikasi tersebut).&#x20;

### Send Broadcast Document

| Method     | POST                                                  |
| ---------- | ----------------------------------------------------- |
| Media Type | application/json                                      |
| URL        | https\://\[server]/dolphin/apiv1/graph/broadcast&#xD; |
| 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

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

#### Contoh Send Broadcast Document

Dibawah ini merupakan gambaran ketika Anda menggunakan WhatsApp broadcast API untuk mengirimkan broadcast document pada aplikasi 3Dolphins.&#x20;

![Send Broadcast Document](/files/0q50iz1RC5pxEvGgDCN8)

Ketika Anda memasukkan field **channel** menggunakan channel id pada API akan seperti memilih **account** pada aplikasi, begitupun dengan field **templateId** untuk memilih **notification** **template** Anda (ketika Anda memilih template dengan video maka Anda harus mengisi field 'type' dengan 'document' dan url dokumen Anda dengan format https dan tipe ekstensi dokumen). Field **name** akan menjadi **title** untuk notifikasi Anda. Sedangkan field **sendingMode** untuk menentukan **sending option** yang akan digunakan (apabila menggunakan 'schedule' maka, Anda dapat memilih waktu jadwal pengiriman notifikasi tersebut).&#x20;

### Send Broadcast Quick Reply

| Method     | POST                                                  |
| ---------- | ----------------------------------------------------- |
| Media Type | application/json                                      |
| URL        | https\://\[server]/dolphin/apiv1/graph/broadcast&#xD; |
| 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" : [ 
    
    ]
}
```

#### 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 Quick Reply

Dibawah ini merupakan gambaran ketika Anda menggunakan WhatsApp broadcast API untuk mengirimkan broadcast quick reply pada aplikasi 3Dolphins.&#x20;

![Send Broadcast Quick Reply](/files/6KM1oWB1CaITKOW8Xe9J)

Ketika Anda memasukkan field **channel** menggunakan channel id pada API akan seperti memilih **account** pada aplikasi, begitupun dengan field **templateId** untuk memilih **notification** **template** Anda. Field **name** juga akan menjadi **title** untuk notifikasi Anda. Field **sendingMode** untuk menentukan **sending option** yang akan digunakan (apabila menggunakan 'schedule' maka, Anda dapat memilih waktu jadwal pengiriman notifikasi tersebut).&#x20;

### Send Broadcast Macro in Body

| Method     | POST                                                  |
| ---------- | ----------------------------------------------------- |
| Media Type | application/json                                      |
| URL        | https\://\[server]/dolphin/apiv1/graph/broadcast&#xD; |
| 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",  
    "bodyVariables" : [ 
        {
            "type": "personalized", 
            "key": "{{1}}", 
            "value": "Nama"
        },  
        {
            "type": "personalized", 
            "key": "{{2}}", 
            "value": "Title"
        }
    ],
    "content" : [ 
    
    ]
}
```

#### Response

Response status: 200

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

| Field            | Deskripsi                                                                                                                          |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Variables Object | Variabel Objek merupakan objek yang dibutuhkan untuk template yang memiliki makro. Objek tersebut memiliki komponen key dan value. |
| Key              | Key ini merujuk ke makro yang tersedia di template broadcast, misalnya : {0}, {1}, {2}                                             |
| Value            | Value mengacu pada field yang kami tentukan di file recipient, seperti yang ditunjukkan di bawah ini                               |

Contoh dari variable makro:

![Macro Variable](/files/-MWTfEdCbL19QtKXYrfg)

Contoh dari file recipient (harus dalam format .xlsx) :

![recipient-file.xlsx](/files/-MWTfUyr_dVQAtknoDX6)

Pada contoh di atas, field yang sedang didefinisikan adalah Nama dan Title. Kita dapat menggunakan field ini di Variabel Header / Variabel Body.

#### Example Send Broadcast Macro in Body&#x20;

Dibawah ini merupakan gambaran ketika Anda menggunakan WhatsApp broadcast API ketika akan mengirimkan broadcast macro pada body notification.&#x20;

![Send Broadcast Macro in Body ](/files/XF2VxAssZg4CkSrbsPwc)

Ketika Anda memasukkan field **channel** menggunakan channel id pada API akan seperti memilih **account** pada aplikasi, begitupun dengan field **templateId** untuk memilih **notification** **template** Anda. Field **name** juga akan menjadi **title** untuk notifikasi Anda. Ketika Anda menggunakan broadcast macro, field template variables body akan muncul untuk mengisi nilai field **key,type** dan **value**. Field **sendingMode** untuk menentukan **sending option** yang akan digunakan (apabila menggunakan 'schedule' maka, Anda dapat memilih waktu jadwal pengiriman notifikasi tersebut).&#x20;

### Send Broadcast Macro in Header and Body

**Penjelasan Komponen:**

| Field            | Deskripsi                                                                                                                          |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Variables Object | Variabel Objek merupakan objek yang dibutuhkan untuk template yang memiliki makro. Objek tersebut memiliki komponen key dan value. |
| Key              | Key ini merujuk ke makro yang tersedia di template broadcast, misalnya : {0}, {1}, {2}                                             |
| Value            | Value mengacu pada field yang kami tentukan di file recipient, seperti yang ditunjukkan di bawah ini.                              |

Contoh dari variable makro :

![Macro Variable](/files/-MWTfEdCbL19QtKXYrfg)

Contoh dari file recipient (harus dalam format .xlsx) :

![recipient-file.xlsx](/files/-MWTfUyr_dVQAtknoDX6)

Pada contoh di atas, field yang sedang didefinisikan adalah Nama dan Title. Kita dapat menggunakan field ini di Variabel Header / Variabel Body.

| Method     | POST                                                  |
| ---------- | ----------------------------------------------------- |
| Media Type | application/json                                      |
| URL        | https\://\[server]/dolphin/apiv1/graph/broadcast&#xD; |
| 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",  
    
    "headerVariables" : [ 
        {"key": "{{1}}", "value": "Nama"}
     ],
    "bodyVariables" : [
        {"key": "{{1}}", "value": "Nama"},  
        {"key": "{{2}}", "value": "Tanggal"}
     ],
    "content" : [ 
    
    ]
}
```

#### Response

Response status: 200

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

Contoh headerVariables di atas memiliki arti, Anda memetakan value field Name ke dalam makro {1} Contoh bodyVariables di atas memiliki arti, Anda memetakan value field Name ke dalam makro {1} dan value field Tanggal menjadi makro {2} .

Saat broadcast dikirim ke makro recipient {1} dan {2} akan diganti dengan value dari file recipient. Pada contoh ini, makro akan diganti dengan M.Ridwan dan 22-04-2021. Jadi hasil akhirnya akan seperti ini:

> Halo, M.Ridwan
>
> Terima kasih sudah mendaftarkan diri anda. Berikut lampiran datanya Nama: M. Ridwan Tanggal keberangkatan: 22-04-2021

#### Example Send Broadcast Macro in Header and Body&#x20;

Dibawah ini merupakan gambaran ketika Anda menggunakan WhatsApp broadcast API untuk  mengirimkan broadcast macro pada header dan body notification.

![Send Broadcast Macro in Header and Body](/files/BOjdtRTG84DhcowS2GFb)

Ketika Anda memasukkan field **channel** menggunakan channel id pada API akan seperti memilih **account** pada aplikasi, begitupun dengan field **templateId** untuk memilih **notification** **template** Anda. Field **name** juga akan menjadi **title** untuk notifikasi Anda. Ketika Anda menggunakan broadcast macro, field template variables untuk header dan body akan muncul untuk mengisi nilai field **key,type** dan **value**. Field **sendingMode** untuk menentukan **sending option** yang akan digunakan (apabila menggunakan 'schedule' maka, Anda dapat memilih waktu jadwal pengiriman notifikasi tersebut).&#x20;

### Send Multiple Broadcast

Multiple broadcast memungkinkan Anda membuat lebih dari satu broadcast sekaligus.

| Method     | POST                                                                                                                                                      |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Media Type | application/json                                                                                                                                          |
| URL        | https\://\[server]/dolphin/apiv1/graph/broadcast/multiple&#xD;[&#xD;](<https://venom.3dolphins.ai:9443/dolphin/apiv1/graph/broadcast/multiple&#xD;&#xA;>) |
| Header     | Authorization : Bearer \[generatedToken]                                                                                                                  |

#### Body for Multiple Broadcast :

```
[ 
*code untuk request broadcast pertama
{ 
   "name":"your-broadcast-name", 
   "channel":"channel-used-for-broadcast", 
   "sendingMode":"sending-mode",
   "scheduledDate":"2021-01-01 23:30:334",
   "content" : [ 
     { 
        "type" : "text", 
        "message": "First broadcast" 
      } 
   ] 
},
*code untuk request broadcast kedua
{ 
   "name":"your-broadcast-name", 
   "channel":"channel-used-for-broadcast", 
   "sendingMode":"sending-mode",
   "scheduledDate":"2021-01-01 23:30:334",
   "content" : [ 
     { 
        "type" : "text", 
        "message": "Second broadcast" 
      } 
   ] 
}
]
```

#### Response

Response status : 200

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

### Get Broadcast Detail by ID

| Method     | GET                                                                                                                                                     |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Media Type | application/json                                                                                                                                        |
| URL        | https\://\[server]/dolphin/apiv1/graph/broadcast/detail&#xD;[&#xD;](<https://venom.3dolphins.ai:9443/dolphin/apiv1/graph/broadcast/multiple&#xD;&#xA;>) |
| Header     | <p>Authorization : Bearer \[generatedToken]</p><p>Broadcast id: \[broadcast id]</p>                                                                     |

#### Response

Response status : 200

```
{
    "status": "success",
    "data": {
        "id": "your-broadcast-id",
        "spell": [
            "New Notification",
            "{\"header\":[],\"body\":[{\"type\":\"static\",\"key\":\"{{1}}\",\"value\":\"{value}\"},{\"type\":\"static\",\"key\":\"{{2}}\",\"value\":\"{value}\"}]}"
        ],
        "owner": "owner-id",
        "createdDate": 1614657234000,
        "createdBy": "created-by-id",
        "modifiedDate": 1614657340548,
        "modifiedBy": "system",
        "templateId": "template-id",
        "actionDate": 1614657339000,
        "name": "New Notification",
        "message": "{\"header\":[],\"body\":[{\"type\":\"static\",\"key\":\"{{1}}\",\"value\":\"{value}\"},{\"type\":\"static\",\"key\":\"{{2}}\",\"value\":\"{value}\"}]}",
        "recipient": [
            "{\"type\":\"contact\",\"id\":\"{recipient-id}\",\"phone\":\"{phone-number}\",\"selected\":true}"
        ],
        "status": "Sent",
        "channel": "your-channel-id",
        "channelType": "your-channel-type",
        "sendingMode": "Now",
        "scheduledDate": 1614657339000,
        "scheduledTime": "10:55"
    },
    "hasMore": false,
    "nextIndex": 0,
    "prevIndex": 0,
    "totalResults": 0
}
```

### Delete Broadcast

| Method     | DELETE                                                                             |
| ---------- | ---------------------------------------------------------------------------------- |
| Media Type | application/json                                                                   |
| URL        | https\://\[server]/dolphin/apiv1/graph/broadcast/delete&#xD;                       |
| Header     | <p>Authorization: Bearer \[generatedToken]</p><p>Broadcast id: \[broadcast id]</p> |

#### Response :&#x20;

Response status : 200

```
{
  "status": "success",
  "data": "Successfully delete Broadcast Item",
  "hasMore": false,
  "nextIndex": 0,
  "prevIndex": 0,
  "totalResults": 0
}
```

### Create Broadcast WhatsApp

{% hint style="info" %}
Broadcast template id harus dibuat terlebih dahulu agar dapat menggunakan WhatsApp broadcast API.
{% endhint %}

| Method       | POST                                                                                                                                        |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Content Type | application/json                                                                                                                            |
| URL          | https\://\[server]/graph/broadcast/whatsapp&#xD;[&#xD;](<https://venom.3dolphins.ai:9443/dolphin/apiv1/graph/broadcast/multiple&#xD;&#xA;>) |
| Header       | Authorization : Bearer \[generatedToken]                                                                                                    |

#### Body:

```
{
  "name": "Broadcast",
  "recipient": "string",
  "status": "string",
  "channel": "2ada6f6e1bxxxxxxxxxxxx",
  "sendingMode": "Now",
  "templateId": "8a2d8a2a3xxxxxxxxx",
  "scheduledDate": "string",
  "botId": "string",
  "dialogId": "string",
  "content": [
    {
      "type": "string",
      "url": "string",
      "message": "string"
    }
  ],
  "headerVariables": [
    {
      "key": "string",
      "value": "string"
    }
  ],
  "bodyVariables": [
    {
      "key": "{{1}}",
      "value": "Panggilan"
    },{
      "key": "{{2}}",
      "value": "Nama"
    }
  ],
  "whatsappRecipient": [
    {
      "Recipient": "62818xxxxxxxx",
            "Panggilan": "Zulfa",
            "Nama": "Fahimah"
        
    }
  ]
}
```

#### Response:

Response Status: 200

```
{
  "status": "success",
  "data": {
    "id": "173ae7e440xxxxxxxxxxxxxx"
  },
  "message": "Successfully make Broadcast Item"
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.3dolphins.ai/5.1.x-1/api/service-api/marketing-api/whatsapp-broadcast.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
