# Support Chat

## **Chat Listing API**

The Chat Listing API provides a comprehensive list of chat conversations between users and admins on the e-commerce platform. It allows users and admins to view their previous chat interactions, ensuring seamless communication and support. Additionally, if an admin is away or unavailable, a prompt will be shown in the chat to inform users.

<figure><img src="https://3686328336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fd1Iq7THDAagTQzeC9rTN%2Fuploads%2FwC8lyibBQZncaWnRXmx1%2F1aac77c5-035a-4ec8-b551-92a2f612c568.jpg?alt=media&#x26;token=caa8f7e9-8ee2-494e-8ffe-34fb3666a740" alt=""><figcaption><p><strong>Support chat listing screen</strong></p></figcaption></figure>

### **Endpoint**

* `{{baseurl}}/api/v1/chat/list`

### **Method**

* **GET**

### **Request Parameters**&#x20;

None

### **Authorization**&#x20;

The API requires a valid bearer token in the request header for authentication and user authorization. Users and admins must provide their respective tokens to access their chat conversations.

### **Response Format**&#x20;

The API responds with a JSON object containing an array of chat conversation objects. Each conversation represents a chat interaction and includes details such as the participants, messages, timestamps, and other relevant information.

Example Response:

```json
{
    "success": true,
    "data": [
        {
            "message": "this for testing",
            "created_at": "2023-07-26 11:27:42",
            "user": 1,
            "admin": 0
        },
       {
            "message": "this for testing",
            "created_at": "2023-08-06 01:39:12",
            "user": 1,
            "admin": 0
        },
        {
            "message": "hi",
            "created_at": "2023-08-06 01:41:29",
            "user": 0,
            "admin": 1
        }
    ],
    "message": "Success",
    "status_code": 200,
    "is_allAdminIdle": false
}
```

### **Features**

* The Chat Listing API allows users and admins to view their previous chat interactions, promoting continuous communication and support.
* Each chat conversation contains details of the participants and messages exchanged, including timestamps for reference.
* If an admin is away, a prompt will be shown in the chat to inform users about the delay in response.

### **Usage**

* The Chat Listing API is used in the chat section of the e-commerce application to display a list of past conversations between users and admins.
* Users and admins can review previous interactions to address any pending queries or issues, and they will be aware of the admin's availability status through the displayed prompt.

By offering a comprehensive chat history and real-time updates about admin availability, the Chat Listing API enhances the customer support experience, ensuring timely and effective communication between users and admins.
