Jump to: navigation, search

Get Messages

Overview

This request gets all messages associated with a chat interaction, based on a specified position in the transcript.

Request URL /api/v2/chats/{chatId}/messages
HTTP Method POST

Parameters

Parameter Name Sample Value Description Required/Optional
userId "007553863DC30029" User ID Required
secureKey "8b31761b2154884c" Secure key Required
alias "117" Host alias Required
tenantName "Environment" Tenant name Required
transcriptPosition
  • 0 (no messages)
  • 1 (all messages)
  • 2 (all messages starting from 2nd message)
The index position in the transcript starting from which the messages should be retrieved Optional (all messages are retrieved if no value is provided, which defaults to 1)

Example

Request

{
  "alias" : "117",
  "secureKey" : "8b31761b2154884c",
  "userId" : "007553863DC30029",
  "tenantName": "Environment",
  "transcriptPosition": 5
}

Response

{
 "statusCode":0,
 "messages":[
  {
 "from":{
 "nickname":"nickname",
 "participantId":1,
 "type":"Client"
   },
 "index":1,
 "type":"ParticipantJoined",
   "utcTime":1406239877000
  },
  {
 "from":{
 "nickname":"system",
 "participantId":2,
 "type":"External"
   },
 "index":2,
 "type":"ParticipantJoined",
   "utcTime":1406239880000
  },
  {
 "from":{
 "nickname":"system",
 "participantId":2,
 "type":"External"
   },
 "index":3,
 "text":"agent will be with you shortly ...",
 "type":"Message",
   "utcTime":1406239880000
  },
  {
 "from":{
 "nickname":"system",
 "participantId":2,
 "type":"External"
   },
 "index":4,
 "text":"agent will be with you shortly ...",
 "type":"Message",
   "utcTime":1406239898000
  },
  {
 "from":{
 "nickname":"system",
 "participantId":2,
 "type":"External"
   },
 "index":5,
 "text":"agent will be with you shortly ...",
 "type":"Message",
   "utcTime":1406239916000
  },
  {
 "from":{
 "nickname":"nickname",
 "participantId":1,
 "type":"Client"
   },
 "index":6,
 "text":"I need help with account",
 "type":"Message",
   "utcTime":1406239925000
  },
  {
 "from":{
 "nickname":"system",
 "participantId":2,
 "type":"External"
   },
 "index":7,
 "text":"agent will be with you shortly ...",
 "type":"Message",
   "utcTime":1406239934000
  },
  {
 "from":{
 "nickname":"nickname",
 "participantId":1,
 "type":"Client"
   },
 "index":8,
 "text":"I need help with account",
 "type":"TypingStarted",
   "utcTime":1406239944000
  },
  {
 "from":{
 "nickname":"nickname",
 "participantId":1,
 "type":"Client"
   },
 "index":9,
 "text":"I need help with account",
 "type":"TypingStopped",
   "utcTime":1406239951000
  },
  {
 "from":{
 "nickname":"system",
 "participantId":2,
 "type":"External"
   },
   "index":10,
 "text":"agent will be with you shortly ...",
 "type":"Message",
   "utcTime":1406239952000
  },
  {
 "from":{
 "nickname":"nickname",
 "participantId":1,
 "type":"Client"
   },
   "index":11,
 "text":"text text",
 "type":"Message",
   "utcTime":1406239965000
  },
  {
 "from":{
 "nickname":"system",
 "participantId":2,
 "type":"External"
   },
   "index":12,
 "text":"agent will be with you shortly ...",
 "type":"Message",
   "utcTime":1406239971000
  },
  {
 "from":{
 "nickname":"system",
 "participantId":2,
 "type":"External"
   },
   "index":13,
 "text":"agent will be with you shortly ...",
 "type":"Message",
   "utcTime":1406239989000
  },
  {
 "from":{
 "nickname":"nickname",
 "participantId":1,
 "type":"Client"
   },
   "index":14,
 "text":"nickname",
 "type":"Notice",
   "utcTime":1407445236000
  },
  {
 "from":{
 "nickname":"nickname",
 "participantId":1,
 "type":"Client"
   },
   "index":15,
 "text":"http://push-url",
 "type":"Notice",
   "utcTime":1407445262000
  }
 ],
 "alias":"117",
 "secureKey":"b89d1c2714b01389",
 "userId":"007553D184850003",
 "tenantName":"Environment",
 "chatEnded":false
}
This page was last edited on December 8, 2014, at 17:07.
Comments or questions about this documentation? Contact us for support!