# Third-Party Integration

3Dolphins mendukung untuk integrasi eksternal dengan third-party omnichannel. Di bawah ini adalah default arsitektur dan konfigurasi untuk mendukung integrasi antara 3dolphins dan third-party omnichannel.

### **Third-Party Integration Workflow**

![Integration Workflow](https://lh3.googleusercontent.com/2KBqYRuM0dNH690Q3SMijOFY3mZc3quKqj_melvcYLdlSIT1KUr1ycp0pxeRuEVG1bHK6dPRG4bmysS-GIhj-VpCEu0nuCQvt_cvinzZ6ET_fzjHZU0JB_Q8Lv3LsuUSXNR4VafF)

### **Properties Configuration**

Pengaturan tambahan properties di server 3dolphins untuk mengaktifkan integrasi dengan third-parties.

| **Properties**                          | Value |
| --------------------------------------- | ----- |
| app.ext.integration.api.base.url        |       |
| app.ext.integration.api.sendMessage     |       |
| app.ext.integration.api.incomingMessage |       |

### **Incoming Event**

Tabel di bawah ini adalah daftar field yang akan dikirim dari 3dolphins Engine ke third-parties yang akan integrasikan.

| **Field**    | **Deskripsi**                                             | **Status** |
| ------------ | --------------------------------------------------------- | ---------- |
| ticketNumber | Identifier unik                                           | Mandatory  |
| channel      | Channel social media                                      | Mandatory  |
| accountId    | Id account pada social media                              | Mandatory  |
| contactId    | Id contact 3Dolphins                                      | Mandatory  |
| messageType  | text/image/video/audio/file/Location (latitude,longitude) | Mandatory  |
| message      | Output yang tergantung pada jenis pesan                   | Mandatory  |
| mediaLink    | URL media yang valid                                      | Mandatory  |
| customerName | Nama customer termasuk first name + last name             | Mandatory  |
| createdDate  | Tanggal tiket dibuat (“yyyy-MM-dd'T'HH:mm:ss.SSS”)        | Mandatory  |
| owner        | Tenant ID                                                 | Mandatory  |
| GroupId      | Field tambahan untuk roomchat tertentu                    | Additional |
| Language     | Field tambahan untuk bahasa tertentu                      | Additional |

{% hint style="info" %}
Field ini akan disajikan dalam format JSON.
{% endhint %}

Di bawah ini merupakan contoh JSON untuk incoming event dari 3Dolphins ke third-party:

```
{
	"ticketNumber":"294c9ea88f7e649f8c37ae895ebab247",
	"channel":"whatsapp",
	“accountId”:”628128778222”
	"contactId":"d61d77735f3fe08bcf6d6b96fa06ba9d"
	"messageType":"text",
	"message":"Halo",
	"mediaLink":"",
	"customerName":"Farhan Akbar",
	"createdDate":"2021-04-28T15:39:37.945"
	"owner":"82ab0fd5cfd1e80d1ff97c0cfc9aaaa",
	"groupId":"",
	"language":""
}
```

### Outgoing Event

Tabel di bawah ini adalah daftar field yang dibutuhkan dari third-party untuk mengirimkan post message ke platform 3dolphins. Pesan tersebut nantinya akan dikirimkan ke pelanggan berdasarkan nomor tiket yang telah diberikan.

| **Field**    | **Description**                                           |
| ------------ | --------------------------------------------------------- |
| ticketNumber | Identifier unik                                           |
| channel      | Channel social media                                      |
| messageType  | text/image/video/audio/file/Location (latitude,longitude) |
| message      | Output yang tergantung pada jenis pesan                   |
| mediaLink    | URL media yang valid                                      |
| customerName | Nama customer termasuk first name + last name             |
| owner        | Tenant ID                                                 |

{% hint style="info" %}
Field ini akan disajikan dalam format JSON.
{% endhint %}

Di bawah ini merupakan contoh JSON untuk outgoing event dari 3Dolphins ke third-party:

```
{
	"ticketNumber":"294c9ea88f7e649f8c37ae895ebab247",
	"channel":"whatsapp",
	"messageType":"text",
	"message":"Selamat Datang Customer",
	"mediaLink":"",
	"customerName":"Farhan Akbar",
	"createdDate":"2021-04-28T15:39:37.945"
	"owner":"82ab0fd5cfd1e80d1ff97c0cfc9aaaa"
}
```

Di bawah ini merupakan contoh respons JSON dari webhook:

```
{
	"status":"success"
}
```

### Command Event

Tabel di bawah ini adalah daftar field yang diperlukan dari third-parties untuk mengirimkan pembaruan status tiket ke platform 3dolphins.

| **Field**    | **Description**            |
| ------------ | -------------------------- |
| ticketNumber | Identifier unik            |
| channel      | Channel social media       |
| owner        | Tenant ID                  |
| event        | Close Event from 3rd Party |

{% hint style="info" %}
Field ini akan disajikan dalam format JSON.
{% endhint %}

Di bawah ini merupakan contoh JSON untuk command event dari 3Dolphins ke third-party:

```
{
	"ticketNumber":"294c9ea88f7e649f8c37ae895ebab247",
	"channel":"whatsapp",
	"owner":"82ab0fd5cfd1e80d1ff97c0cfc9aaaa"
	"event":"Close"
}
```

Di bawah ini merupakan contoh respons JSON dari webhook:

```
{
	"status":"success"
}
```

### Scopes

1. Kebutuhan untuk conversation history dapat menggunakan 3Dolphins Conversation History API.&#x20;
2. Format dari pesan stiker akan diubah menjadi teks 'Stiker'.
3. Third-Party dapat menggunakan 3Dolphins Contact API untuk mendapatkan data customer berdasarkan contactId di Incoming.


---

# 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.1.x-1/integration/third-party-integration.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.
