Offline Messages

List all offline messages data

GET
/api/offlinemessages/

Permission: superadmin

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

Parameter

Field
Type
Description

page_no optional

Number

The requested page number.

Default value: 1

Success 200

Field
Type
Description

offline_message_id

Number

The id of the offline message.

visitor_id

Number

The id of the visitor.

visitor_name

String

The name of the visitor.

visitor_email

String

The email address of the visitor.

visitor_phone

String

The phone number of the visitor.

subject

String

The subject of the offline message.

message

String

The body of the offline message.

received_time

Number

The time when the visitor submitted the offline message in epoch time in millisecond.

unread

Number

The status denotes whether the offline message remains unread or not.

reply_message_count

Number

The number of messages sent to the visitor in response of this offline message.

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
[
    {
        "offline_message_id": 744,
        "visitor_id": 203305,
        "visitor_name": "arafat.mobilw",
        "visitor_email": "ssd@ccc.cin",
        "visitor_phone": "23444445555",
        "subject": "hhhhh",
        "message": "hhhhhh",
        "received_time": 1429082063768,
        "unread": 0,
        "reply_message_count": 4
    },
    {
        "offline_message_id": 740,
        "visitor_id": 199011,
        "visitor_name": "nurnabi-firefox",
        "visitor_email": "nurnabi-firefox@yahoo.com",
        "visitor_phone": "66666666666",
        "subject": "9999999",
        "message": "999999999",
        "received_time": 1429036033094,
        "unread": 0,
        "reply_message_count": 1
    },
    {
        "offline_message_id": 596,
        "visitor_id": 146598,
        "visitor_name": "",
        "visitor_email": "",
        "visitor_phone": "",
        "subject": "test",
        "message": "hii...test",
        "received_time": 1425643670381,
        "unread": 0,
        "reply_message_count": 2
    },
    {
        "offline_message_id": 594,
        "visitor_id": 140425,
        "visitor_name": "",
        "visitor_email": "",
        "visitor_phone": "",
        "subject": "hi",
        "message": "hi bb",
        "received_time": 1425633914570,
        "unread": 0,
        "reply_message_count": 1
    }
]

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 single offline message details

GET
/api/offlinemessages/{id}
curl -i https://api.revechat.com/api/offlinemessages/744 -u john@example.com:1234561

Parameter

Field
Type
Description

id

Number

The id of the offline message.

Success 200

Field
Type
Description

offline_message_id

Number

The id of tabthe offline message.

visitor_id

Number

The id of the visitor.

visitor_name

String

The name of the visitor.

visitor_email

String

The email address of the visitor.

visitor_phone

String

The phone number of the visitor.

subject

String

The subject of the offline message.

message

String

The body of the offline message.

received_time

Number

The time when the offline message was submitted by the visitor in epoch time in millisecond.

unread

Number

The status denotes whether the offline message remains unread or not.

reply_messages

Object

All the reply messages in response of this offline message.

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
{
    "offline_message_id": 744,
    "visitor_id": 203305,
    "visitor_name": "arafat.mobilw",
    "visitor_email": "ssd@ccc.cin",
    "visitor_phone": "23444445555",
    "subject": "hhhhh",
    "message": "hhhhhh",
    "received_time": 1429082063768,
    "unread": 0,
    "reply_messages": [
        {
            "reply_message": "Hello",
            "message_reply_time": 1439628148050,
            "agent_id": 465,
            "first_name": "nurnabi",
            "last_name": "Siddiquee",
            "email": "nurnabi-admin@revechat.com"
        },
        {
            "reply_message": "test",
            "message_reply_time": 1432552096863,
            "agent_id": 466,
            "first_name": "Subrata",
            "last_name": "Pappu",
            "email": "pappu-agent@revechat.com"
        },
        {
            "reply_message": "dummy message",
            "message_reply_time": 1431854505390,
            "agent_id": 464,
            "first_name": "Arafat",
            "last_name": "Mahmud",
            "email": "arafat-agent@revechat.com"
        },
        {
            "reply_message": "hy",
            "message_reply_time": 1431343882925,
            "agent_id": 465,
            "first_name": "nurnabi",
            "last_name": "Siddiquee",
            "email": "nurnabi-admin@revechat.com"
        }
    ]
}

Error 4xx

Name
Description

OfflineMessageNotFound

The id of the Offline message was not found.

Forbidden

Not Permitted

InvalidOfflineMessageID

Invalid Offline Message 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 Offline Message Id = 744. Please enter a another Offline Message Id."
		}
	    ]
}

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

Last updated