> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dripsender.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Kirim Pesan + File

> Kirim pesan dengan file atau media ke nomor WhatsApp melalui POST /send

Gunakan endpoint `POST /send` untuk mengirim pesan beserta media. Template pada API Test Playground menambahkan parameter `media_url` untuk URL file. Anda juga dapat mengunggah file langsung menggunakan `file` pada request `multipart/form-data`.

## Request

### Headers

| Header         | Type   | Required | Description                                 |
| -------------- | ------ | -------- | ------------------------------------------- |
| `Content-Type` | string | Yes      | `application/json` or `multipart/form-data` |

### Body Parameters (JSON)

<ParamField name="api_key" type="string" required>
  API key DripSender Anda. Kirim sebagai parameter body.
</ParamField>

<ParamField name="text" type="string" required>
  Isi pesan yang akan dikirim bersama media.
</ParamField>

<ParamField name="phone" type="string" required>
  Nomor WhatsApp tujuan dengan format internasional, misalnya `6281234567890`.
</ParamField>

<ParamField name="media_url" type="string">
  URL file yang akan dikirim. Gunakan URL yang dapat diakses oleh DripSender.
</ParamField>

<ParamField name="group_id" type="string">
  ID grup tujuan sebagai pengganti nomor telepon.
</ParamField>

<ParamField name="isInteractive" type="boolean">
  Aktifkan format pesan interaktif.
</ParamField>

<ParamField name="footer" type="string">
  Teks footer untuk pesan interaktif.
</ParamField>

<ParamField name="buttons" type="array">
  Daftar tombol untuk pesan interaktif.
</ParamField>

<ParamField name="send_at" type="string">
  Jadwalkan pesan menggunakan Unix timestamp.
</ParamField>

### Body Parameters (FormData)

<ParamField name="api_key" type="string" required>
  API key DripSender Anda.
</ParamField>

<ParamField name="text" type="string" required>
  Isi pesan yang akan dikirim bersama file.
</ParamField>

<ParamField name="phone" type="string" required>
  Nomor WhatsApp tujuan dengan format internasional, misalnya `6281234567890`.
</ParamField>

<ParamField name="file" type="file">
  File yang diunggah langsung. Gunakan ini sebagai pengganti `media_url`.
</ParamField>

### Example Request

<CodeGroup>
  ```bash theme={null}
  # Using media_url
  curl -X POST https://api.dripsender.id/send \
    -H "Content-Type: application/json" \
    -d '{
      "api_key": "YOUR_API_KEY",
      "text": "Here is the image you requested",
      "phone": "6281234567890",
      "media_url": "https://example.com/image.jpg"
    }'
  ```

  ```bash theme={null}
  # Using file upload
  curl -X POST https://api.dripsender.id/send \
    -F "api_key=YOUR_API_KEY" \
    -F "text=Here is the document" \
    -F "phone=6281234567890" \
    -F "file=@/path/to/document.pdf"
  ```

  ```javascript theme={null}
  axios.post("https://api.dripsender.id/send", {
    api_key: "YOUR_API_KEY",
    text: "Here is the image you requested",
    phone: "6281234567890",
    media_url: "https://example.com/image.jpg"
  }).then(response => {
    console.log(response.data);
  });
  ```
</CodeGroup>

## Response

### Success

<ResponseField>
  **Code:** `200`<br />
  **Content:** JSON response with `data: "OK"`
</ResponseField>

The file upload endpoint returns the same success response as the text message endpoint.

```json theme={null}
{
  "status": 200,
  "statusText": "",
  "data": "OK",
  "headers": {
    "content-length": "2",
    "content-type": "text/plain; charset=utf-8"
  }
}
```

### Error

<ResponseField>
  **Code:** `500`<br />
  **Content:** Error message
</ResponseField>
