Get Chat Session

This API will check if there is any existing chat session on server. If a chat session already exists on server, it will return chat session data and other related data like settings, department(tags), user_agent, redirect URL(use in mobile screen) and agents list and online status.

Resource URL

https://Server Node Environment/index.php

Example : https://api.yourdomain.com/index.php

Resource Information

Parameters Values
Resource Format JSON
Method POST
Requires authentication? Yes

Request

GET Params

Parameters Mandatory Description
[Request parameters]
d REQUIRED visitors - Controller directory name
c REQUIRED chat - Controller name
m REQUIRED get_session - Controller method name

Headers

Parameters Mandatory Description
Accesstoken REQUIRED Access Token

POST Params

Parameters Mandatory Description
[Request parameters]
page_title REQUIRED Site page title where chatbox is showing
page_url REQUIRED Site page URL where chatbox is showing
siteuser[name] OPTIONAL site user name
siteuser[email] OPTIONAL site user email address
siteuser[message] OPTIONAL default message

Response


{
    "error": "",
    "result": "no-session",
    "redirect_to": "http://localhost/chatbull/chatbox/",
    "settings": {
        "current_version": "5.1.2",
        "current_product_name": "chatbull",
        "enable_agent_initiate_chats": "yes",
        "chat_status": "enable",
        "time_interwal": "3",
        "chat_mode": "online"
        ........
    },
    "data": {
        "minimized": "no",
        "anonymous_visitor": {},
        "anonymous_messages": []
    },
    "tags": [
        {
            "id": "3",
            "tag_name": "Accounts",
            "tag_status": "publish"
        }
    ],
    "user_agent": "browser",
    "is_agents_online": true,
    "agents_list": []
}

Messages returned

HTTP STATUS CODE Description MESSAGE BODY
200 Successfully Return Return data in JSON format.
200 Authorization Error {"result":"failed","error":"Invalid access token or Token has been expired."}
400 Request is malformed {"error": "invalid_request", "error_description": "description"}
403 Forbidden Directory access is forbidden.
404 Resource Not found The page you requested was not found.