Moderators - Get
Description
Returns all moderators in a channel.
Requires a user access token from the broadcaster that includes the moderation:read
scope.
If your app also adds and removes moderators, you can use the channel:manage:moderators
scope instead.
Method Definition
@RequestLine(value = "GET /moderation/moderators?broadcaster_id={broadcaster_id}&user_id={user_id}&after={after}&first={first}", collectionFormat = CollectionFormat.CSV)
@Headers("Authorization: Bearer {token}")
HystrixCommand<ModeratorList> getModerators(
@Param("token") String authToken,
@Param("broadcaster_id") String broadcasterId,
@Param("user_id") List<String> userIds,
@Param("after") String after,
@Param("first") Integer limit
);
Required Parameters
Name | Type | Description |
---|---|---|
authToken | string | User Token for the broadcaster (scope: moderation:read) |
broadcasterId | string | The ID of the broadcaster whose list of moderators you want to get. This ID must match the user ID in the access token. |
Optional Parameters
Name | Type | Description |
---|---|---|
userIds | string | Filters the results and only returns a status object for users who are moderators in this channel and have a matching user_id. The list is returned in the same order as you specified the IDs. |
after | string | Cursor for forward pagination: tells the server where to start fetching the next set of results, in a multi-page response. The cursor value specified here is from the pagination response field of a prior query. |
limit | integer | Maximum number of objects to return per page in the response. Maximum: 100. Default: 20. |
Code-Snippets
print list of moderators
- Java
- Kotlin
- Groovy
ModeratorList resultList = twitchClient.getHelix().getModerators(authToken, broadcasterId, null, null, null).execute();
resultList.getModerators().forEach(moderator -> {
System.out.println(moderator);
});
val resultList = twitchClient.helix.getModerators(authToken, broadcasterId, null, null, null).execute()
resultList.moderators.forEach { moderator ->
println(moderator)
}
def resultList = twitchClient.helix.getModerators(authToken, broadcasterId, null, null, null).execute()
resultList.moderators.each { moderator ->
System.out.println moderator
}