View file api_docs/endpoints/messaging/includes/get-chats.phtml

File size: 1.84Kb
<div class="content__inner">
    <h2>Get chats</h2>
    <p>
        Please use this <strong>(<?php echo cl_link("mobile_api/get_chats"); ?>) API for accessing the endpoint of the chat list</strong> 
    </p>
    <br>
    <h4 class="table-title">Get parameters</h4>
    <table class="table table-bordered">
        <thead>
        <tr>
            <th width="15%">Field</th>
            <th width="25%">Value</th>
            <th width="45%">Remarks</th>
        </tr>
        </thead>
        <tbody>
            <tr>
                <td>session_id</td>
                <td>​Access token ID</td>
                <td>
                    E.g. de25cc16eb00960f076...
                </td>
            </tr>
        </tbody>
    </table>
    <h4 class="table-title">Success response</h4>
    <div class="code-holder">
        <div class="code-holder-inner">
    <pre><code class="json">{
        "code": 200,
        "message": "Chats successfully",
        "data": [
            {
            "user_id": 78,
            "username": "mansurTLs",
            "name": "First name Last name",
            "avatar": "http://colibri.loc/upload/default/avatar.png",
            "verified": "0",
            "chat_id": 9,
            "time": "17 minutes ago",
            "last_message": "y",
            "new_messages": "",
            "chat_url": "http://colibri.loc/conversation/@mansurTLs"
            },
            {"user_id": 34, "username": "jack_nelson", "name": "Jack Nelson", "avatar": "http://colibri.loc/upload/default/avatar.png",…}
        ]
    }
    </code></pre>
        </div>
    </div>
    <h4 class="table-title">Error responses</h4>
    <div class="code-holder">
        <div class="code-holder-inner">
    <pre><code class="json">{
        "code": 401,
        "data": [],
        "message": "Unauthorized Access"
    }
    </code></pre>
        </div>
    </div>
</div>