Getting list of users per channel on Flutter

Hi,

I’ve been trying to get a list of all users per channel on Flutter using either websockets, the flutter SDK or even trying the web APIs on the Swagger doc but some APIs doesn’t give me the complete list of all users for each channel. I ve got a channel type Private Community with 2 users, same permissions for each and here’s what I tried:

  • /api/v3/channels doesn’t give all users in the response “ChannelUsers” nor “Users”
  • /api/v3/channels/{channelId} doesn’t do it either
  • the websockets “v3/channel.query” and “v3/channel.get” don’t do it either
  • the flutter UKit is a mess with sockets connections, SDK calls and no consistency
  • /api/v4/channels/{channelId}/users only this API does give me my 2 users in ChannelUsers and Users

Why are the results so inconsistent between the APIs? Do I have to mix and match sockets, web Apis and SDKs to get all my channels informations?

What is the difference between ChannelUsers and Users?

Where can I find all the websockets opened for connection?

Thank you for your help!

@cedBYW I understand your concerns and apologize for any confusion. The inconsistency might be due to different API versions and their features.

The /api/v3/channels and /api/v3/channels/{channelId} endpoints are designed for channel management and may not list all users.

For getting a list of users per channel on Flutter, please refer to this documentation: Query Members.

Thank you for your understanding. If you have any further questions or need additional assistance, please let us know.

Thank you for your message. The SDK function given in the doc works correctly.

It doesn’t fix the inconsistency in the data and code:

The /api/v3/channels and /api/v3/channels/{channelId} endpoints are designed for channel management and may not list all users.

Why it “may” not? Why give them at all if it’s not consistent? The API versioning doesn’t mean you can’t fix previous versions if data is wrong.

Why is the flutter UIKit mixing sockets and SDK calls for queries if the SDK is the official way to go in the documentation?

Thank you for your help!

Hello, we apologise if our previous explanation was unclear. If you are using Flutter, we recommend using the following function: https://docs.amity.co/amity-sdk/chat/channels/query-members.

There is no need to directly interact with the websockets, as our SDK is designed to handle that for you. If you prefer to use the API, the appropriate endpoint would be /api/v4/channels/{channelId}/users.