1-877-548-3001 Sign in About Contact
Developer

GET

/api/chat/{id}/history

Previous messages for the specified chat session

Scope:

client

or

operator

Request Parameters

Path

2

id

required

The id of the chat to get get history from

Query

2

limit

required

The maximum amount of messages to return

2

ending_message_id

required

The message id to start going back from

Response

Schema

{}

payload

The chat history data

{}

chat_fields

The list of chat fields

[]

{}

A

answer

The field answer

A

crm

The crm field name

A

field_info

The field info (field order, field id, crm field id)

jump_logic

The jump logic for the form layout

A

question

The chat field question

messages

The list of the chat messages

[]

{}

actionTaken

True if action was taken else false

addedToFaq

True if added to FAQs else false

A

chatMessage

The chat message

2

chatSessionDetailId

The chat session detail id

A

createdBy

The name of who created the message

A

createdTime

The date and time of the message

A

fromName

The name of who entered the message

A

lastPingTime

The last ping time

A

message

The chat message

2

messageId

The unique identifer of the chat message

A

messageStatus

The chat message status

2

messageSubType

The chat message sub type

2

messageType

The chat message type

2

operatorId

The operator id

postedToTheClient

True if message was posted to the client else false

postedToTheServer

True if message was posted to the server else false

2

sessionStateId

The chat session state id

A

visitorId

The visitor id

A

more_messages

True if more messages are available for the chat session else false

A

page_size

The number of records being returned

A

status

The system response status. Will be ok or error

curl

example request

1

curl -H "Authorization: Bearer {{Oauth Token}}"

2

https://developer.livehelpnow.net/api/chat/{{1234567}}/history\?limit\=20\&ending_message_id\=1288375640

example response

      
        

1

 {

2

   "payload": {

3

     "chat_fields": [{

4

       "answer"

: "john.doe@livehelpnow.com",

5

       "crm"

: "email",

6

       "field_info"

: "fld_1_4723_48",

7

       "jump_logic"

: [{"conditions": null, "actions": [{"email":{"email_address":"john.doe@livehelpnow.com"}},{"goto": 2}]}],

8

       "question"

: "what is your email?"

9

     }],

10

    "messages": [{

11

      "actionTaken"

: false,

12

      "addedToFaq"

: false,

13

      "chatMessage"

: "You are being transferred to John Doe...",

14

      "chatSessionDetailId"

: 1937456,

15

      "createdBy"

: "server",

16

      "createdTime"

: "2021-06-30T09:44:02",

17

      "fromName"

: "",

18

      "lastPingTime"

: "2021-06-30T09:44:02",

19

      "message"

: "You are being transferred to John Doe...",

20

      "messageId"

: 1288375640,

21

      "messageStatus"

: "sent",

22

      "messageSubType"

: 10,

23

      "messageType"

: 1,

24

      "operatorId"

: 0,

25

      "postedToTheClient"

: false,

26

      "postedToTheServer"

: false,

27

      "sessionStateId"

: 1,

28

      "visitorId"

: "dinghn4zbnskmlq5rkbaqi5m-1-98265432"

29

    }],

30

  "more_messages"

: true,

31

  "page_size"

: 15

32

  },

33

  "status": "ok"

34

 }