# How to Create Ticket using Generic Channel

After making the channel, please try creating a ticket to confirm that it's working properly. You can create a ticket using generic channels via the provided API. Simply follow these steps to make a generic ticket:

First, you must authorize to get a token that be used to create tickets. Next, after received the token, you can create a ticket using the API available for generic channel.&#x20;

## Create Token

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

This is how you get tokens before you can make geeric tickets.

Authorization

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

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

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

**Body**

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

<figure><img src="/files/rva6Lsdpi8aRrRDOcoq8" 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}`

This is used to create tickets through generic channels.

**Headers**

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

**Body**

{% hint style="info" %}
The request body fields are aligned with the mapping fields in the created generic channel.
{% endhint %}

Below is an example of a body request that has been agreed as a mapping field available in the 3Dolphins application.

<table><thead><tr><th width="230">Name</th><th width="109">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>contact_first_name</code></td><td>string</td><td>This field is intended for storing the customer's first name</td></tr><tr><td><code>contact_last_name</code></td><td>string</td><td>This field is intended for storing the customer's last name</td></tr><tr><td><code>contact_email</code></td><td>string</td><td>This field is intended for storing the customer's email address</td></tr><tr><td><code>phones</code></td><td>string</td><td>This field is intended for storing the customer's phone number</td></tr><tr><td><code>message</code></td><td>string</td><td>This field is intended for storing the customer's message</td></tr><tr><td><code>ticket_number</code></td><td>string</td><td>This field contains the ticket number for customer interactions.</td></tr><tr><td><code>account_id</code></td><td>string</td><td>This field contains the unique identification number to each customer account.</td></tr><tr><td><code>dolphin.contact.id</code></td><td>string</td><td>This field supports for the mapping between the external contact ID and the 3Dolphins contact ID.</td></tr></tbody></table>

**Response**

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

```json
{
}
```

{% endtab %}
{% endtabs %}

<figure><img src="/files/GovEDizULNRvVhwlz7FS" 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/integration/channel-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.
