Visitors

List all visitors data

GET
/api/visitors/

Permission: superadmin

curl -i https://api.revechat.com/api/visitors/ -u john@example.com:123456
curl -i https://api.revechat.com/api/visitors?page_no=3 -u john@example.com:123456

Parameter

Type
Description

page_no optional

Number

The requested page number.

Default value: 1

Success 200

Field
Type
Description

visitor_id

Number

The id of the visitor.

name

String

The name of the visitor.

email

String

The email address of the visitor.

phone

String

The phone number 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.

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
[
    {
        "visitor_id": 668745,
        "name": "crome",
        "email": "test1@gmail.com",
        "phone": "123456",
        "first_visit_time": 1436415531845,
        "ip_address": "202.79.18.88",
        "platform": "Win32",
        "browser": "Chrome",
        "country": "BANGLADESH",
        "region": "DHAKA",
        "latitude": "23.7104",
        "longitude": "90.40744",
        "isp": "CONNECTBD LTD INTERNET SERVICE PROVIDER DHAKA BANGLADESH",
        "city": "DHAKA",
        "referrer_link": "suvradev.blogspot.com"
    },
    {
        "visitor_id": 658714,
        "name": "Arafat Al Mahmud",
        "email": "arafat_cse_buet@yahoo.com",
        "phone": "32423424242234",
        "first_visit_time": 1436262896239,
        "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_id": 574943,
        "name": "",
        "email": "privatefire@gmail.com",
        "phone": "",
        "first_visit_time": 1434779164987,
        "ip_address": "202.79.18.88",
        "platform": "Win32",
        "browser": "Firefox",
        "country": "BANGLADESH",
        "region": "DHAKA",
        "latitude": "23.7104",
        "longitude": "90.40744",
        "isp": "CONNECTBD LTD INTERNET SERVICE PROVIDER DHAKA BANGLADESH",
        "city": "DHAKA",
        "referrer_link": "subratadeypappu.netai.net"
    },
    {
        "visitor_id": 574941,
        "name": "",
        "email": "fire@gmail.com",
        "phone": "",
        "first_visit_time": 1434779131677,
        "ip_address": "202.79.18.88",
        "platform": "Win32",
        "browser": "Firefox",
        "country": "Bangladesh",
        "region": "Dhaka",
        "latitude": "23.7104",
        "longitude": "90.40744",
        "isp": "Connectbd Ltd Internet Service Provider Dhaka Bangladesh",
        "city": "Dhaka",
        "referrer_link": "subratadeypappu.netai.net"
    },
    {
        "visitor_id": 574931,
        "name": "",
        "email": "im@gmail.com",
        "phone": "",
        "first_visit_time": 1434779038973,
        "ip_address": "202.79.18.88",
        "platform": "Win32",
        "browser": "Chrome",
        "country": "BANGLADESH",
        "region": "DHAKA",
        "latitude": "23.7104",
        "longitude": "90.40744",
        "isp": "CONNECTBD LTD INTERNET SERVICE PROVIDER DHAKA BANGLADESH",
        "city": "DHAKA",
        "referrer_link": "subratadeypappu.netai.net"
    },
    {
        "visitor_id": 401162,
        "name": "",
        "email": "anshul@revesoft.com",
        "phone": "",
        "first_visit_time": 1431853814678,
        "ip_address": "180.234.212.114",
        "platform": "Win32",
        "browser": "Firefox",
        "country": "BANGLADESH",
        "region": "DHAKA",
        "latitude": "23.7104",
        "longitude": "90.40744",
        "isp": "AUGERE WIRELESS BROADBAND BANGLADESH LIMITED",
        "city": "DHAKA",
        "referrer_link": "test.revechat.com"
    },
    {
        "visitor_id": 288117,
        "name": "test",
        "email": "nurnabi@revesoft.com",
        "phone": "33333333333",
        "first_visit_time": 1430278503846,
        "ip_address": "202.79.18.88",
        "platform": "Win32",
        "browser": "Firefox",
        "country": "Bangladesh",
        "region": "Dhaka",
        "latitude": "23.7104",
        "longitude": "90.40744",
        "isp": "Connectbd Ltd Internet Service Provider Dhaka Bangladesh",
        "city": "Dhaka",
        "referrer_link": "test.revechat.com"
    },
    {
        "visitor_id": 268817,
        "name": "nurnabi-1",
        "email": "nurnabi@revesoft.com",
        "phone": "111111111111",
        "first_visit_time": 1429784697569,
        "ip_address": "202.79.18.88",
        "platform": "Win32",
        "browser": "Chrome",
        "country": "Bangladesh",
        "region": "Dhaka",
        "latitude": "23.7104",
        "longitude": "90.40744",
        "isp": "Connectbd Ltd Internet Service Provider Dhaka Bangladesh",
        "city": "Dhaka",
        "referrer_link": "test.revechat.com"
    },
    {
        "visitor_id": 268375,
        "name": "rrr",
        "email": "01811412833333@gogle.com",
        "phone": "333333",
        "first_visit_time": 1429776282904,
        "ip_address": "180.234.212.114",
        "platform": "Win32",
        "browser": "Firefox",
        "country": "BANGLADESH",
        "region": "DHAKA",
        "latitude": "23.7104",
        "longitude": "90.40744",
        "isp": "AUGERE WIRELESS BROADBAND BANGLADESH LIMITED",
        "city": "DHAKA",
        "referrer_link": "test.revechat.com"
    },
    {
        "visitor_id": 250648,
        "name": "",
        "email": "",
        "phone": "",
        "first_visit_time": 1429162015166,
        "ip_address": "202.79.18.88",
        "platform": "Win32",
        "browser": "Chrome",
        "country": "BANGLADESH",
        "region": "DHAKA",
        "latitude": "23.7104",
        "longitude": "90.40744",
        "isp": "CONNECTBD LTD INTERNET SERVICE PROVIDER DHAKA BANGLADESH",
        "city": "DHAKA",
        "referrer_link": "test.revechat.com"
    }
]

Error 4xx

Name
Description

Unauthorized

Provided credentials are not valid

Forbidden

Not permitted

InvalidPageNumber

Invalid Page Number (if the input is not any positive number value, such as, -2 ).

HTTP/1.1 401 Unauthorized
Server: Apache-Coyote/1.1
WWW-Authenticate: Basic realm="revechat"
Content-Type: application/json;charset=UTF-8
Content-Length: 15
Date: Tue, 02 Jun 2015 07:47:13 GMT
Bad credentials

Get a single visitor details

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

Parameter

Field
Type
Description

id

Number

The id of the visitor.

Success 200

Field
Type
Description

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.

visitor_records

Object

All the distinct visitor records covering all sessions.

country

String

Country of the visitor.

total_views

Number

The total number of page views.

total_visits

Number

The total number of page visits.

total_chats

Number

The total number of chats between this visitor and the agents.

total_chat_duration

Number

The total chat duration in millisecond.

last_chat_start_time

Number

The time when the last chat started with this visitor in epoch time in millisecond.

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
{
    "visitor_id": 668745,
    "first_visit_time": 1436415531845,
    "visitor_records": [
        {
            "visitor_name": "crome",
            "visitor_email": "test1@gmail.com",
            "visitor_phone": "123456",
            "ip_address": "202.79.18.88",
            "platform": "Win32",
            "browser": "Chrome",
            "country": "BANGLADESH",
            "region": "DHAKA",
            "latitude": "23.7104",
            "longitude": "90.40744",
            "isp": "CONNECTBD LTD INTERNET SERVICE PROVIDER DHAKA BANGLADESH",
            "city": "DHAKA",
            "referrer_link": "suvradev.blogspot.com"
        }
    ],
    "total_views": 8,
    "total_visits": 1,
    "total_chats": 5,
    "total_chat_duration": 1725081,
    "last_chat_start_time": 1436421339738
}

Error 4xx

Name
Description

VisitorNotFound

The id of the visitor was not found.

Forbidden

Not Permitted

InvalidVisitorID

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

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 Visitor Id = 668745. Please enter a another Visitor Id."
		}
	    ]
}

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

Last updated