iFlyChat
  • Documentation
  • Installation
    • WordPress Chat Plugin
    • Drupal Chat Module
    • PHP Chat Client
  • WordPress
    • Embed Chatroom in WordPress Post
    • Disable Popup Chat
    • Hide Popup Chat from a Page
    • Embed Inbox View
    • View Chat Logs
    • Guest User Access
    • Show/Hide Popup Chat On Specific Pages
    • WordPress Filters and Hooks
  • API Reference
    • Create a new chat room
    • Retrieve list of all chat rooms
    • Edit a chat room
    • Retrieve list of all online users
    • Kick a user from the chat
    • Retrieve list of all users online in a chat room
    • Delete a chat room
    • Retrieve Thread History
  • JavaScript SDK
    • Quickstart
    • Custom Label In Chat Window
    • User Chat Button Widget
    • Reference
      • message receive
      • message send
      • user list update
      • connect
      • disconnect
      • ready
      • iflychat.startChat
      • iflychat.closeChat
      • iflychat.minimiseChat
      • iflychat.init
      • iflychat.setStatus
      • iflychat.sound
      • iflychat.openAdminDashboard
      • current user status update
      • current user sound update
      • iflychat.renderLabelInChatWindow
  • Help
    • General
      • Introduction
      • Accounts and Billing
      • Chat Theme and Colors
      • Chat Notification Sound
      • Going Offline
      • Change billing card information
    • Embedded Chatroom
      • Create a New Room
      • Create a New Embed Room
      • Embed Room in PHP
    • Feature Description
      • Moderated Chatroom
      • Group Chat
      • Private Embedded Chatroom
      • Change Guest Name
      • Resize Popup Chat Window
      • Mute Sound Notification
      • Change User Status
      • Desktop Notification
      • Popout or Full Screen Mode
      • Share Media Files
      • Video Chat
    • Chat Moderation
      • Kick/Ban/BanIP
      • Delete or Clear Messages
      • Popup Chat Position
      • Popup Chat Launcher Position
      • App Dashboard
      • Emoji Packs
      • Message Display Format
      • Time Display Format
      • Mobile Web Chat
      • Show Only Admins in Chat
      • Hide Recent Chats Section
      • Hide Users in Popup Chat List
      • Hide Popup Chat List
      • Minimize Popup Chat List
Powered by GitBook
On this page
  • Get messages of a chat room
  • Curl Command

Was this helpful?

  1. API Reference

Retrieve Thread History

Learn how to retrieve history of a particular chat room

Get messages of a chat room

POST https://api.iflychat.com/api/1.1/threads/get

This endpoint allows you to get history of a chat room programmatically

Request Body

Name
Type
Description

start_timestamp

string

The start timestamp (in milliseconds) of the range between which you want the thread history (optional)

end_timestamp

string

The end timestamp (in milliseconds) of the range between which you want the thread history (optional)

limit

string

The number of results to be returned (optional)

timezone_offset

string

The difference in milliseconds between UTC and your local time. The value should negative if the local timezone is behind UTC and positive if it is ahead. For example, if your time zone is UTC+5:30 hours (Indian Standard Time), the value would be 19800000(5.5x60x60x1000). The default value is 0 (optional)

room_id

string

This can be a string or an array. The string will contain the id of the room whose thread history you want to retrieve and the array will contain the id of the rooms whose thread history you want to retrieve.

api_key

string

The private API key of your website


[
 {
  "time": 1439793830,
  "from_id": "14",
  "room_id": "5",
  "from_name": "prateek",
  "room_name": "Mobile Room",
  "message": "hello",
  "message_id": "m_14_c-5_1439793800313"
  },
  {
  "time": 1440491549,
  "from_id": "0-14358329043yvbs",
  "room_id": "5",
  "from_name": "Guest Michael",
  "room_name": "General Room",
  "message": "how are you?",
  "message_id": "m_0-14358329043yvbs_c-5_1440491559161"
  },
  {
  "time": 1440491833,
  "from_id": "0-14358329043yvbs",
  "room_id": "5",
  "from_name": "Guest Michael",
  "room_name": "General Room",
  "message": "whats up?",
  "message_id": "m_0-14358329043yvbs_c-5_1440491842827"
 },
]

Curl Command

This the sample curl command required to make HTTP request:

curl -H "Content-Type: application/json" -X POST https://api.iflychat.com/api/1.1/threads/get -d 
"{\"api_key\": \"Wr4vpoJ_ET3lpBdX9E9TutUic4Dgb-gc7RGzuZvKqZgW5\",  \"room_id\": \"5\", \"start_timestamp\": \"1433142614\",    
\"end_timestamp\": \"1433154346\", \"limit\": \"3\"}" 
PreviousDelete a chat roomNextQuickstart

Last updated 4 years ago

Was this helpful?