TwitchLib 3.5.3
Loading...
Searching...
No Matches
TwitchLib.Api.Helix.Users Class Reference

User related APIs More...

Inheritance diagram for TwitchLib.Api.Helix.Users:
TwitchLib.Api.Core.ApiBase

Public Member Functions

 Users (IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http)
 
Task< GetUserBlockListResponseGetUserBlockListAsync (string broadcasterId, int first=20, string after=null, string accessToken=null)
 Gets a specified user’s block list. More...
 
Task BlockUserAsync (string targetUserId, BlockUserSourceContextEnum? sourceContext=null, BlockUserReasonEnum? reason=null, string accessToken=null)
 Blocks the specified user on behalf of the authenticated user. More...
 
Task UnblockUserAsync (string targetUserId, string accessToken=null)
 Unblocks the specified user on behalf of the authenticated user. More...
 
Task< GetUsersResponseGetUsersAsync (List< string > ids=null, List< string > logins=null, string accessToken=null)
 Gets information about one or more specified Twitch users. More...
 
Task< GetUsersFollowsResponseGetUsersFollowsAsync (string after=null, string before=null, int first=20, string fromId=null, string toId=null, string accessToken=null)
 Gets information on follow relationships between two Twitch users. More...
 
Task UpdateUserAsync (string description, string accessToken=null)
 Updates the description of a user specified by the bearer token. More...
 
Task< GetUserExtensionsResponseGetUserExtensionsAsync (string accessToken=null)
 Gets a list of all extensions (both active and inactive) for a specified user, identified by a Bearer token. More...
 
Task< GetUserActiveExtensionsResponseGetUserActiveExtensionsAsync (string userid=null, string accessToken=null)
 Gets information about active extensions installed by a specified user, identified by a user ID or Bearer token. More...
 
Task< GetUserActiveExtensionsResponseUpdateUserExtensionsAsync (IEnumerable< ExtensionSlot > userExtensionStates, string accessToken=null)
 Updates the activation state, extension ID, and/or version number of installed extensions for a specified user, identified by a Bearer token. More...
 
- Public Member Functions inherited from TwitchLib.Api.Core.ApiBase
 ApiBase (IApiSettings settings, IRateLimiter rateLimiter, IHttpCallHandler http)
 
async ValueTask< string > GetAccessTokenAsync (string accessToken=null)
 

Additional Inherited Members

- Protected Member Functions inherited from TwitchLib.Api.Core.ApiBase
async Task< string > TwitchGetAsync (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchGetGenericAsync< T > (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchPatchGenericAsync< T > (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< string > TwitchPatchAsync (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< KeyValuePair< int, string > > TwitchDeleteAsync (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchPostGenericAsync< T > (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchPostGenericModelAsync< T > (string resource, ApiVersion api, RequestModel model, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchDeleteGenericAsync< T > (string resource, ApiVersion api, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< T > TwitchPutGenericAsync< T > (string resource, ApiVersion api, string payload=null, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< string > TwitchPutAsync (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
async Task< KeyValuePair< int, string > > TwitchPostAsync (string resource, ApiVersion api, string payload, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, string clientId=null, string customBase=null)
 
Task PutBytesAsync (string url, byte[] payload)
 
async Task< T > GetGenericAsync< T > (string url, List< KeyValuePair< string, string > > getParams=null, string accessToken=null, ApiVersion api=ApiVersion.Helix, string clientId=null)
 
- Protected Attributes inherited from TwitchLib.Api.Core.ApiBase
readonly IApiSettings Settings
 

Detailed Description

User related APIs

Constructor & Destructor Documentation

◆ Users()

TwitchLib.Api.Helix.Users.Users ( IApiSettings  settings,
IRateLimiter  rateLimiter,
IHttpCallHandler  http 
)

Member Function Documentation

◆ BlockUserAsync()

Task TwitchLib.Api.Helix.Users.BlockUserAsync ( string  targetUserId,
BlockUserSourceContextEnum sourceContext = null,
BlockUserReasonEnum reason = null,
string  accessToken = null 
)

Blocks the specified user on behalf of the authenticated user.

Required scope: user:manage:blocked_users

Parameters
targetUserIdUser ID of the user to be blocked.
sourceContextSource context for blocking the user.
reasonReason for blocking the user.
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ GetUserActiveExtensionsAsync()

Task< GetUserActiveExtensionsResponse > TwitchLib.Api.Helix.Users.GetUserActiveExtensionsAsync ( string  userid = null,
string  accessToken = null 
)

Gets information about active extensions installed by a specified user, identified by a user ID or Bearer token.

Required scope: user:read:broadcast or user:edit:broadcast

Parameters
userid
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ GetUserBlockListAsync()

Task< GetUserBlockListResponse > TwitchLib.Api.Helix.Users.GetUserBlockListAsync ( string  broadcasterId,
int  first = 20,
string  after = null,
string  accessToken = null 
)

Gets a specified user’s block list.

The list is sorted by when the block occurred in descending order (i.e. most recent block first).

Required scope: user:read:blocked_users

Parameters
broadcasterIdUser ID for a Twitch user.
firstMaximum number of objects to return. Maximum: 100. Default: 20.
afterCursor for forward pagination: tells the server where to start fetching the next set of results, in a multi-page response.
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns
Exceptions
BadParameterException

◆ GetUserExtensionsAsync()

Task< GetUserExtensionsResponse > TwitchLib.Api.Helix.Users.GetUserExtensionsAsync ( string  accessToken = null)

Gets a list of all extensions (both active and inactive) for a specified user, identified by a Bearer token.

Required scope: user:read:broadcast or user:edit:broadcast

Parameters
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ GetUsersAsync()

Task< GetUsersResponse > TwitchLib.Api.Helix.Users.GetUsersAsync ( List< string >  ids = null,
List< string >  logins = null,
string  accessToken = null 
)

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.

OAuth token with user:read:email scope required to include the user’s verified email address in response.

Parameters
idsUserIds to query. Maximum: 100.

The limit of 100 IDs and login names is the total limit.

You can request, for example, 50 of each or 100 of one of them. You cannot request 100 of both.

Parameters
loginsUserLogins to query. Maximum: 100.

The limit of 100 IDs and login names is the total limit.

You can request, for example, 50 of each or 100 of one of them. You cannot request 100 of both.

Parameters
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ GetUsersFollowsAsync()

Task< GetUsersFollowsResponse > TwitchLib.Api.Helix.Users.GetUsersFollowsAsync ( string  after = null,
string  before = null,
int  first = 20,
string  fromId = null,
string  toId = null,
string  accessToken = null 
)

Gets information on follow relationships between two Twitch users.

This can return information like “who is X following,” “who is following X,” or “is user X following user Y.”

Information returned is sorted in order, most recent follow first.

Parameters
afterCursor for forward pagination: tells the server where to start fetching the next set of results, in a multi-page response.
before
firstMaximum number of objects to return. Maximum: 100. Default: 20.
fromIdUser ID. The request returns information about users who are being followed by the from_id user.
toIdUser ID. The request returns information about users who are following the to_id user.
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ UnblockUserAsync()

Task TwitchLib.Api.Helix.Users.UnblockUserAsync ( string  targetUserId,
string  accessToken = null 
)

Unblocks the specified user on behalf of the authenticated user.

Required scope: user:manage:blocked_users

Parameters
targetUserIdUser ID of the user to be unblocked.
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ UpdateUserAsync()

Task TwitchLib.Api.Helix.Users.UpdateUserAsync ( string  description,
string  accessToken = null 
)

Updates the description of a user specified by the bearer token.

Note that the description parameter is optional should other updatable parameters become available in the future.

If the description parameter is not provided, no update will occur.

Required scope: user:edit

Parameters
descriptionUser’s account description
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns

◆ UpdateUserExtensionsAsync()

Task< GetUserActiveExtensionsResponse > TwitchLib.Api.Helix.Users.UpdateUserExtensionsAsync ( IEnumerable< ExtensionSlot userExtensionStates,
string  accessToken = null 
)

Updates the activation state, extension ID, and/or version number of installed extensions for a specified user, identified by a Bearer token.

If you try to activate a given extension under multiple extension types, the last write wins (and there is no guarantee of write order).

Required scope: user:edit:broadcast

Parameters
userExtensionStates
accessTokenoptional access token to override the use of the stored one in the TwitchAPI instance
Returns
Exceptions
ArgumentOutOfRangeException

The documentation for this class was generated from the following file: