Chats

List all chats data

GET
/api/chats/

Permission: superadmin

curl -i https://api.revechat.com/api/chats/ -u john@example.com:123456
curl -i https://api.revechat.com/api/chats?page_no=2 -u john@example.com:123456
curl -i https://api.revechat.com/api/chats?date_from=2015-12-20&date_to=2016-12-25 -u john@example.com:123456
curl -i https://api.revechat.com/api/chats?agent_id=463 -u john@example.com:123456
curl -i https://api.revechat.com/api/chats?agent_email_id=john@example.com -u john@example.com:123456
curl -i https://api.revechat.com/api/chats?agent_id=724&page_no=2&agent_email_id=mary@example.com&date_from=2016-10-01&date_to=2017-01-10 -u john@example.com:123456

Parameter

Field
Type
Description

page_no optional

Number

The requested page number.

Default value: 1

date_from optional

String

yyyy-mm-dd formatted date is the start date of the search criteria.

Default value: 1970-01-01

date_to optional

String

yyyy-mm-dd formatted date is end date of the search criteria.

Default value: today

agent_id optional

Number

Will return results involving this agent id only.

agent_email_id optional

String

Will return results involving this agent's email only.

Success 200

Field
Type
Description

chat_id

Number

The chat id.

chat_request_time

Number

This is the chat request arrival time in epoch time in millisecond.

is_missed

Number

The status whether the requested chat is a successful chat or a missed chat.

chat_started_by

Number

The status whether the requested chat is visitor initiated or proactive knock from agent.

is_chat_transferred

Number

Indicates whether chat was transferred to some other agents or not.

conversation_start_time

Number

The start time of the conversation in epoch time in millisecond.

conversation_end_time

Number

The end time of the conversation in epoch time in millisecond.

chat_ended_by

Number

Indicates whether the chat was ended by visitor or agent.

visitor_id

Number

The id of the visitor.

visitor_email

String

The email address of the visitor.

visitor_name

String

The name of the visitor.

visitor_phone

String

The phone number of the visitor.

agent_id

Number

The id of the agent who handled the chat.

first_name

String

The first name of the agent.

last_name

String

The last name of the agent.

email

String

The email address of the agent.

rating

Number

The feedback value that the visitor gave based on the agent's performance.

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/json
Transfer-Encoding: chunked
Date: Tue, 02 Jun 2015 07:41:54 GMT
[
    {
        "chat_id": 28444,
        "chat_request_time": 1436421331668,
        "is_missed": 0,
        "chat_started_by": 1,
        "is_chat_transferred": -1,
        "conversation_start_time": 1436421339738,
        "conversation_end_time": 1436422378082,
        "chat_ended_by": 0,
        "visitor_id": 668745,
        "visitor_email": "test1@gmail.com",
        "visitor_phone": "123456",
        "visitor_name": "crome",
        "agent_id": 463,
        "first_name": "Mohammad",
        "last_name": "Adnan",
        "email": "adnan.revechat@yahoo.com",
        "rating": 0
    },
    {
        "chat_id": 28443,
        "chat_request_time": 1436421255078,
        "is_missed": 0,
        "chat_started_by": 1,
        "is_chat_transferred": -1,
        "conversation_start_time": 1436421258284,
        "conversation_end_time": 1436421316831,
        "chat_ended_by": 0,
        "visitor_id": 668745,
        "visitor_email": "test1@gmail.com",
        "visitor_phone": "123456",
        "visitor_name": "crome",
        "agent_id": 463,
        "first_name": "Mohammad",
        "last_name": "Adnan",
        "email": "adnan.revechat@yahoo.com",
        "rating": 0
    },
    {
        "chat_id": 28441,
        "chat_request_time": 1436420990423,
        "is_missed": 0,
        "chat_started_by": 1,
        "is_chat_transferred": -1,
        "conversation_start_time": 1436420995274,
        "conversation_end_time": 1436421153496,
        "chat_ended_by": 1,
        "visitor_id": 668745,
        "visitor_email": "test1@gmail.com",
        "visitor_phone": "123456",
        "visitor_name": "crome",
        "agent_id": 463,
        "first_name": "Mohammad",
        "last_name": "Adnan",
        "email": "adnan.revechat@yahoo.com",
        "rating": 0
    },
    {
        "chat_id": 28438,
        "chat_request_time": 1436420331426,
        "is_missed": 0,
        "chat_started_by": 1,
        "is_chat_transferred": -1,
        "conversation_start_time": 1436420335459,
        "conversation_end_time": 1436420714083,
        "chat_ended_by": 0,
        "visitor_id": 668745,
        "visitor_email": "test1@gmail.com",
        "visitor_phone": "123456",
        "visitor_name": "crome",
        "agent_id": 463,
        "first_name": "Mohammad",
        "last_name": "Adnan",
        "email": "adnan.revechat@yahoo.com",
        "rating": 0
    },
    {
        "chat_id": 28133,
        "chat_request_time": 1436262900963,
        "is_missed": 0,
        "chat_started_by": 1,
        "is_chat_transferred": -1,
        "conversation_start_time": 1436262954741,
        "conversation_end_time": 1436263764944,
        "chat_ended_by": 0,
        "visitor_id": 658714,
        "visitor_email": "arafat_cse_buet@yahoo.com",
        "visitor_phone": "32423424242234",
        "visitor_name": "Arafat Al Mahmud",
        "agent_id": 516,
        "first_name": "pappu-admin",
        "last_name": "123456",
        "email": "pappu-admin@revechat.com",
        "rating": 0
    },
    {
        "chat_id": 23920,
        "chat_request_time": 1434781507879,
        "is_missed": 0,
        "chat_started_by": 1,
        "is_chat_transferred": -1,
        "conversation_start_time": 1434781560209,
        "conversation_end_time": 1434784103279,
        "chat_ended_by": 0,
        "visitor_id": 574943,
        "visitor_email": "privatefire@gmail.com",
        "visitor_phone": "",
        "visitor_name": "",
        "agent_id": 466,
        "first_name": "Subrata",
        "last_name": "Pappu",
        "email": "pappu-agent@revechat.com",
        "rating": 0
    },
    {
        "chat_id": 23919,
        "chat_request_time": 1434781417730,
        "is_missed": 0,
        "chat_started_by": 1,
        "is_chat_transferred": -1,
        "conversation_start_time": 1434781419875,
        "conversation_end_time": 1434781437697,
        "chat_ended_by": 1,
        "visitor_id": 574943,
        "visitor_email": "privatefire@gmail.com",
        "visitor_phone": "",
        "visitor_name": "",
        "agent_id": 466,
        "first_name": "Subrata",
        "last_name": "Pappu",
        "email": "pappu-agent@revechat.com",
        "rating": 5
    },
    {
        "chat_id": 23915,
        "chat_request_time": 1434780368652,
        "is_missed": 0,
        "chat_started_by": 1,
        "is_chat_transferred": -1,
        "conversation_start_time": 1434780375186,
        "conversation_end_time": 1434781404930,
        "chat_ended_by": 1,
        "visitor_id": 574943,
        "visitor_email": "privatefire@gmail.com",
        "visitor_phone": "",
        "visitor_name": "",
        "agent_id": 466,
        "first_name": "Subrata",
        "last_name": "Pappu",
        "email": "pappu-agent@revechat.com",
        "rating": 5
    },
    {
        "chat_id": 23910,
        "chat_request_time": 1434779241087,
        "is_missed": 0,
        "chat_started_by": 0,
        "is_chat_transferred": -1,
        "conversation_start_time": 1434779241087,
        "conversation_end_time": 1434780359498,
        "chat_ended_by": 1,
        "visitor_id": 574943,
        "visitor_email": "privatefire@gmail.com",
        "visitor_phone": "",
        "visitor_name": "",
        "agent_id": 516,
        "first_name": "pappu-admin",
        "last_name": "123456",
        "email": "pappu-admin@revechat.com",
        "rating": 5
    },
    {
        "chat_id": 23906,
        "chat_request_time": 1434779144021,
        "is_missed": 0,
        "chat_started_by": 1,
        "is_chat_transferred": -1,
        "conversation_start_time": 1434779147071,
        "conversation_end_time": 1434781535484,
        "chat_ended_by": 1,
        "visitor_id": 574941,
        "visitor_email": "fire@gmail.com",
        "visitor_phone": "",
        "visitor_name": "",
        "agent_id": 516,
        "first_name": "pappu-admin",
        "last_name": "123456",
        "email": "pappu-admin@revechat.com",
        "rating": 5
    }
]

Get a single chat details

GET
/api/chats/{id}
curl -i https://api.revechat.com/api/chats/28133 -u john@example.com:123456

Parameter

Field
Type

id

Number

The id of the chat.

Success 200

Field
Type
Description

chat_id

Number

The chat id.

chat_request_time

Number

This is the chat request arrival time in epoch time in millisecond.

is_missed_chat

Number

The status whether the requested chat is a successful chat or a missed chat.

chat_started_by

Number

The status whether the requested chat is visitor initiated or proactive knock from agent.

is_chat_transferred

Number

Indicates whether chat was transferred to some other agents or not.

conversation_start_time

Number

The start time of the conversation in epoch time in millisecond.

conversation_end_time

Number

The end time of the conversation in epoch time in millisecond.

chat_ended_by

Number

The time when the visitor visited the site for the first time in epoch time in millisecond.

visitor_id

Number

The id of the visitor.

first_visit_time

Number

The time when the visitor visited the site for the first time in epoch time in millisecond.

ip_address

String

The ip address of the visitor.

platform

String

The platform of the visitor.

browser

String

The name of the browser through which the visitor requested the chat.

browser_version

String

The version of the browser.

country

String

The country of the visitor.

region

String

The region of the visitor.

latitude

String

The latitude of the visitor's location.

longitude

String

The longitude of the visitor's location.

isp

String

The name of the internet service provider of the visitor.

city

String

The city of the visitor.

referrer_link

String

The referrer address from which the visitor came into your website.

visitor_email

String

The email address of the visitor.

visitor_phone

String

The phone number of the visitor.

visitor_name

String

The name of the visitor.

agent_id

Number

The id of the agent who handled the chat.

agent_email

String

The email address of the agent.

first_name

String

The first name of the agent.

last_name

String

The last name of the agent.

rating

Number

The feedback value that the visitor gave based on the agent's performance.

messages

Object

All the messages in the chat session

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/json
Transfer-Encoding: chunked
Date: Tue, 02 Jun 2015 04:12:57 GMT
{
    "chat_id": 28133,
    "chat_request_time": 1436262900963,
    "is_missed": 0,
    "is_chat_transferred": -1,
    "chat_started_by": 1,
    "chat_ended_by": 0,
    "conversation_start_time": 1436262954741,
    "conversation_end_time": 1436263764944,
    "visitor_id": 658714,
    "ip_address": "180.234.212.114",
    "platform": "Win32",
    "browser": "Chrome",
    "country": "BANGLADESH",
    "region": "DHAKA",
    "latitude": "23.7104",
    "longitude": "90.40744",
    "isp": "AUGERE WIRELESS BROADBAND BANGLADESH LIMITED",
    "city": "DHAKA",
    "referrer_link": "localhost",
    "visitor_name": "Arafat Al Mahmud",
    "visitor_email": "arafat_cse_buet@yahoo.com",
    "visitor_phone": "32423424242234",
    "agent_id": 516,
    "agent_email": "pappu-admin@revechat.com",
    "first_name": "pappu-admin",
    "last_name": "123456",
    "rating": 0,
    "messages": [
        {
            "author_name": "pappu-admin",
            "message": "hy",
            "message_time": 1436262961630,
            "user_type": 0,
            "message_type": "chat"
        },
        {
            "author_name": "Arafat Al Mahmud",
            "message": "hi",
            "message_time": 1436262972733,
            "user_type": 1,
            "message_type": "chat"
        },
        {
            "author_name": "pappu-admin",
            "message": "is it working",
            "message_time": 1436262999835,
            "user_type": 0,
            "message_type": "chat"
        },
        {
            "author_name": "Arafat Al Mahmud",
            "message": "checking",
            "message_time": 1436263015939,
            "user_type": 1,
            "message_type": "chat"
        },
        {
            "author_name": "pappu-admin",
            "message": "is it now?",
            "message_time": 1436263197011,
            "user_type": 0,
            "message_type": "chat"
        

Error 4xx

Name
Description

ChatNotFound

The id of the Chat was not found.

Forbidden

Not Permitted.

InvalidChatID

Invalid Chat id (if the input is not Valid number value, such as, -143 ).

HTTP/1.1 404 Not Found
Server: Apache-Coyote/1.1
Content-Type: application/json
Transfer-Encoding: chunked
Date: Tue, 02 Jun 2015 05:28:57 GMT

{
    "error":
	    [	
		{
		"code":404,
		"message": "No Record found for Chat Id = 463. Please enter a another Chat Id."
		}
	    ]
}

Any questions? Please email us at support@revechat.com

Last updated