chat.followUser(options);
Name | Type | Description |
userIDList | Array.<String> | A list of user IDs, supporting following up to 20 users at a time. |
Promise
let promise = chat.followUser(['user1', 'user2']);promise.then(function(imResponse) {console.log(imResponse.data);}).catch(function(imError) {console.warn('followUser error:', imError);});
chat.unfollowUser(options);
Name | Type | Description |
userIDList | Array.<String> | A list of user IDs, supporting unfollowing up to 20 users at a time. |
Promise
let promise = chat.unfollowUser(['user1', 'user2']);promise.then(function(imResponse) {console.log(imResponse.data);}).catch(function(imError) {console.warn('followUser error:', imError);});
chat.getMyFollowersList(nextCursor);
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 '' . |
Promise
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 pullif (nextCursor != '') {// do pagination pull}}).catch(function(imError) {console.warn('getMyFollowersList error:', imError);});
chat.getMyFollowingList(nextCursor);
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 '' . |
Promise
let promise = chat.getMyFollowingList();promise.then(function(imResponse) {const { resultList, nextCursor = '' } = imResponse.data;// ressultList - list of my following// nextCursor - The identifier for continuing pagination pullif (nextCursor != '') {// do pagination pull}}).catch(function(imError) {console.warn('getMyFollowingList error:', imError);});
chat.getMutualFollowersList(nextCursor);
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 '' . |
Promise
let promise = chat.getMutualFollowersList();promise.then(function(imResponse) {const { resultList, nextCursor = '' } = imResponse.data;// ressultList - mutual follo list// nextCursor - The identifier for continuing pagination pullif (nextCursor != '') {// do pagination pull}}).catch(function(imError) {console.warn('getMutualFollowersList error:', imError);});
chat.getUserFollowInfo(userIDList);
Name | Type | Description |
userIDList | Array.<String> | User ID list; if userIDList is not provided, it indicates obtaining the follow info for oneself. |
Promise
// get the count of my following/followers/mutual followerslet 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 userslet promise = chat.getUserFollowInfo(['user1', 'user2']);promise.then(function(imResponse) {console.log(imResponse.data);}).catch(function(imError) {console.warn('getUserFollowInfo error:', imError);});
chat.checkFollowType(userIDList);
Name | Type | Description |
userIDList | Array.<String> | List of user IDs to be checked; a single request supports up to 100 user IDs. |
Promise
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);});
Was this page helpful?