Users - Get
Description
Gets information about one or more specified Twitch users. Users are identified by optional user IDs and/or login name. If neither a user ID nor a login name is specified, the user is looked up by Bearer token.
To include the user’s verified email address in the response, you must use a user access token that includes the user:read:email
scope (and matches their ID).
Method Definition
@RequestLine("GET /users?id={id}&login={login}")
@Headers("Authorization: Bearer {token}")
HystrixCommand<UserList> getUsers(
@Param("token") String authToken,
@Param("id") List<String> userIds,
@Param("login") List<String> userNames
);
Required Parameters
Name | Type | Description |
---|---|---|
authToken | string | User or App Access Token. |
Optional Parameters
Name | Type | Description |
---|---|---|
id | string | User ID. Multiple user IDs can be specified. Limit: 100 . |
login | string | User login name. Multiple login names can be specified. Limit: 100 . |
Code-Snippets
print user list - search by id
- Java
- Kotlin
- Groovy
UserList resultList = twitchClient.getHelix().getUsers(null, Arrays.asList("149223493"), null).execute();
resultList.getUsers().forEach(user -> {
System.out.println(user);
});
val resultList = twitchClient.helix.getUsers(null, listOf("149223493"), null).execute()
resultList.users.forEach { user ->
println(user)
}
def resultList = twitchClient.helix.getUsers(null, ["149223493"], null).execute()
resultList.users.forEach { user ->
System.out.println user
}
print user list - search by name
- Java
- Kotlin
- Groovy
UserList resultList = twitchClient.getHelix().getUsers(null, null, Arrays.asList("twitch4j")).execute();
resultList.getUsers().forEach(user -> {
System.out.println(user);
});
val resultList = twitchClient.helix.getUsers(null, null, listOf("twitch4j")).execute()
resultList.users.forEach { user ->
println(user)
}
def resultList = twitchClient.helix.getUsers(null, null, ["twitch4j"]).execute()
resultList.users.each { user ->
System.out.println user
}