> For the complete documentation index, see [llms.txt](https://ardzz.gitbook.io/openwaclient/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ardzz.gitbook.io/openwaclient/client-side/quick-start/sender/send-media.md).

# Send Media

## Kirim Media

Di fitur ini Anda dapat mengirim:

* Mengirim gambar disertai *caption* atau deskripsi gambar yang Anda kirim
* Mengirim gambar sebagai *sticker*
* Mengirim [file .webp](https://developers.google.com/speed/webp) sebagai *sticker*

{% hint style="info" %}

* Jika Anda ingin mengirimkan sebuah video, Anda dapat menggunakan fitur dari [File](https://ardzz.gitbook.io/openwaclient/client-side/quick-start/sender/file) untuk mengirimkan video sebagai dokumen
* Nomor penerima pesan, harus menggunakan kode negara (Indonesia: 62)
* Contoh: 6285156123456
  {% endhint %}

{% hint style="danger" %}
Ektensi gambar yang diijinkan hanya:

* jpeg
* jpg
* png

Jika extensi gambar tidak valid maka akan otomatis gambar tidak terkirim

**!!! PENTING !!!**

**Saya menyarankan Anda untuk tidak mengirim gambar dengan ukuran yang besar (direkomendasikan dibawah 10MB)**
{% endhint %}

### Kirim Gambar

Penjelasan singkat tentang fitur ini

```php
function image(String $filename, String $caption, $receiver_number): Output
```

| Variabel          | Tipe data           | Deskripsi                                                                                              |
| ----------------- | ------------------- | ------------------------------------------------------------------------------------------------------ |
| $filename         | String              | Nama file (gambar) yang akan dikirim                                                                   |
| $caption          | String              | Deskripsi gambar (contoh, *Lihat! Pantai ini bagus sekali!*)                                           |
| $receiver\_number | String atau Integer | <p>Nomer penerima pesan, harus menggunakan kode negara (Indonesia: 62)</p><p>Contoh: 6285156123456</p> |

#### Penggunaan

```php
$openwa->Send()->Media()->image("<nama file>", "<deskripsi>", "<nomer penerima>");
```

#### Contoh

```php
$nama_file = "gambar_bunga.png";
$deskripsi = "Bunga ini cantik sekali!";
$nomer_penerima = "6285156123456";

$kirimGambar = $openwa->Send()->Media()->image($nama_file, $deskripsi, $nomer_penerima);

if($kirimGambar->isSuccess()){
    echo "Gambar berhasil dikrim";
}else{
    echo "Gambar gagal dikirim";
}
```

### Kirim Gambar Sebagai Sticker

Penjelasan singkat

```php
function imageAsSticker(string $image, $receiver_number): Output
```

| Variabel          | Tipe data           | Deskripsi                                                                                              |
| ----------------- | ------------------- | ------------------------------------------------------------------------------------------------------ |
| $image            | String              | Nama file (gambar) yang akan dikirim                                                                   |
| $receiver\_number | String atau Integer | <p>Nomer penerima pesan, harus menggunakan kode negara (Indonesia: 62)</p><p>Contoh: 6285156123456</p> |

#### Penggunaan

```php
$openwa->Send()->Media()->imageAsSticker("<nama file>", "<nomer penerima>");
```

#### Contoh

```php
$nama_file = "gambar_bunga.png";
$nomer_penerima = "6285156123456";

$kirimSticker = $openwa->Send()->Media()->imageAsSticker($nama_file, $nomer_penerima);

if($kirimSticker->isSuccess()){
    echo "Sticker berhasil dikrim";
}else{
    echo "Sticker gagal dikirim";
}
```

### Kirim Sticker Dari File .webp

Penjelasan singkat

```php
function rawWebpAsSticker(string $image, $receiver_number): Output
```

| Variabel          | Tipe data           | Deskripsi                                                                                              |
| ----------------- | ------------------- | ------------------------------------------------------------------------------------------------------ |
| $image            | String              | Nama file (gambar) yang akan dikirim sebagai stiker                                                    |
| $receiver\_number | String atau Integer | <p>Nomer penerima pesan, harus menggunakan kode negara (Indonesia: 62)</p><p>Contoh: 6285156123456</p> |

#### Penggunaan

```php
$openwa->Send()->Media()->imageAsSticker("<nama file>", "<nomer penerima>");
```

#### Contoh

```php
$nama_file = "STK-20200512-WA0010.webp";
$nomer_penerima = "6285156123456";

$kirimSticker = $openwa->Send()->Media()->rawWebpAsSticker($nama_file, $nomer_penerima);

if($kirimSticker->isSuccess()){
    echo "Sticker berhasil dikrim";
}else{
    echo "Sticker gagal dikirim";
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://ardzz.gitbook.io/openwaclient/client-side/quick-start/sender/send-media.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
