> For the complete documentation index, see [llms.txt](https://help.blinger.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.blinger.io/documentation/widget-api/conversation.md).

# Conversation

\
Assign Agent
------------

<mark style="color:green;">`POST`</mark> `https://widget.blinger.io/api/external/v1/conversation/:id/assign-agent`

#### Path Parameters

| Name | Type   | Description             |
| ---- | ------ | ----------------------- |
| id   | string | ID of the conversation. |

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Authorization | string | Authorization token. |

#### Request Body

| Name    | Type   | Description      |
| ------- | ------ | ---------------- |
| agentId | string | ID of the agent. |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```javascript
{
    "status": 200,
    "data": {
        "id": "e1d247c8-5cd8-4f93-b9d7-15fd3259ac22",
        "assignedAgent": {
            "id": "c671d030-584e-4422-8710-9215c04b6a64",
            "serviceUserId": "12345",
            "name": "Vadim Belorusov",
            "status": "online",
            "avatar": {
                "id": "76d94b6b-a45c-4d62-8010-bd2f52d8c846",
                "type": "image",
                "meta": {
                    "width": 400,
                    "height": 400
                },
                "info": {
                    "ext": "jpeg",
                    "name": "5d1db8373db3a",
                    "path": "/c2/b1/62/be16b35869e9491a6761c013cbae7548f23b17abb225eaa82efd214264779825.jpeg",
                    "size": 5106,
                    "mimeType": "image/jpeg"
                },
                "url": {
                    "120x120": "http://static.widget.blinger.io/120x120/c2/b1/62/be16b35869e9491a6761c013cbae7548f23b17abb225eaa82efd214264779825.jpeg",
                    "520x400": "http://static.widget.blinger.io/520x400/c2/b1/62/be16b35869e9491a6761c013cbae7548f23b17abb225eaa82efd214264779825.jpeg",
                    "default": "http://static.widget.blinger.io/c2/b1/62/be16b35869e9491a6761c013cbae7548f23b17abb225eaa82efd214264779825.jpeg"
                },
                "createdAt": 1562198400,
                "updatedAt": 1562198400
            },
            "active": true,
            "createdAt": 1562228791,
            "updatedAt": 1562228791
        },
        "locked": false,
        "createdAt": 1562228238,
        "updatedAt": 1562241579
    }
}
```

{% endtab %}
{% endtabs %}

## Send Text Message

<mark style="color:green;">`POST`</mark> `https://widget.blinger.io/api/external/v1/conversation/:id/send-text-message`

#### Path Parameters

| Name | Type   | Description             |
| ---- | ------ | ----------------------- |
| id   | string | ID of the conversation. |

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Authorization | string | Authorization token. |

#### Request Body

| Name | Type   | Description                         |
| ---- | ------ | ----------------------------------- |
| uuid | string | Unique generated ID of the message. |
| text | string | Simple text message.                |

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

```javascript
{
    "status": 200,
    "data": {
        "id": "554f11c1-ec1e-4fdb-9953-bfad33013f58",
        "status": "delivered",
        "type": "text",
        "body": "Hello",
        "file": null,
        "review": null,
        "bot": null,
        "agent": null,
        "endUser": {
            "id": "3132ad01-1d3c-4d14-ad05-19ae73c07556",
            "websocketToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzMTMyYWQwMS0xZDNjLTRkMTQtYWQwNS0xOWFlNzNjMDc1NTYifQ.cjKtgNraxCceKS-44SLH1SrKGsksvPgzlTX523C7lPw",
            "createdAt": 1562228238,
            "updatedAt": 1562228238
        },
        "microseconds": 1562242173465326,
        "createdAt": 1562242173,
        "updatedAt": 1562242173
    }
}
```

{% endtab %}
{% endtabs %}

## Send File Message

<mark style="color:green;">`POST`</mark> `https://widget.blinger.io/api/external/v1/conversation/:id/send-file-message`

#### Path Parameters

| Name | Type   | Description             |
| ---- | ------ | ----------------------- |
| id   | string | ID of the conversation. |

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Authorization | string | Authorization token. |

#### Request Body

| Name | Type   | Description                        |
| ---- | ------ | ---------------------------------- |
| file | string | Url of the file.                   |
| uuid | string | Unique generated ID of the message |

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

```javascript
{
    "status": 200,
    "data": {
        "id": "b01f7d2f-7003-4cc2-9a95-ac20d6374358",
        "status": "delivered",
        "type": "file",
        "body": null,
        "file": {
            "id": "6350e4fa-7b69-4f6b-b24e-228a05d62c21",
            "type": "image",
            "meta": {
                "width": 1920,
                "height": 1080
            },
            "info": {
                "name": "phpanbHIN",
                "ext": "png",
                "mimeType": "image/png",
                "size": 327743,
                "path": "/c2/9b/f1/734b2fce15c08f9ddae842c2daae809d1362e3d98ead08c26678f0707a776b72.png"
            },
            "url": {
                "120x120": "http://static.widget.blinger.io/120x120/c2/9b/f1/734b2fce15c08f9ddae842c2daae809d1362e3d98ead08c26678f0707a776b72.png",
                "520x400": "http://static.widget.blinger.io/520x400/c2/9b/f1/734b2fce15c08f9ddae842c2daae809d1362e3d98ead08c26678f0707a776b72.png",
                "default": "http://static.widget.blinger.io/c2/9b/f1/734b2fce15c08f9ddae842c2daae809d1362e3d98ead08c26678f0707a776b72.png"
            },
            "createdAt": 1562242573,
            "updatedAt": 1562242573
        },
        "review": null,
        "bot": null,
        "agent": null,
        "endUser": {
            "id": "3132ad01-1d3c-4d14-ad05-19ae73c07556",
            "websocketToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzMTMyYWQwMS0xZDNjLTRkMTQtYWQwNS0xOWFlNzNjMDc1NTYifQ.cjKtgNraxCceKS-44SLH1SrKGsksvPgzlTX523C7lPw",
            "createdAt": 1562228238,
            "updatedAt": 1562228238
        },
        "microseconds": 1562242573548953,
        "createdAt": 1562242573,
        "updatedAt": 1562242573
    }
}
```

{% endtab %}
{% endtabs %}

## Request Review

<mark style="color:green;">`POST`</mark> `https://widget.blinger.io/api/external/v1/conversation/:id/request-review`

#### Path Parameters

| Name | Type   | Description            |
| ---- | ------ | ---------------------- |
| id   | string | ID of the conversation |

#### Headers

| Name          | Type   | Description          |
| ------------- | ------ | -------------------- |
| Authorization | string | Authorization token. |

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

```javascript
{
    "status": 200,
    "data": {
        "id": "b2737f3a-eaee-4271-b705-2bc9bb951ca1",
        "status": "delivered",
        "type": "review",
        "body": null,
        "file": null,
        "review": {
            "id": "6bc1f3b9-c972-400d-b5cd-1ca4e2d9a8fc",
            "agent": {
                "id": "c671d030-584e-4422-8710-9215c04b6a64",
                "serviceUserId": "12345",
                "name": "Vadim Belorusov",
                "status": "online",
                "avatar": {
                    "id": "76d94b6b-a45c-4d62-8010-bd2f52d8c846",
                    "type": "image",
                    "meta": {
                        "width": 400,
                        "height": 400
                    },
                    "info": {
                        "ext": "jpeg",
                        "name": "5d1db8373db3a",
                        "path": "/c2/b1/62/be16b35869e9491a6761c013cbae7548f23b17abb225eaa82efd214264779825.jpeg",
                        "size": 5106,
                        "mimeType": "image/jpeg"
                    },
                    "url": {
                        "120x120": "http://static.widget.blinger.io/120x120/c2/b1/62/be16b35869e9491a6761c013cbae7548f23b17abb225eaa82efd214264779825.jpeg",
                        "520x400": "http://static.widget.blinger.io/520x400/c2/b1/62/be16b35869e9491a6761c013cbae7548f23b17abb225eaa82efd214264779825.jpeg",
                        "default": "http://static.widget.blinger.io/c2/b1/62/be16b35869e9491a6761c013cbae7548f23b17abb225eaa82efd214264779825.jpeg"
                    },
                    "createdAt": 1562198400,
                    "updatedAt": 1562198400
                },
                "active": true,
                "createdAt": 1562228791,
                "updatedAt": 1562228791
            },
            "endUser": {
                "id": "3132ad01-1d3c-4d14-ad05-19ae73c07556",
                "websocketToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzMTMyYWQwMS0xZDNjLTRkMTQtYWQwNS0xOWFlNzNjMDc1NTYifQ.cjKtgNraxCceKS-44SLH1SrKGsksvPgzlTX523C7lPw",
                "createdAt": 1562228238,
                "updatedAt": 1562228238
            },
            "mark": 0,
            "confirmed": false,
            "text": "",
            "createdAt": 1562242470,
            "updatedAt": 1562242470
        },
        "bot": {
            "id": "ad92f7ab-388f-4e86-a20a-4425885bfa40",
            "name": "Blinger bot",
            "createdAt": 1562228206,
            "updatedAt": 1562228206
        },
        "agent": null,
        "endUser": null,
        "microseconds": 1562242470285931,
        "createdAt": 1562242470,
        "updatedAt": 1562242470
    }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://help.blinger.io/documentation/widget-api/conversation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
