> For the complete documentation index, see [llms.txt](https://docs.3dolphins.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.3dolphins.ai/5.3.0-id/integration/chanel-connector/generic/how-to-create-ticket-using-generic-channel.md).

# How to Create Ticket using Generic Channel

Setelah selesai membuat channel, cobalah untuk membuat tiket agar memastikan bahwa channel berjalan dengan semestinya. Anda dapat membuat tiket menggunakan generic channel menggunakan API yang telah disediakan. Berikut langkah-langkah untuk membuat tiket generic:

Pertama, Anda harus melakukan otorisasi untuk mendapatkan token yang dapat digunakan untuk membuat tiket. Lalu selanjutnya setelah mendapatkan token, Anda dapat membuat tiket menggunakan API channel yang tersedia.&#x20;

## Create Token&#x20;

<mark style="color:green;">`POST`</mark> `{channelURLonlyuntilport}/oauth/token`

Digunakan untuk mendapatkan token sebelum dapat membuat tiket generic.&#x20;

**Authorization**

| Nama     | Value         |
| -------- | ------------- |
| Username | Client id     |
| Password | Client secret |

<figure><img src="/files/1yZSWVm5yIqEdHG9CiH6" alt=""><figcaption><p>Client id and client secret on Channel Connector</p></figcaption></figure>

<figure><img src="/files/CzQeWJtWRWUsk59x2cob" alt=""><figcaption><p>Authorization </p></figcaption></figure>

**Body**

| Nama         | Value         |
| ------------ | ------------- |
| `grant_type` | password      |
| `username`   | Client id     |
| `password`   | Client secret |

<figure><img src="/files/Gs8ByII56uxs4PLu87qK" alt=""><figcaption><p>Body Request</p></figcaption></figure>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
"access_token": "token",
    "token_type": "bearer",
    "expires_in": 86399,
    "scope": "read write"
}
```

{% endtab %}

{% tab title="401" %}

```json
<UnauthorizedException>
    <error>unauthorized</error>
    <error_description>Full authentication is required to access this resource</error_description>
</UnauthorizedException>
```

{% endtab %}
{% endtabs %}

## Create Generic Ticket

<mark style="color:green;">`POST`</mark> `{Channel URL}`

Digunakan untuk membuat tiket melalui channel generic.&#x20;

**Headers**

| Name          | Value            |
| ------------- | ---------------- |
| Authorization | `Bearer <token>` |

**Body**

{% hint style="info" %}
Field pada body request disesuaikan dengan mapping field pada channel generic yang sudah dibuat
{% endhint %}

Berikut merupakan contoh body request yang sudah disepakati sebagai mapping field yang tersedi diaplikasi 3Dolphins.&#x20;

<table><thead><tr><th width="230">Nama</th><th width="109">Tipe</th><th>Deskripsi</th></tr></thead><tbody><tr><td><code>contact_first_name</code></td><td>string</td><td>Merupakan field untuk menyimpan nama depan pelanggan</td></tr><tr><td><code>contact_last_name</code></td><td>string</td><td>Merupakan field untuk menyimpan nama belakang pelanggan</td></tr><tr><td><code>contact_email</code></td><td>string</td><td>Merupakan field untuk menyimpan email pelanggan</td></tr><tr><td><code>phones</code></td><td>string</td><td>Merupakan field untuk menyimpan nomor pelanggan</td></tr><tr><td><code>message</code></td><td>string</td><td>Merupakan field yang menyimpan pesan pelanggan </td></tr><tr><td><code>ticket_number</code></td><td>string</td><td>Merupakan field berisi nomor tiket interaksi pelanggan</td></tr><tr><td><code>account_id</code></td><td>string</td><td>Merupakan field berisi nomor id setiap akun pelanggan</td></tr><tr><td><code>dolphin.contact.id</code></td><td>string</td><td>Merupakan field untuk memetakan eksternal contact id dengan contact id di 3Dolphins </td></tr></tbody></table>

<figure><img src="/files/hlTLqDE1jg7VbYMDQhfS" alt=""><figcaption></figcaption></figure>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
}

```

{% endtab %}
{% endtabs %}

Tiket akan muncul pada tab **Bot** milik Supervisor apabila bot dinyalakan pada channel tersebut.&#x20;

<figure><img src="/files/hYUfSnJyQeJPyk1apgHF" alt=""><figcaption><p>Create Generic Ticket</p></figcaption></figure>
