Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Returns chat transcripts with the specified user among the participants. Optionally, it's possible to limit returned transcripts to last x days via query string parameter.

Status
colourGreen
titleHTTP GET
/livechat/:domain/getChatTranscriptByUserID/:userId

Path Variables:

Name

Mandatory

Type

Description

domain

Status
colourRed
titleyes

Status
titlestring

Unique domain identifier

userId

Status
colourRed
titleYES

Status
titleSTRING

Unique user identifier

...

Authorization: see Authentication mechanisms

Query string parameter:

Name

Mandatory

Type

Description

ctlivetoken

days

Status

colourRed

title

YES

no

Status
title

STRINGUnique ctlive session identifier

string

Indicates that the returned transcripts will refer to chats made within the number of days prior to the time of the web service call

Response:

Type:
Status
titleJSON

Name

Type

Description

result

Status
titleboolean

If true, the service response was performed correctly

chatTranscript

Status
titlearray

Array that contains Transcript Object with the specified user among the participants

error

Status
titlenull
/
Status
titlestring

Contains the error description if an error has occurred in the request

Example:

Request

http://<hostname>:<port>/livechat/default/getChatTranscriptByUserID/USER_c8e1eb84-60d3-4d69-b10b-96364845023e?days=7

Response

Code Block
languagejson
{ 
   "result":true,
   "chatTranscripts":[ 
      { 
         "result":true,
         "transcript":{ 
            "messages":[ 
               { 
                  "data":{ 
                     "id":"5331c71f-46e7-4f5c-acbb-d7d0eaf0813c",
                     "messageType":"TEXT",
                     "content":{ 
                        "text":"hello",
                        "user":{ 
                           "id":"USER_gverde1@acd.enghouse.com",
                           "isAgent":true
                        }
                     },
                     "ts":1569248116642
                  },
                  "_id":"5d88d3951190da27f4fecedb",
                  "room":"CHAT_0addc50f-6866-40d1-bcbd-9da802c3fb9e"
               },
               { 
                  "data":{ 
                     "id":"a3a15ff2-7de3-4677-bfce-1a3ed26097e3",
                     "messageType":"TEXT",
                     "content":{ 
                        "text":"hi",
                        "user":{ 
                           "id":"USER_c8e1eb84-60d3-4d69-b10b-96364845023e",
                           "isAgent":false
                        }
                     },
                     "ts":1569248120015
                  },
                  "_id":"5d88d3951190da27f4feceda",
                  "room":"CHAT_0addc50f-6866-40d1-bcbd-9da802c3fb9e"
               },
               { 
                  "data":{ 
                     "id":"ea10e6ef-e461-4a95-aeeb-22eb1cfe2de5",
                     "messageType":"IMAGE",
                     "ts":1569248133529
                  },
                  "_id":"5d88d3951190da27f4feced9",
                  "room":"CHAT_0addc50f-6866-40d1-bcbd-9da802c3fb9e"
               },
               { 
                  "data":{ 
                     "id":"d0f9d131-29ef-41f0-b2ed-0d90bf769d6c",
                     "messageType":"TEXT",
                     "content":{ 
                        "text":"bye",
                        "user":{ 
                           "id":"USER_gverde1@acd.enghouse.com",
                           "isAgent":true
                        }
                     },
                     "ts":1569248144629
                  },
                  "_id":"5d88d3951190da27f4feced8",
                  "room":"CHAT_0addc50f-6866-40d1-bcbd-9da802c3fb9e"
               }
            ],
            "_id":"5d88d3951190da27f4feced7",
            "room":"CHAT_0addc50f-6866-40d1-bcbd-9da802c3fb9e",
            "__v":0
         }
      },
      { 
         "result":true,
         "transcript":{ 
            "messages":[ 
               { 
                  "data":{ 
                     "id":"551b9dbc-8de8-46a1-89c4-b617f9d7e98e",
                     "messageType":"TEXT",
                     "content":{ 
                        "text":"hello there",
                        "user":{ 
                           "id":"USER_c8e1eb84-60d3-4d69-b10b-96364845023e",
                           "isAgent":false
                        }
                     },
                     "ts":1569248228779
                  },
                  "_id":"5d88d3f91190da27f4fecee2",
                  "room":"CHAT_4910ea9a-0e43-4dea-9418-fb913cbf9a64"
               },
               { 
                  "data":{ 
                     "id":"e34246cf-e057-44e7-ba5b-45cd5be4c55f",
                     "messageType":"TEXT",
                     "content":{ 
                        "text":"hello",
                        "user":{ 
                           "id":"USER_gverde1@acd.enghouse.com",
                           "isAgent":true
                        }
                     },
                     "ts":1569248236845
                  },
                  "_id":"5d88d3f91190da27f4fecee1",
                  "room":"CHAT_4910ea9a-0e43-4dea-9418-fb913cbf9a64"
               },
               { 
                  "data":{ 
                     "id":"44c1c289-941a-4680-829f-9ea3757b7b78",
                     "messageType":"TEXT",
                     "content":{ 
                        "text":"bye",
                        "user":{ 
                           "id":"USER_c8e1eb84-60d3-4d69-b10b-96364845023e",
                           "isAgent":false
                        }
                     },
                     "ts":1569248242051
                  },
                  "_id":"5d88d3f91190da27f4fecee0",
                  "room":"CHAT_4910ea9a-0e43-4dea-9418-fb913cbf9a64"
               }
            ],
            "_id":"5d88d3f91190da27f4fecedf",
            "room":"CHAT_4910ea9a-0e43-4dea-9418-fb913cbf9a64",
            "__v":0
         }
      }
   ],
   "error":null
}

...