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


---

# 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.3.0-id/integration/chanel-connector/generic/how-to-create-ticket-using-generic-channel.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.
