![]() |
Reddit.NET
1.5
Reddit.NET is a .NET Standard library that provides easy access to the Reddit API with virtually no boilerplate code required.
|
Public Member Functions | |
Users (string appId, string appSecret, string refreshToken, string accessToken, ref RestClient restClient, string deviceId=null, string userAgent=null) | |
UserActionResult | BlockUser (UsersBlockUserInput usersBlockUserInput) |
For blocking a user. More... | |
async Task< UserActionResult > | BlockUserAsync (UsersBlockUserInput usersBlockUserInput) |
For blocking a user asynchronously. More... | |
GenericContainer | Friend (UsersFriendInput usersFriendInput, string subreddit=null) |
Create a relationship between a user and another user or subreddit. OAuth2 use requires appropriate scope based on the 'type' of the relationship: moderator: Use "moderator_invite" moderator_invite: modothers contributor: modcontributors banned: modcontributors muted: modcontributors wikibanned: modcontributors and modwiki wikicontributor: modcontributors and modwiki friend: Use /api/v1/me/friends/{username} enemy: Use /api/block Complement to POST_unfriend More... | |
async Task< GenericContainer > | FriendAsync (UsersFriendInput usersFriendInput, string subreddit=null) |
Create a relationship between a user and another user or subreddit asynchronously. OAuth2 use requires appropriate scope based on the 'type' of the relationship: moderator: Use "moderator_invite" moderator_invite: modothers contributor: modcontributors banned: modcontributors muted: modcontributors wikibanned: modcontributors and modwiki wikicontributor: modcontributors and modwiki friend: Use /api/v1/me/friends/{username} enemy: Use /api/block Complement to POST_unfriend More... | |
void | ReportUser (UsersReportUserInput usersReportUserInput) |
Report a user. Reporting a user brings it to the attention of a Reddit admin. More... | |
async Task | ReportUserAsync (UsersReportUserInput usersReportUserInput) |
Report a user asynchronously. Reporting a user brings it to the attention of a Reddit admin. More... | |
GenericContainer | SetPermissions (UsersSetPermissionsInput usersSetPermissionsInput, string subreddit=null) |
Set permissions. More... | |
async Task< GenericContainer > | SetPermissionsAsync (UsersSetPermissionsInput usersSetPermissionsInput, string subreddit=null) |
Set permissions asynchronously. More... | |
void | Unfriend (UsersUnfriendInput usersUnfriendInput, string subreddit=null) |
Remove a relationship between a user and another user or subreddit. The user can either be passed in by name (nuser) or by fullname (iuser). If type is friend or enemy, 'container' MUST be the current user's fullname; for other types, the subreddit must be set via URL (e.g., /r/funny/api/unfriend). OAuth2 use requires appropriate scope based on the 'type' of the relationship: moderator: modothers moderator_invite: modothers contributor: modcontributors banned: modcontributors muted: modcontributors wikibanned: modcontributors and modwiki wikicontributor: modcontributors and modwiki friend: Use /api/v1/me/friends/{username} enemy: Use /api/block Complement to POST_friend More... | |
async Task | UnfriendAsync (UsersUnfriendInput usersUnfriendInput, string subreddit=null) |
Remove a relationship between a user and another user or subreddit asynchronously. The user can either be passed in by name (nuser) or by fullname (iuser). If type is friend or enemy, 'container' MUST be the current user's fullname; for other types, the subreddit must be set via URL (e.g., /r/funny/api/unfriend). OAuth2 use requires appropriate scope based on the 'type' of the relationship: moderator: modothers moderator_invite: modothers contributor: modcontributors banned: modcontributors muted: modcontributors wikibanned: modcontributors and modwiki wikicontributor: modcontributors and modwiki friend: Use /api/v1/me/friends/{username} enemy: Use /api/block Complement to POST_friend More... | |
Dictionary< string, UserSummary > | UserDataByAccountIds (string ids) |
Get user data by account IDs. More... | |
bool? | UsernameAvailable (string user) |
Check whether a username is available for registration. More... | |
void | DeleteFriend (string username) |
Stop being friends with a user. More... | |
async Task | DeleteFriendAsync (string username) |
Stop being friends with a user asynchronously. More... | |
UserActionResult | GetFriend (string username) |
Get information about a specific 'friend', such as notes. More... | |
UserActionResult | UpdateFriend (string username, string json="{}") |
Create or update a "friend" relationship. This operation is idempotent. It can be used to add a new friend, or update an existing friend (e.g., add/change the note on that friend). More... | |
async Task< UserActionResult > | UpdateFriendAsync (string username, string json="{}") |
Create or update a "friend" relationship asynchronously. This operation is idempotent. It can be used to add a new friend, or update an existing friend (e.g., add/change the note on that friend). More... | |
TrophyList | Trophies (string username) |
Return a list of trophies for the given user. More... | |
UserChild | About (string username) |
Return information about the user, including karma and gold status. More... | |
T | GetUser< T > (string username, string where, UsersHistoryInput usersHistoryInput) |
This endpoint is a listing. More... | |
ModeratedListContainer | ModeratedSubreddits (string username, UsersHistoryInput usersHistoryInput) |
Retrieve a list of subreddits that the user moderates. This endpoint is a listing. More... | |
OverviewContainer | Overview (string username, UsersHistoryInput usersHistoryInput) |
Get a user's post and comment history. This endpoint is a listing. More... | |
PostContainer | PostHistory (string username, string where, UsersHistoryInput usersHistoryInput) |
Get a user's post history. This endpoint is a listing. More... | |
CommentContainer | CommentHistory (string username, string where, UsersHistoryInput usersHistoryInput) |
Get a user's comment history. This endpoint is a listing. More... | |
![]() | |
BaseModel (string appId, string appSecret, string refreshToken, string accessToken, ref RestClient restClient, string deviceId=null, string userAgent=null) | |
string | Sr (string subreddit) |
![]() | |
Request (string appId, string appSecret, string refreshToken, string accessToken, ref RestClient restClient, string deviceId=null, string userAgent=null) | |
T | SendRequest< T > (string url, dynamic parameters, Method method=Method.GET, string contentType="application/x-www-form-urlencoded") |
async Task< T > | SendRequestAsync< T > (string url, dynamic parameters, Method method=Method.GET, string contentType="application/x-www-form-urlencoded") |
RestRequest | PrepareIDRequest (string path, string id, Method method=Method.POST) |
RestRequest | PrepareJSONRequest (string path, Method method=Method.POST) |
RestRequest | PrepareRequest (string url, Method method=Method.GET, string contentType="application/x-www-form-urlencoded") |
RestRequest | PrepareRequest (string url, Method method, List< Parameter > parameters, List< FileParameter > files, string contentType="application/x-www-form-urlencoded") |
RestRequest | PrepareRequest (RestRequest restRequest, string contentType="application/x-www-form-urlencoded") |
string | GetVersion () |
string | ExecuteRequest (string url, Method method=Method.GET) |
async Task< string > | ExecuteRequestAsync (string url, Method method=Method.GET) |
string | ExecuteRequest (RestRequest restRequest) |
async Task< string > | ExecuteRequestAsync (RestRequest restRequest) |
void | UpdateAccessToken (string accessToken) |
void | UpdateRequests (List< DateTime > requests) |
void | AddParamIfNotNull (string name, dynamic value, ref RestRequest restRequest) |
Additional Inherited Members | |
![]() | |
virtual void | OnTokenUpdated (TokenUpdateEventArgs e) |
virtual void | OnRequestsUpdated (RequestsUpdateEventArgs e) |
![]() | |
EventHandler< TokenUpdateEventArgs > | TokenUpdated |
EventHandler< RequestsUpdateEventArgs > | RequestsUpdated |
Reddit.Models.Users.Users | ( | string | appId, |
string | appSecret, | ||
string | refreshToken, | ||
string | accessToken, | ||
ref RestClient | restClient, | ||
string | deviceId = null , |
||
string | userAgent = null |
||
) |
UserChild Reddit.Models.Users.About | ( | string | username | ) |
Return information about the user, including karma and gold status.
username | the name of an existing user |
UserActionResult Reddit.Models.Users.BlockUser | ( | UsersBlockUserInput | usersBlockUserInput | ) |
For blocking a user.
usersBlockUserInput | A valid UserActionResult input |
async Task<UserActionResult> Reddit.Models.Users.BlockUserAsync | ( | UsersBlockUserInput | usersBlockUserInput | ) |
For blocking a user asynchronously.
usersBlockUserInput | A valid UserActionResult input |
CommentContainer Reddit.Models.Users.CommentHistory | ( | string | username, |
string | where, | ||
UsersHistoryInput | usersHistoryInput | ||
) |
Get a user's comment history. This endpoint is a listing.
username | the name of an existing user |
where | One of (comments, saved, gilded) |
usersHistoryInput | A valid UsersHistoryInput instance |
void Reddit.Models.Users.DeleteFriend | ( | string | username | ) |
Stop being friends with a user.
username | A valid, existing reddit username |
async Task Reddit.Models.Users.DeleteFriendAsync | ( | string | username | ) |
Stop being friends with a user asynchronously.
username | A valid, existing reddit username |
GenericContainer Reddit.Models.Users.Friend | ( | UsersFriendInput | usersFriendInput, |
string | subreddit = null |
||
) |
Create a relationship between a user and another user or subreddit. OAuth2 use requires appropriate scope based on the 'type' of the relationship: moderator: Use "moderator_invite" moderator_invite: modothers contributor: modcontributors banned: modcontributors muted: modcontributors wikibanned: modcontributors and modwiki wikicontributor: modcontributors and modwiki friend: Use /api/v1/me/friends/{username} enemy: Use /api/block Complement to POST_unfriend
usersFriendInput | A valid UsersFriendInput instance |
subreddit | A subreddit |
async Task<GenericContainer> Reddit.Models.Users.FriendAsync | ( | UsersFriendInput | usersFriendInput, |
string | subreddit = null |
||
) |
Create a relationship between a user and another user or subreddit asynchronously. OAuth2 use requires appropriate scope based on the 'type' of the relationship: moderator: Use "moderator_invite" moderator_invite: modothers contributor: modcontributors banned: modcontributors muted: modcontributors wikibanned: modcontributors and modwiki wikicontributor: modcontributors and modwiki friend: Use /api/v1/me/friends/{username} enemy: Use /api/block Complement to POST_unfriend
usersFriendInput | A valid UsersFriendInput instance |
subreddit | A subreddit |
UserActionResult Reddit.Models.Users.GetFriend | ( | string | username | ) |
Get information about a specific 'friend', such as notes.
username | A valid, existing reddit username |
T Reddit.Models.Users.GetUser< T > | ( | string | username, |
string | where, | ||
UsersHistoryInput | usersHistoryInput | ||
) |
This endpoint is a listing.
username | the name of an existing user |
where | One of (overview, submitted, upvotes, downvoted, hidden, saved, gilded, moderated_subreddits) |
usersHistoryInput | A valid UsersHistoryInput instance |
ModeratedListContainer Reddit.Models.Users.ModeratedSubreddits | ( | string | username, |
UsersHistoryInput | usersHistoryInput | ||
) |
Retrieve a list of subreddits that the user moderates. This endpoint is a listing.
username | the name of an existing user |
usersHistoryInput | A valid UsersHistoryInput instance |
OverviewContainer Reddit.Models.Users.Overview | ( | string | username, |
UsersHistoryInput | usersHistoryInput | ||
) |
Get a user's post and comment history. This endpoint is a listing.
username | the name of an existing user |
usersHistoryInput | A valid UsersHistoryInput instance |
PostContainer Reddit.Models.Users.PostHistory | ( | string | username, |
string | where, | ||
UsersHistoryInput | usersHistoryInput | ||
) |
Get a user's post history. This endpoint is a listing.
username | the name of an existing user |
where | One of (submitted, upvotes, downvoted, hidden, saved, gilded) |
usersHistoryInput | A valid UsersHistoryInput instance |
void Reddit.Models.Users.ReportUser | ( | UsersReportUserInput | usersReportUserInput | ) |
Report a user. Reporting a user brings it to the attention of a Reddit admin.
usersReportUserInput | A valid UsersReportUserInput instance |
async Task Reddit.Models.Users.ReportUserAsync | ( | UsersReportUserInput | usersReportUserInput | ) |
Report a user asynchronously. Reporting a user brings it to the attention of a Reddit admin.
usersReportUserInput | A valid UsersReportUserInput instance |
GenericContainer Reddit.Models.Users.SetPermissions | ( | UsersSetPermissionsInput | usersSetPermissionsInput, |
string | subreddit = null |
||
) |
Set permissions.
usersSetPermissionsInput | A valid UsersSetPermissionsInput instance |
subreddit | A subreddit |
async Task<GenericContainer> Reddit.Models.Users.SetPermissionsAsync | ( | UsersSetPermissionsInput | usersSetPermissionsInput, |
string | subreddit = null |
||
) |
Set permissions asynchronously.
usersSetPermissionsInput | A valid UsersSetPermissionsInput instance |
subreddit | A subreddit |
TrophyList Reddit.Models.Users.Trophies | ( | string | username | ) |
Return a list of trophies for the given user.
username | A valid, existing reddit username |
void Reddit.Models.Users.Unfriend | ( | UsersUnfriendInput | usersUnfriendInput, |
string | subreddit = null |
||
) |
Remove a relationship between a user and another user or subreddit. The user can either be passed in by name (nuser) or by fullname (iuser). If type is friend or enemy, 'container' MUST be the current user's fullname; for other types, the subreddit must be set via URL (e.g., /r/funny/api/unfriend). OAuth2 use requires appropriate scope based on the 'type' of the relationship: moderator: modothers moderator_invite: modothers contributor: modcontributors banned: modcontributors muted: modcontributors wikibanned: modcontributors and modwiki wikicontributor: modcontributors and modwiki friend: Use /api/v1/me/friends/{username} enemy: Use /api/block Complement to POST_friend
usersUnfriendInput | A valid UsersUnfriendInput instance |
subreddit | A subreddit |
async Task Reddit.Models.Users.UnfriendAsync | ( | UsersUnfriendInput | usersUnfriendInput, |
string | subreddit = null |
||
) |
Remove a relationship between a user and another user or subreddit asynchronously. The user can either be passed in by name (nuser) or by fullname (iuser). If type is friend or enemy, 'container' MUST be the current user's fullname; for other types, the subreddit must be set via URL (e.g., /r/funny/api/unfriend). OAuth2 use requires appropriate scope based on the 'type' of the relationship: moderator: modothers moderator_invite: modothers contributor: modcontributors banned: modcontributors muted: modcontributors wikibanned: modcontributors and modwiki wikicontributor: modcontributors and modwiki friend: Use /api/v1/me/friends/{username} enemy: Use /api/block Complement to POST_friend
usersUnfriendInput | A valid UsersUnfriendInput instance |
subreddit | A subreddit |
UserActionResult Reddit.Models.Users.UpdateFriend | ( | string | username, |
string | json = "{}" |
||
) |
Create or update a "friend" relationship. This operation is idempotent. It can be used to add a new friend, or update an existing friend (e.g., add/change the note on that friend).
username | A valid, existing reddit username |
json | { "name": A valid, existing reddit username "note": a string no longer than 300 characters } |
async Task<UserActionResult> Reddit.Models.Users.UpdateFriendAsync | ( | string | username, |
string | json = "{}" |
||
) |
Create or update a "friend" relationship asynchronously. This operation is idempotent. It can be used to add a new friend, or update an existing friend (e.g., add/change the note on that friend).
username | A valid, existing reddit username |
json | { "name": A valid, existing reddit username "note": a string no longer than 300 characters } |
Dictionary<string, UserSummary> Reddit.Models.Users.UserDataByAccountIds | ( | string | ids | ) |
Get user data by account IDs.
ids | A comma-separated list of account fullnames |
bool? Reddit.Models.Users.UsernameAvailable | ( | string | user | ) |
Check whether a username is available for registration.
user | a valid, unused username |