> 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/integration/channel-connector/generic/how-to-create-ticket-using-generic-channel.md).

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