TapTalk.io Documentation
  • Introduction
  • OneTalk Omnichannel Documentation
    • Getting Started with OneTalk
      • Team Members
      • Add Topic
      • Assign Agent to Topic
      • Paid Proactive Chat
    • Channel Integration
      • Telegram Integration
      • WhatsApp SME Integration
      • Instagram DM Integration
      • Facebook Messenger Integration
      • Live Chat Integration (iOS, Android, Web)
        • OneTalk Live Chat for Android
          • Get Started
          • Event Listener
          • Authentication
          • Case & Topic
          • Navigate Live Chat UI
          • Customize UI Appearance
        • OneTalk Live Chat for iOS
          • Get Started
          • Background Process in TapTalk.io Omnichannel iOS
          • Event Delegate
          • Authentication
          • Case & Topic
          • Navigate Live Chat UI
          • Customize UI Appearance
        • OneTalk Live Chat for Web
          • Get Started
          • Callback
          • Method
        • OneTalk Live Chat for React Native
          • Get Started - Android
          • Authentication - Android
          • Get Started - iOS
          • Authentication - iOS
        • OneTalk Live Chat for Flutter
          • Get Started - Android
          • Get Started - iOS
      • Google Business Messages Integration
      • Google Business Profile Integration
      • Tokopedia Integration
    • Integration API
      • Inbox API
      • User/Contact API
    • Live Chat Widget Callback Function
    • Social Channel Button
    • Custom Chatbot Integration
      • Get Started
      • Edit or Delete Chatbot
      • Development
    • QnA via API
    • Webhook
  • PowerTalk Chat SDK Documentation
    • Getting Started with PowerTalk
    • PowerTalk Android
      • Get Started
      • Enable Chat Features
      • Authentication
      • TapUI and TapCore
      • Background Process in TapTalk.io
      • Connection
      • Event Listener
      • Push Notification
      • General
      • User
      • Room List
        • Room List - TapUI
        • Room List - TapCore
      • Chat Room and Messages
        • Chat Room and Messages - TapUI
        • Chat Room and Messages - TapCore
      • Contact
      • Message Type
      • Customize UI Appearance
      • Customize Chat Features
      • Customize Chat Message Bubble
      • Customize Navigation Bar
      • Deep Linking
      • Error Codes
    • PowerTalk iOS
      • Get Started
      • TapUI and TapCore
      • Background Process in TapTalk.io
      • Implement Application Delegate
      • Authentication
      • Connection
      • Event Delegate
      • Push Notification
      • General
      • User
      • Room List
        • Room List - TapUI
        • Room List - TapCore
      • Chat Room and Messages
        • Chat Room and Messages - TapUI
        • Chat Room and Messages - TapCore
      • Contact
      • Message Type
      • Customize UI Appearance
      • Customize Chat Features
      • Customize Chat Message Bubble
      • Customize Navigation Bar
      • Deep Linking
      • Error Codes
    • PowerTalk React Native
      • Get Started - Android
      • Get Started - iOS
    • PowerTalk Flutter
      • Get Started - Android
      • Get Started - iOS
    • Javascript SDK
      • Get Started
      • Authentication
      • Connection
      • General
      • Event Listener
      • User
      • Room List
      • Chat Room
      • Messages
      • Contact
      • Message Type
    • Server API
      • Get Started
      • Base URL
      • Authentication
      • User
      • Contact
      • Message
      • Room
    • Webhook
      • Get Started
      • Webhook Payload
  • MeetTalk SDK Documentation
    • Getting Started with MeetTalk
    • MeetTalk Android
      • Get Started
      • Event Listener
    • MeetTalk iOS
      • Get Started
      • Implement Application Delegate
      • Event Delegate
  • SendTalk API Documentation
    • Introduction
    • Whatsapp Verification
Powered by GitBook
On this page
  • Get Personal Chat Room with Recipient User Model
  • Get Personal Chat Room with Recipient User ID
  • Get Personal Chat Room with Recipient XC User ID
  • Create Group Chat Room
  • Create Group Chat Room With Group Image
  • Get Group Chat Room
  • Update Group Chat Room Details
  • Update Group Image
  • Delete Group Chat Room
  • Leave Group Chat
  • Add Members to Group Chat
  • Remove Members from Group Chat
  • Promote Group Admin
  • Demote Group Admin
  • Send Start Typing
  • Send Stop Typing
  • Get Room Media
  • Mark Chat Room as Unread
  • Get Marked as Unread Chat Room List
  • Delete All Chat Room Messages
  • Get Group In Common

Was this helpful?

  1. PowerTalk Chat SDK Documentation
  2. Javascript SDK

Chat Room

You can use the methods from the TapCoreChatRoomManager class to manage chat rooms.

Method Name

Description

Create new personal chat room with recipient user, or obtain chat room data if it already exists.

Create new personal chat room with recipient user ID, or obtain chat room data if it already exists.

Create new personal chat room with recipient XC user ID, or obtain chat room data if it already exists.

Create a new group chat room with selected group name.

Create a new group chat room with selected group name and group picture.

Get group room data from selected group room ID.

Update existing group chat room data.

Update group picture with current selected image.

Delete group chat room and clear all chat data and participants.

Leave from selected group chat.

Add selected member(s) to current group chat room.

Remove selected member(s) from current group chat room.

Promote selected member(s) as admin(s) to the current group chat room.

Demote selected admin(s) to member(s) to the current group chat room.

Notify that the active user has started typing in the selected room.

Notify that the active user has stopped typing in the selected room.

Retrieve existing media messages from a chat room

Mark a chat room as unread by the active user.

Get a list of chat rooms marked as unread by the active user.

Clear all existing messages in a selected chat room for the active user.

Get Personal Chat Room with Recipient User Model

Create new personal chat room with recipient user, or obtain chat room data if it already exists.

var roomModel = tapCoreChatRoomManager.createRoomWithOtherUser(RECIPIENT_USER)

Parameters

RECIPIENT_USER: (TAPUserModel) recipient user data

Get Personal Chat Room with Recipient User ID

Create new personal chat room with recipient user ID, or obtain chat room data if it already exists.

tapCoreChatRoomManager.createRoomWithuserID(RECIPIENT_ID, (roomModel) => {
   // do action here
})

Parameters

RECIPIENT_ID: (String) user ID of recipient

Get Personal Chat Room with Recipient XC User ID

Create new personal chat room with recipient user ID, or obtain chat room data if it already exists.

tapCoreChatRoomManager.createRoomWithXCuserID(XC_USER_ID, (roomModel) => {
   // do action here
})

Parameters

XC_USER_ID: (String) XC user ID of recipient

Create Group Chat Room

Create a new group chat room with selected group name.

tapCoreChatRoomManager.createGroupChatRoom(GROUP_NAME, PARTICIPANT_LIST, {
      onSuccess : (roomModel) => {
         // do action here
      },
      onError: (errorCode, errorMessage) => {
         // do action here     
      }
})

Parameters GROUP_NAME: (String) your group name PARTICIPANT_LIST: (List) list of the group participant's user IDs

Create Group Chat Room With Group Image

Create a new group chat room with selected group name and group picture.

tapCoreChatRoomManager.createGroupChatRoomWithPicture(GROUP_NAME, PARTICIPANT_LIST, IMAGE_FILE, {
      onSuccess : (roomModel) => {
         // do action here
      },
      onError: (errorCode, errorMessage) => {
         // do action here     
      }
})

Parameters GROUP_NAME: (String) name of the group chat room to create PARTICIPANT_LIST: (List) list of the group participant's user IDs IMAGE_FILE: (File) picture to be uploaded as the group's profile

Get Group Chat Room

Get group room data from selected group room ID.

tapCoreChatRoomManager.getGroupChatRoom(GROUP_ID, {
      onSuccess : (response) => {
         // do action here
      },
      onError: (errorCode, errorMessage) => {
         // do action here     
      }
})

Parameters GROUP_ID: (String) room ID of group

Update Group Chat Room Details

Create a new Update existing group chat room data.

tapCoreChatRoomManager.updateGroupChatRoomDetails(GROUP_ID, GROUP_NAME, {
      onSuccess : (roomModel) => {
         // do action here
      },
      onError: (errorCode, errorMessage) => {
         // do action here     
      }
})

Parameters GROUP_ID: (String) room ID of group GROUP_NAME: (String) name of group

Update Group Image

Update group picture with current selected image.

tapCoreChatRoomManager.updateGroupPicture(GROUP_ID, IMAGE_FILE, {
      onSuccess : (roomModel) => {
         // do action here
      },
      onError: (errorCode, errorMessage) => {
         // do action here     
      }
})

Parameters GROUP_ID: (String) room ID of the selected group IMAGE_FILE: (File) new picture for the group's profile

Delete Group Chat Room

Delete group chat room and clear all chat data and participants.

tapCoreChatRoomManager.deleteGroupChatRoom(ROOM_ID, {
      onSuccess : (response) => {
         // do action here
      },
      onError: (errorCode, errorMessage) => {
         // do action here     
      }
})

Parameters ROOM_ID: (String) a room id of the group to delete

Leave Group Chat

Leave from selected group chat.

tapCoreChatRoomManager.leaveGroupChatRoom(GROUP_ID, {
      onSuccess : (isSuccess, responseMessage) => {
         // do action here
      },
      onError: (errorCode, errorMessage) => {
         // do action here     
      }
})

Parameters GROUP_ID: (String) room ID of the selected group

Add Members to Group Chat

Add selected member(s) to current group chat room.

tapCoreChatRoomManager.addGroupChatMembers(GROUP_ID, USER_IDs, {
      onSuccess : (roomModel) => {
         // do action here
      },
      onError: (errorCode, errorMessage) => {
         // do action here     
      }
})

Parameters GROUP_ID: (String) room ID of the selected group USER_IDs: (List) list of the user IDs to add to the group

Remove Members from Group Chat

Remove selected member(s) from current group chat room.

tapCoreChatRoomManager.removeGroupChatMembers : (GROUP_ID, USER_IDs, {
      onSuccess : (roomModel) => {
         // do action here
      },
      onError: (errorCode, errorMessage) => {
         // do action here     
      }
})

Parameters GROUP_ID: (String) room ID of the selected group USER_IDs: (List) list of the user IDs to add to the group

Promote Group Admin

Promote selected member(s) as admin(s) to the current group chat room.

tapCoreChatRoomManager.promoteGroupAdmins(GROUP_ID, USER_IDs, {
      onSuccess : (roomModel) => {
         // do action here
      },
      onError: (errorCode, errorMessage) => {
         // do action here     
      }
})

Parameters GROUP_ID: (String) room ID of the selected group USER_IDs: (List) list of the user IDs to add to the group

Demote Group Admin

Demote selected admin(s) to member(s) to the current group chat room.

tapCoreChatRoomManager.demoteGroupAdmins(GROUP_ID, USER_IDs, {
      onSuccess : (roomModel) => {
         // do action here
      },
      onError: (errorCode, errorMessage) => {
         // do action here     
      }
})

Parameters GROUP_ID: (String) room ID of the selected group USER_IDs: (List) list of the user IDs to add to the group

Send Start Typing

Notify that the active user has started typing in the selected room.

tapCoreChatRoomManager.sendStartTypingEmit(roomID)

Parameters

ROOM_ID: (String) ID of the room where the user starts typing in

Send Stop Typing

Notify that the active user has stopped typing in the selected room.

tapCoreChatRoomManager.sendStopTypingEmit(roomID)

Get Room Media

tapCoreChatRoomManager.getRoomMedia(ROOM_ID, {
     onSuccess: (response) => {
             //do action here
     },
     onError: (errorCode, errorMessage) => {
            // do action here
     }
 }, minCreated = 0)

Parameters ROOM_ID: (String) Group ID MIN_CREATED: (Long) Minimum Created Time in Millisecond. Leave empty if unnecessary

Mark Chat Room as Unread

You can mark your chat room as unread.

tapCoreChatRoomManager.markChatRoomAsUnread(ROOM_ID, {
    onSuccess: (res) => {
        // do action here
    },
    onError: (errCode, errMessage) => {
        // do action here
    }
});

ROOM_ID: (Number) room id CALLBACK: (Object) object of callback methods

Get Marked as Unread Chat Room List

You can retrieve unread room list.

tapCoreChatRoomManager.getMarkedAsUnreadChatRoomList({
    onSuccess: (res) => {
        // do action here
    },
    onError: (errCode, errMessage) => {
        // do action here
    }
});

CALLBACK: (Object) object of callback methods

Delete All Chat Room Messages

Use the deleteAllChatRoomMessages: method from the TapCoreChatRoomManager class to clear all existing messages in a selected chat room for the active user. The selected messages will only be deleted for the active user, and will not affect the other participants in the selected room.

tapCoreChatRoomManager.deleteAllChatRoomMessages(ROOM_IDS, {
    onSuccess: (res) => {
        // do action here
    },
    onError: (err) => {
        // do action here
    }
})

ROOM_IDS: (Array<Number>) IDs of the target rooms to delete the messages from

Get Group In Common

You can retrieve group in common list.

tapCoreChatRoomManager.fetchGroupInCommon(USER_ID, {
    onSuccess: (res) => {
        // do action here
    },
    onError: (errCode, errMessage) => {
        // do action here
    }
});

USER_ID: (Number) user id CALLBACK: (Object) object of callback methods

PreviousRoom ListNextMessages

Last updated 2 years ago

Was this helpful?

​Get Personal Chat Room with Recipient User​
​Get Personal Chat Room with Recipient User ID​
​Get Personal Chat Room with Recipient XC User ID​
Create Group Chat Room
Create Group Chat Room with Picture
Get Group Chat Room
Update Group Chat Room Details
Update Group Image
Delete Group Chat Room
Leave Group Chat
Add Members to Group Chat
Remove Members from Group Chat
Promote Group Admin
Demote Group Admin
Start Typing
Stop Typing
Get Room Medias
Mark Chat Room as Unread
Get Marked as Unread Chat Room List
Delete All Chat Room Messages