tencent cloud

Chat

News and Announcements
Release Notes
Announcements
Product Introduction
Overview
Basic Concepts
Scenarios
Features
Account System
User Profile and Relationship Chain
Message Management
Group Related
Official Account
Audio/Video Call
Use Limits
Purchase Guide
Billing Overview
Pricing
Purchase Instructions
Renewal Guide
Service Suspension Explanation
Refund Policy
Development Guidelines
Demo Zone
Activate Service
Free Demos
Quick Run
Download
SDK and Demo Source Code
Update Log
Chat Interaction (UI Included)
TUIKit Introduction
Getting Started
Full-feature Integration
Single-function Integration
Build with AI
Build Basic Interfaces
More Features
Customizing Appearance
Internationalization
Push Service
Overview
Noun explanation
Activate the Service
Quick Start
Manufacturer Channel
Statistics
Troubleshooting Tool
Client APIs
REST API
Push Callback
Advanced Features
Release Notes
Error Codes
FAQS
Desk
Overview
Quick Start
Integration Guide
Admin Operation Manual
Agent Manual
More Practices
Live Streaming Setup Guide
AI Chatbot
Super Large Entertainment and Collaboration Community
Discord Implementation Guide
How to Integrate Chat into Games
WhatsApp Channel-style Official Account Integration Solution
Send Red Packet
Firewall Restrictions
No UI Integration
Quick Start
SDK Integration
Initialization
Login and Logout
Message
Conversation
Group
Community Topic
User Profile and Relationship Chain
Offline Push
Cloud Search
Local Search
Official Channel Management
Client APIs
JavaScript
Android
iOS & macOS
Swift
Flutter
Electron
Unity
React Native
C APIs
C++
Server APIs
Secure authentication with UserSig
RESTful APIs
Webhooks
Console Guide
New Console Introduction
Creating and Upgrading an Application
Basic Configuration
Feature Configuration
Account Management
Group Management
Official Channel Management
Webhook Configuration
Usage
Viewing Guide for Resource Packages
Real-Time Monitor
Auxiliary Development Tools
Access Management
Advanced Features
FAQs
uni-app FAQs
Purchase
SDK
Account Authentication
User Profile and Relationship Chain
Message
Group
Audio-Video Group
Nickname and Profile Photo
Security Compliance Certification
Service Level Agreement
Security Compliance Certification
Chat Policies
Privacy Policy
Data Privacy and Security Agreement
Migration
Migration Solutions
Migration Solutions Lite
Error Codes
Contact Us

JavaScript

PDF
Focus Mode
Font Size
Last updated: 2025-11-18 20:54:41

Feature Overview

Following feature allows users to follow other users they are interested in, so they can timely receive the latest news, feeds, or event information of these users. The system can provide personalized content recommendations based on the user's following list.
Followers feature refers to the state of a user being followed by others. When user A follows user B, A becomes a follower of B. Users can view the count of followers, followers list, or profile of followers on their own profile page.
Through the features, you can create an active, interconnected user network, promoting the spread of information and the building of the community.
Note:
This feature is only supported by the Pro, Pro-plus, and Enterprise Edition, Please purchase the Pro, Pro-plus, or Enterprise to use it.

UI Display



Following users

Note:
1. This interface supports following up to 20 users at a time (except for oneself, any other user can be followed).
2. Each user has an upper limit of 5000 followers, but there is no limit to the number of fans.
API
chat.followUser(options);
Parameters
Name
Type
Description
userIDList
Array.<String>
A list of user IDs, supporting following up to 20 users at a time.
Return value
Promise
Examples
let promise = chat.followUser(['user1', 'user2']); promise.then(function(imResponse) { console.log(imResponse.data); }).catch(function(imError) { console.warn('followUser error:', imError); });

Unfollowing users

Note:
This interface supports unfollowing up to 20 users at a time
API
chat.unfollowUser(options);
Parameters
Name
Type
Description
userIDList
Array.<String>
A list of user IDs, supporting unfollowing up to 20 users at a time.
Return value
Promise
Examples
let promise = chat.unfollowUser(['user1', 'user2']); promise.then(function(imResponse) { console.log(imResponse.data); }).catch(function(imError) { console.warn('followUser error:', imError); });

Getting my followers list

Note:
This API returns up to 500 users at a time.
API
chat.getMyFollowersList(nextCursor);
Parameters
Name
Type
Description
nextCursor
String | undefined
The starting position for pagination retrieval. The default is empty for the first page pull and can be omitted. When the retrieval is successful, nextCursor is not '',If pagination is needed, you can pass this value again to pull until nextCursor returns ''.
Return value
Promise
Examples
let promise = chat.getMyFollowersList(nextCursor); promise.then(function(imResponse) { const { resultList, nextCursor = '' } = imResponse.data; // ressultList - list of my followers // nextCursor - The identifier for continuing pagination pull if (nextCursor != '') { // do pagination pull } }).catch(function(imError) { console.warn('getMyFollowersList error:', imError); });

Getting my following list

Note:
This API returns up to 500 users at a time.
API
chat.getMyFollowingList(nextCursor);
Parameters
Name
Type
Description
nextCursor
String | undefined
The starting position for pagination retrieval. The default is empty for the first page pull and can be omitted. When the retrieval is successful, nextCursor is not '',If pagination is needed, you can pass this value again to pull until nextCursor returns ''.
Return value
Promise
Examples
let promise = chat.getMyFollowingList(); promise.then(function(imResponse) { const { resultList, nextCursor = '' } = imResponse.data; // ressultList - list of my following // nextCursor - The identifier for continuing pagination pull if (nextCursor != '') { // do pagination pull } }).catch(function(imError) { console.warn('getMyFollowingList error:', imError); });

Getting the mutual followers list

Note:
This API returns up to 500 users at a time.
API
chat.getMutualFollowersList(nextCursor);
Parameters
Name
Type
Description
nextCursor
String | undefined
The starting position for pagination retrieval. The default is empty for the first page pull and can be omitted. When the retrieval is successful, nextCursor is not '',If pagination is needed, you can pass this value again to pull until nextCursor returns ''.
Return value
Promise
Examples
let promise = chat.getMutualFollowersList();
promise.then(function(imResponse) {
const { resultList, nextCursor = '' } = imResponse.data;
// ressultList - mutual follo list
// nextCursor - The identifier for continuing pagination pull
if (nextCursor != '') {
// do pagination pull
}
}).catch(function(imError) {
console.warn('getMutualFollowersList error:', imError);
});

Getting the count of following/followers/mutual followers

API
chat.getUserFollowInfo(userIDList);
Parameters
Name
Type
Description
userIDList
Array.<String>
User ID list; if userIDList is not provided, it indicates obtaining the follow info for oneself.
Return value
Promise
Examples
// get the count of my following/followers/mutual followers
let promise = chat.getUserFollowInfo();
promise.then(function(imResponse) {
console.log(imResponse.data);
}).catch(function(imError) {
console.warn('getUserFollowInfo error:', imError);
});
// get the count of following/followers/mutual followers for specified users let promise = chat.getUserFollowInfo(['user1', 'user2']); promise.then(function(imResponse) { console.log(imResponse.data); }).catch(function(imError) { console.warn('getUserFollowInfo error:', imError); });

Checking follow type

API
chat.checkFollowType(userIDList);
Parameters
Name
Type
Description
userIDList
Array.<String>
List of user IDs to be checked; a single request supports up to 100 user IDs.
Return value
Promise
Examples
let promise = chat.checkFollowType(['user1', 'user2']);
promise.then(function(imResponse) {
console.log(imResponse.data);
imResponse.data.forEach((item) => {
// item.userID - userID
// item.followType - 0 - No relationship, 1 - my follower, 2 - my following, 3 - mutual followers
});
}).catch(function(imError) {
console.warn('checkFollowType error:', imError);
});


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback