\PhapperPhapper

Summary

Methods
Properties
Constants
__construct()
setDebug()
getMe()
getMyKarmaBreakdown()
getMyPrefs()
updateMyPrefs()
getMyTrophies()
getMyFriends()
getMyBlockedUsers()
getUserFlairList()
addFlairTemplate()
clearFlairTemplates()
deleteFlairTemplate()
deleteUserFlair()
getUserFlairSelector()
getLinkFlairSelector()
selectUserFlair()
selectLinkFlair()
assignUserFlair()
assignLinkFlair()
showMyFlair()
configureSubredditFlair()
gild()
giveGold()
submitLinkPost()
submitTextPost()
comment()
delete()
editText()
hide()
unhide()
getInfo()
markNSFW()
unmarkNSFW()
getCommentChildren()
report()
save()
unsave()
getSavedCategories()
sendInboxReplies()
storeVisits()
upvote()
downvote()
unvote()
getLinksById()
getComments()
getDuplicateLinks()
getHot()
getNew()
getControversial()
getTop()
getRandom()
getRelatedLinks()
createLiveThread()
attachLiveThread()
blockByMessage()
collapseMessage()
uncollapseMessage()
composeMessage()
markAllMessagesAsRead()
markMessageRead()
markMessageUnread()
unblockSubredditByMessage()
getInbox()
getUnread()
getSent()
getModmail()
getOAuthScopes()
setContestMode()
stickyPost()
unstickyPost()
setSuggestedSort()
clearSuggestedSort()
distinguish()
getModerationLog()
getReports()
getSpam()
getModqueue()
getUnmoderated()
getEditedComments()
acceptModeratorInvite()
approve()
remove()
spam()
ignoreReports()
unignoreReports()
leaveContributor()
leaveModerator()
ban()
unban()
addContributor()
removeContributor()
inviteModerator()
removeModerator()
uninviteModerator()
setModeratorPermissions()
setInvitationPermissions()
wikiBan()
wikiUnban()
addWikiContributor()
removeWikiContributor()
mute()
unmute()
muteUserByMessage()
unmuteUserByMessage()
lockThread()
unlockThread()
multiCopy()
multiGetMine()
multiGetUser()
multiRename()
multiGet()
multiCreate()
multiEdit()
multiDelete()
multiGetDescription()
multiEditDescription()
multiGetSubreddit()
multiAddSubreddit()
multiRemoveSubreddit()
search()
aboutSubreddit()
getBanned()
getMuted()
getWikiBanned()
getContributors()
getWikiContributors()
getModerators()
uploadSubredditImage()
deleteSubredditBanner()
deleteSubredditHeaderImage()
deleteSubredditIcon()
deleteSubredditImage()
getRecommendedSubreddits()
searchSubredditsByName()
getSubmitText()
getSubredditStylesheet()
setSubredditStylesheet()
searchSubredditsByTopic()
subscribe()
unsubscribe()
getSubredditSettings()
getSubredditSidebar()
getStickies()
searchSubreddits()
getMySubscribedSubreddits()
getMyContributedSubreddits()
getMyModeratedSubreddits()
getPopularSubreddits()
getNewSubreddits()
getGoldOnlySubreddits()
getDefaultSubreddits()
createSubreddit()
editSubreddit()
addFriend()
removeFriend()
unblockUser()
usernameAvailable()
getNotifications()
markNotificationAsRead()
getUserTrophies()
getUser()
getUserOverview()
getUserSubmitted()
getUserComments()
getUserUpvoted()
getUserDownvoted()
getUserHidden()
getUserSaved()
getUserGildingsReceived()
getUserGildingsGiven()
wikiAllowEditor()
wikiDisallowEditor()
wikiGetPages()
wikiGetPage()
wikiGetRevisions()
wikiGetPageRevisions()
wikiEditPage()
wikiToggleHideRevision()
wikiHideRevision()
wikiUnhideRevision()
wikiRevertToRevision()
wikiGetPageDiscussions()
wikiGetPageSettings()
wikiUpdatePageSettings()
apiCall()
$ratelimiter
No constants found
No protected methods found
No protected properties found
N/A
getSubredditListing()
getSubredditModListing()
getSubredditUsers()
getMySubreddits()
getSubreddits()
getUserListing()
getCaptchaResponse()
$oauth2
$user_id
$user_agent
$basic_endpoint
$oauth_endpoint
$debug
N/A

Properties

$user_id

$user_id : 

Type

$user_agent

$user_agent : 

Type

$basic_endpoint

$basic_endpoint : 

Type

$oauth_endpoint

$oauth_endpoint : 

Type

$debug

$debug : 

Type

Methods

__construct()

__construct(  $username = null,   $password = null,   $app_id = null,   $app_secret = null,   $user_agent = null,   $basic_endpoint = null,   $oauth_endpoint = null) 

Parameters

$username
$password
$app_id
$app_secret
$user_agent
$basic_endpoint
$oauth_endpoint

setDebug()

setDebug(  $debug) 

Parameters

$debug

getMe()

getMe() : object

Gets information about the current user's account.

Returns

object —

An object representing the current user.

getMyKarmaBreakdown()

getMyKarmaBreakdown() : object

Gets karma breakdown of current user.

Returns

object —

Listing subreddits and corresponding karma values.

getMyPrefs()

getMyPrefs() : object

Gets current user's site preferences.

Returns

object —

Object representing user's preferences.

updateMyPrefs()

updateMyPrefs(array  $settings) : object

Update the current user's preferences.

Parameters

array $settings

An array of key-value pairs to update. Use getMyPrefs() to see possible values.

Returns

object —

Object representing user's new preferences.

getMyTrophies()

getMyTrophies() : object

Gets current user's trophies.

Returns

object —

Listing of current user's trophies.

getMyFriends()

getMyFriends() : mixed|null

Gets a list of the current user's friends.

Returns

mixed|null —

Listing of users that are the current user's friends.

getMyBlockedUsers()

getMyBlockedUsers() : object

Gets a list of the current user's blocked users.

Returns

object —

Listing of current user's blocked users.

getUserFlairList()

getUserFlairList(string  $subreddit, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves a list of all assigned user flair in the specified subreddit. Must be a mod of that subreddit.

Parameters

string $subreddit

Name of subreddit from which to retrieve flair list.

integer $limit

Upper limit of number of items to retrieve. Maximum is 1000.

string|null $after

Use 'next' attribute of previous call to retrieve next page.

string|null $before

Retrieve only flairs that are higher than this user ID on the list.

Returns

object —

Listing of users that are assigned flair in the specified subreddit.

addFlairTemplate()

addFlairTemplate(string  $subreddit, string  $type, string|null  $text = null, string|null  $css_class = null, boolean  $editable = false, string|null  $template_id = null) : object

Adds or modifies a flair template in a subreddit.

Parameters

string $subreddit

Name of subreddit to add flair template.

string $type

Specifies user or link flair template. One of 'link' or 'user'.

string|null $text

Flair text.

string|null $css_class

Flair CSS class.

boolean $editable

Whether or not to allow users to edit the flair's text when assigning it.

string|null $template_id

The template ID of an existing flair to modify. If null, will add a new one.

Returns

object —

Response to API call.

clearFlairTemplates()

clearFlairTemplates(string  $subreddit, string  $type) : object|null

Deletes all flair templates of the selected type from the selected subreddit.

Parameters

string $subreddit

Subreddit of flairs to clear.

string $type

One of 'user' or 'link'.

Returns

object|null —

Response to API call. Null if incorrect type.

deleteFlairTemplate()

deleteFlairTemplate(string  $subreddit, string  $template_id) : object

Deletes the selected flair template from the specified subreddit.

$template_id can be obtained with getUserFlairSelector and getLinkFlairSelector

Parameters

string $subreddit

Subreddit from which to delete flair template.

string $template_id

ID of template to delete.

Returns

object —

Response to API call.

deleteUserFlair()

deleteUserFlair(string  $subreddit, string  $user) : object

Deletes a user's flair from the specified subreddit.

Parameters

string $subreddit

Subreddit in which to delete user flair.

string $user

Username of user whose flair to delete.

Returns

object —

Response to API call.

getUserFlairSelector()

getUserFlairSelector(string  $subreddit, string|null  $user = null) : object

Gets current flair and a list of possible flairs for the specified user in the specified subreddit.

Also useful for obtaining flair ID's.

Parameters

string $subreddit

Subreddit in which to view flair options.

string|null $user

Username for whom to view selection. Defaults to current user.

Returns

object —

Response to API call.

getLinkFlairSelector()

getLinkFlairSelector(string  $thing_id) : object

Gets current flair and a list of possible flairs for the specified link.

Parameters

string $thing_id

Thing ID of object to view flairs.

Returns

object —

Response to API call.

selectUserFlair()

selectUserFlair(string  $subreddit, string  $user, string|null  $template_id = null, string|null  $text = null) : object

Selects a user flair to use from the flair selection list.

Parameters

string $subreddit

Subreddit in which to select flair.

string $user

Username of user to whom to apply flair. Mandatory, don't ask me why.

string|null $template_id

Template ID of template to select. Null will remove the user's flair.

string|null $text

Modified flair text, if allowed.

Returns

object —

Response to API call.

selectLinkFlair()

selectLinkFlair(string  $thing_id, string|null  $template_id = null, string|null  $text = null) : object

Applies a link flair template from the selection list to a link.

Parameters

string $thing_id

Thing ID of link to apply flair.

string|null $template_id

Template ID of template to apply to link. Null will remove the link's flair.

string|null $text

Modified flair text, if allowed.

Returns

object —

Response to API call.

assignUserFlair()

assignUserFlair(string  $subreddit, string  $user, string|null  $text = null, string|null  $css_class = null) : object

Assigns the selected user custom flair text and CSS class in the specified subreddit. Mods only.

Parameters

string $subreddit

Subreddit in which to assign flair.

string $user

Username of user to assign flair.

string|null $text

Custom flair text.

string|null $css_class

Custom flair CSS class. If both fields are null, deletes flair.

Returns

object —

Response to API call.

assignLinkFlair()

assignLinkFlair(string  $subreddit, string  $thing_id, string|null  $text = null, string|null  $css_class = null) : object

Assigns the selected link custom flair text and CSS class in the specified subreddit. Mods only.

Parameters

string $subreddit

Subreddit in which to assign flair. Mandatory, don't ask me why.

string $thing_id

Thing ID of link to assign flair.

string|null $text

Custom flair text.

string|null $css_class

Custom flair CSS class. If both fields are null, deletes flair.

Returns

object —

Response to API call.

showMyFlair()

showMyFlair(string  $subreddit, boolean  $show = true) : object

Selects whether or not to show the current user's flair in the selected subreddit.

Parameters

string $subreddit

Subreddit in which to enable or disable flair.

boolean $show

True to show flair. False to hide flair.

Returns

object —

Response to API call.

configureSubredditFlair()

configureSubredditFlair(string  $subreddit, boolean  $user_enabled, string  $user_position, boolean  $user_self_assign, string  $link_position, boolean  $link_self_assign) : object|null

Updates all options in a subreddit's flair configuration.

Parameters

string $subreddit

Subreddit in which to configure flair.

boolean $user_enabled

Whether or not user flair is displayed.

string $user_position

On which side to display user flair. One of 'left' or 'right'.

boolean $user_self_assign

Whether or not users can select their own user flair.

string $link_position

On which side to display links' flair. One of 'left', 'right', or 'none'.

boolean $link_self_assign

Whether or not users can select their own links' flair.

Returns

object|null —

Response to API call. Null if invalid arguments.

gild()

gild(string  $thing_id) : object

UNTESTED Gild a link or comment, which gives the author reddit gold. Must have sufficient gold creddits.

Reddit's documentation is odd, indicating that the thing ID is required both in the URL and the POST parameters.

Parameters

string $thing_id

Thing ID of link or comment to gild.

Returns

object —

Response to API call.

giveGold()

giveGold(string  $user, integer  $months = 1) : object

UNTESTED Give the specified user the specified months of reddit gold. Must have sufficient gold creddits.

Reddit's documentation is odd, indicating that the username is required both in the URL and the POST parameters.

Parameters

string $user

Username of user to whom to give gold.

integer $months

Number of months to give reddit gold.

Returns

object —

Response to API call.

submitLinkPost()

submitLinkPost(string  $subreddit, string  $title, string  $url, boolean  $send_replies = true, boolean  $distinguish = false) : object

Submits a new link post.

Parameters

string $subreddit

Subreddit in which to post link.

string $title

Title of post.

string $url

Link to post.

boolean $send_replies

Send comment replies to the current user's inbox. True to enable, false to disable.

boolean $distinguish

Whether or not it should be mod distinguished (for modded subreddits only).

Returns

object —

Response to API call.

submitTextPost()

submitTextPost(string  $subreddit, string  $title, string|null  $text = null, boolean  $send_replies = true, boolean  $distinguish = false) : object

Submits a new text post.

Parameters

string $subreddit

Subreddit in which to post.

string $title

Title of post.

string|null $text

Text of post.

boolean $send_replies

Send comment replies to the current user's inbox. True to enable, false to disable.

boolean $distinguish

Whether or not it should be mod distinguished (for modded subreddits only).

Returns

object —

Response to API call.

comment()

comment(string  $parent, string  $text, boolean  $distinguish = false) : object

Comments on an object.

Parameters

string $parent

Thing ID of parent object on which to comment. Could be link, text post, or comment.

string $text

Comment text.

boolean $distinguish

Whether or not it should be mod distinguished (for modded subreddits only).

Returns

object —

Response to API call.

delete()

delete(string  $thing_id) : object

Deletes a post or comment.

Parameters

string $thing_id

Thing ID of object to delete. Could be link, text post, or comment.

Returns

object —

Response to API call, probably empty.

editText()

editText(string  $thing_id, string  $text) : object

Edits the text of a comment or text post.

Parameters

string $thing_id

Thing ID of text object to edit. Could be text post or comment.

string $text

New text to replace the old.

Returns

object —

Response to API call, probably object of thing that was just edited.

hide()

hide(string|array  $thing_ids) : boolean|null

Hides a post from user's listings.

Parameters

string|array $thing_ids

String or array of thing ID's of links to hide.

Returns

boolean|null —

Response to API call.

unhide()

unhide(string|array  $thing_ids) : boolean|null

Unhides a post from user's hidden posts.

Parameters

string|array $thing_ids

String or array of thing ID's of links to unhide.

Returns

boolean|null —

Returns true if success. Null if failed.

getInfo()

getInfo(string|array  $thing_ids) : object

Gives a listing of information on objects.

Parameters

string|array $thing_ids

String or array of single or multiple thing ID's.

Returns

object —

Listing objects requested.

markNSFW()

markNSFW(string  $thing_id) : object

Marks a post as NSFW.

Parameters

string $thing_id

Thing ID of post to mark as NSFW.

Returns

object —

Response to API call, probably empty.

unmarkNSFW()

unmarkNSFW(string  $thing_id) : object

Unmarks a post as NSFW.

Parameters

string $thing_id

Thing ID of post to unmark as NSFW.

Returns

object —

Response to API call, probably empty.

getCommentChildren()

getCommentChildren(string  $link_id, string|array  $comment_ids) : object

Get comments in a tree that are hidden by "load more comments".

NOTE: Only make one request for this at a time. Higher concurrency will result in an error.

Parameters

string $link_id

Fullname (thing ID) of link/post of the comment tree.

string|array $comment_ids

ID36 or fullname of one or more parent comments for which to retrieve children.

Returns

object —

Complex object containing comment's children.

report()

report(string  $thing_id, null  $reason = null) : object

Reports a post, comment, or message.

Parameters

string $thing_id

Thing ID of object to report.

null $reason

The reason for the report. Must be <100 characters.

Returns

object —

Response to API call.

save()

save(string  $thing_id, null  $category = null) : object

Saves a post or comment in the selected category.

Parameters

string $thing_id

Thing ID of object to save. Can be post or comment.

null $category

Category in which to save object. Defaults to none.

Returns

object —

Response to API call, probably empty.

unsave()

unsave(string  $thing_id) : object

Unsaves a post or comment from the current user's saved posts.

Parameters

string $thing_id

Thing ID of object to unsave. Can be post or comment.

Returns

object —

Response to API call, probably empty.

getSavedCategories()

getSavedCategories() : object

Gets the current user's save categories.

Returns

object —

Contains an array of categories.

sendInboxReplies()

sendInboxReplies(string  $thing_id, boolean  $state = true) : object

Toggles whether or not the current user should receive replies to a specific post or comment to their inbox.

Parameters

string $thing_id

Thing ID of object to toggle.

boolean $state

State of inbox replies. True to receive, false for not.

Returns

object —

Response to API call, probably empty.

storeVisits()

storeVisits(string|array  $thing_ids) : object

Store that the current user has visited a certain link.

Parameters

string|array $thing_ids

String or array of thing ID's of links to store as visited.

Returns

object —

Response to API call, probably empty.

upvote()

upvote(string  $thing_id) : object

VOTES MUST BE CAST BY A HUMAN!! Proxying a person's single vote is okay, but bots should not use vote functions on their own.

Upvotes a post or comment.

Parameters

string $thing_id

Thing ID of object to upvote.

Returns

object —

Response to API call, probably empty.

downvote()

downvote(string  $thing_id) : object

Downvotes a post or comment.

Parameters

string $thing_id

Thing ID of object to downvote.

Returns

object —

Response to API call, probably empty.

unvote()

unvote(string  $thing_id) : object

Resets the current user's vote on a post or comment.

Parameters

string $thing_id

Thing ID of object to reset vote.

Returns

object —

Response to API call, probably empty.

getLinksById()

getLinksById(string  $thing_ids) : object

Retrieves a listing of links by their specified thing ID.

Parameters

string $thing_ids

Thing ID's of links to retrieve.

Returns

object —

A listing of links.

getComments()

getComments(string  $link_id, string|null  $comment_id = null, integer|null  $context = null, integer|null  $depth = null, integer|null  $limit = null, string|null  $sort = null, boolean  $show_edits = false, boolean  $show_more = false) : object

Retrieves a listing of comments and children for a link and optionally a specific comment

Parameters

string $link_id

ID36 or fullname of link for comments to fetch.

string|null $comment_id

Optional, ID36 or fullname of a single comment to fetch with children, much like permalink.

integer|null $context

Number of levels up of parent comments to retrieve. Only applicable to child comments.

integer|null $depth

Depth of child comments to retrieve.

integer|null $limit

Limit of comments to retrieve.

string|null $sort

How to sort the comments, one of 'confidence', 'top', 'new', 'hot', 'controversial', 'old', 'random', 'qa'

boolean $show_edits

Show edited comments, perhaps? Not well documented by reddit.

boolean $show_more

Include links to show more comments, maybe? Not well documented by reddit.

Returns

object —

Listing of link and specified comment(s).

getDuplicateLinks()

getDuplicateLinks(string  $thing_id, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves the specified link and a listing of other links that are to duplicate destinations.

Parameters

string $thing_id

ID36 or fullname of link to check for duplicates.

integer $limit

Limit of duplicate links to retrieve.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of original link and listing of duplicate links.

getHot()

getHot(string|null  $subreddit = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : mixed|null

Retrieves the hot listing for the optionally specified subreddit.

Parameters

string|null $subreddit

Subreddit of listing to retrieve. If none, defaults to front page.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

mixed|null —

Returns listing object on success. Null if failed.

getNew()

getNew(string|null  $subreddit = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : mixed|null

Retrieves the new listing for the optionally specified subreddit.

Parameters

string|null $subreddit

Subreddit of listing to retrieve. If none, defaults to front page.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

mixed|null —

Returns listing object on success. Null if failed.

getControversial()

getControversial(string|null  $subreddit = null, string  $time = 'all', integer  $limit = 25, string|null  $after = null, string|null  $before = null) : mixed|null

Retrieves the controversial listing for the optionally specified subreddit.

Parameters

string|null $subreddit

Subreddit of listing to retrieve. If none, defaults to front page.

string $time

Time constraint for age of items on list. One of hour, day, week, month, year, all.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

mixed|null —

Returns listing object on success. Null if failed.

getTop()

getTop(string|null  $subreddit = null, string  $time = 'all', integer  $limit = 25, string|null  $after = null, string|null  $before = null) : mixed|null

Retrieves the top listing for the optionally specified subreddit.

Parameters

string|null $subreddit

Subreddit of listing to retrieve. If none, defaults to front page.

string $time

Time constraint for age of items on list. One of 'hour', 'day', 'week', 'month', 'year', 'all'.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

mixed|null —

Returns listing object on success. Null if failed.

getRandom()

getRandom(string|null  $subreddit = null) : object

NOT CURRENTLY SUPPORTED BY REDDIT. HERE ANYWAY IN CASE IT IS IN THE FUTURE.

Retrieves a random link from the optionally specified subreddit. If none, choose from any subreddit.

Parameters

string|null $subreddit

Subreddit from which to retrieve a random link.

Returns

object —

Who knows? Probably a listing of a single link.

getRelatedLinks()

getRelatedLinks(string  $thing_id, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves a list of links that are the result of a search of the specified link's title.

Parameters

string $thing_id

ID36 or fullname of link to search with.

integer $limit

Upper limit of the number of links to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of original link and listing of related links.

createLiveThread()

createLiveThread(string  $title, string|null  $description = null, string|null  $resources = null, boolean  $nsfw = false) : \Phapper\Live|null

Creates a new live thread. To use an existing one, use attachLiveThread().

Parameters

string $title

The thread's title.

string|null $description

The thread's description.

string|null $resources

The thread's resources section in the sidebar.

boolean $nsfw

Whether or not the thread is NSFW. Prompts guests to continue when visiting.

Returns

\Phapper\Live|null —

New PHP object representing a reddit live thread.

attachLiveThread()

attachLiveThread(string  $thread_id) : \Phapper\Live

Uses an existing live thread to create a Live object. You do not necessarily need to be a contributor to attach.

Parameters

string $thread_id

Thread ID of the thread to attach.

Returns

\Phapper\Live

Returns the resulting PHP Live object.

blockByMessage()

blockByMessage(string  $thing_id) : object

Block a user based on the thing ID of a *message* they sent you. Does not work directly on user objects.

Parameters

string $thing_id

Thing ID of message that the user to block sent you.

Returns

object —

Response to API call, probably empty.

collapseMessage()

collapseMessage(string|array  $thing_ids) : object

CURRENTLY NOT SUPPORTED WITH OAUTH.

Collapse one or more messages in modmail.

Parameters

string|array $thing_ids

Comma-separated or array of thing ID's of messages to collapse.

Returns

object —

Undetermined.

uncollapseMessage()

uncollapseMessage(string|array  $thing_ids) : object

CURRENTLY NOT SUPPORTED WITH OAUTH.

Uncollapse one or more messages in modmail.

Parameters

string|array $thing_ids

Comma-separated or array of thing ID's of messages to uncollapse.

Returns

object —

Undetermined.

composeMessage()

composeMessage(string  $to, string  $subject, string  $body, string|null  $from_subreddit = null) : object

Sends a message to a user or subreddit.

Parameters

string $to

Username or subreddit to send to.

string $subject

Subject of message.

string $body

Body of message.

string|null $from_subreddit

Optionally the name of the subreddit from which to send the message.

Returns

object —

Response to API call.

markAllMessagesAsRead()

markAllMessagesAsRead() : string

Queues a job for all of your messages to be marked as read.

Returns

string —

Raw body response from reddit since it's not in JSON.

markMessageRead()

markMessageRead(string|array  $thing_ids) : object

Marks one or more messages as read.

Parameters

string|array $thing_ids

A comma-separated string or array of one or more message thing ID's (t4_).

Returns

object —

Response to API call, probably empty.

markMessageUnread()

markMessageUnread(string|array  $thing_ids) : object

Marks one or more messages as unread.

Parameters

string|array $thing_ids

A comma-separated string or array of one or more message thing ID's (t4_).

Returns

object —

Response to API call, probably empty.

unblockSubredditByMessage()

unblockSubredditByMessage(string  $thing_id) : object

Unblock a subreddit using a message they sent you.

Parameters

string $thing_id

Thing ID of a message sent by the subreddit to unblock.

Returns

object —

Response to API call.

getInbox()

getInbox(integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves the current user's personal message inbox.

Parameters

integer $limit

Upper limit of the number of links to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of messages in user's inbox.

getUnread()

getUnread(integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves the current user's unread personal messages.

Parameters

integer $limit

Upper limit of the number of links to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of unread messages in user's inbox.

getSent()

getSent(integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves the current user's sent personal messages.

Parameters

integer $limit

Upper limit of the number of links to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of unread messages in user's inbox.

getModmail()

getModmail(string  $subreddit = 'mod', boolean  $messages_read = false, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves modmail messages.

Parameters

string $subreddit

Subreddit for which to retrieve modmail. 'mod' means all moderated subreddits.

boolean $messages_read

Whether or not to turn off the orangered mail icon. Does not mark each message as read.

integer $limit

Upper limit of the number of message threads to retrieve. Maximum of 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of modmail messages.

getOAuthScopes()

getOAuthScopes() : object

Retrieve a list of all of reddit's OAuth2 scopes.

Returns

object —

Contains several objects representing each OAuth2 scope

setContestMode()

setContestMode(string  $thing_id, boolean  $state = true) : object

Toggles contest mode on a post.

Parameters

string $thing_id

Thing ID of post to toggle contest mode.

boolean $state

True to enable contest mode, false to disable.

Returns

object —

Response to API call, probably empty.

stickyPost()

stickyPost(string  $thing_id, integer  $num = 2) : object

Stickies a post at the top of the subreddit.

Parameters

string $thing_id

Thing ID of post to sticky.

integer $num

Position of new sticky. 1 for top, 2 for bottom. Defaults to 2.

Returns

object —

Response to API call.

unstickyPost()

unstickyPost(string  $thing_id) : object

Unsticky a post from the top of a subreddit.

Parameters

string $thing_id

Thing ID of post to unsticky.

Returns

object —

Response to API call.

setSuggestedSort()

setSuggestedSort(string  $thing_id, string  $sort) : object

Sets the default sort of a link's comments.

Parameters

string $thing_id

Thing ID of link to set suggested sort.

string $sort

Sort method. One of: 'confidence', 'top', 'new', 'hot', 'controversial', 'old', 'random', 'qa'

Returns

object —

Response to API call, probably empty.

clearSuggestedSort()

clearSuggestedSort(string  $thing_id) : object

Clears the default sort of a link's comments.

Parameters

string $thing_id

Thing ID of link to clear suggested sort.

Returns

object —

Response to API call, probably empty.

distinguish()

distinguish(string  $thing_id, boolean  $how = true) : object

Mod distinguish a post or comment.

Parameters

string $thing_id

Thing ID of object to distinguish.

boolean $how

True to set [M] distinguish. False to undistinguish.

Returns

object —

Response to API call.

getModerationLog()

getModerationLog(string  $subreddit = 'mod', integer  $limit = 25, string|null  $after = null, string|null  $mod = null, string|null  $action = null, string|null  $before = null) : object

Retrieves recent entries from the moderation log for the specified subreddit.

Parameters

string $subreddit

Subreddit of log to retrieve. All moderated subreddits by default.

integer $limit

Upper limit of number of items to retrieve. Maximum is 500.

string|null $after

Obtain the page of the results that come after the specified ModAction.

string|null $mod

Filter by moderator.

string|null $action

Filter by mod action.

string|null $before

Obtain the page of the results that come before the specified ModAction.

Returns

object —

Listing object with modaction children.

getReports()

getReports(string  $subreddit = 'mod', integer  $limit = 25, string|null  $after = null, string|null  $before = null, null  $only = null) : mixed|null

Retrieves a list of things that have been reported in the specified subreddit.

Parameters

string $subreddit

Subreddit of items to retrieve. All moderated subreddits by default.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

null $only

Obtain only links or comments. One of 'links' or 'comments'. Null for both.

Returns

mixed|null —

Returns a listing object with link and/or comment children.

getSpam()

getSpam(string  $subreddit = 'mod', integer  $limit = 25, string|null  $after = null, string|null  $before = null, null  $only = null) : mixed|null

Retrieves a list of things that have been marked as spam in the specified subreddit.

Parameters

string $subreddit

Subreddit of items to retrieve. All moderated subreddits by default.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

null $only

Obtain only links or comments. One of 'links' or 'comments'. Null for both.

Returns

mixed|null —

Returns a listing object with link and/or comment children.

getModqueue()

getModqueue(string  $subreddit = 'mod', integer  $limit = 25, string|null  $after = null, string|null  $before = null, null  $only = null) : mixed|null

Retrieves a list of things that have been placed in the modqueue of the specified subreddit.

Parameters

string $subreddit

Subreddit of items to retrieve. All moderated subreddits by default.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

null $only

Obtain only links or comments. One of 'links' or 'comments'. Null for both.

Returns

mixed|null —

Returns a listing object with link and/or comment children.

getUnmoderated()

getUnmoderated(string  $subreddit = 'mod', integer  $limit = 25, string|null  $after = null, string|null  $before = null) : mixed|null

Retrieves a list of things that have not been moderated in the specified subreddit.

Parameters

string $subreddit

Subreddit of items to retrieve. All moderated subreddits by default.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

mixed|null —

Returns a listing object with link and/or comment children.

getEditedComments()

getEditedComments(string  $subreddit = 'mod', integer  $limit = 25, string|null  $after = null, string|null  $before = null) : mixed|null

Retrieves a list of comments that have been edited by the author in the specified subreddit.

Parameters

string $subreddit

Subreddit of items to retrieve. All moderated subreddits by default.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

mixed|null —

Returns a listing object with link and/or comment children.

acceptModeratorInvite()

acceptModeratorInvite(string  $subreddit) : object

Accepts a moderator invitation for the specified subreddit. You must have a pending invitation for that subreddit.

Parameters

string $subreddit

Subreddit to accept invitation.

Returns

object —

Response to API call.

approve()

approve(string  $thing_id) : object

Marks the specified thing as approved.

Parameters

string $thing_id

Thing ID of object to be approved.

Returns

object —

Response to API call, probably empty.

remove()

remove(string  $thing_id) : object

Removes a post or comment from a subreddit.

Parameters

string $thing_id

Thing ID of object to remove.

Returns

object —

Response to API call, probably empty.

spam()

spam(string  $thing_id) : object

Removes a post or comment from a subreddit as spam.

Parameters

string $thing_id

Thing ID of object to remove.

Returns

object —

Response to API call, probably empty.

ignoreReports()

ignoreReports(string  $thing_id) : object

Ignores reports for the specified thing.

Parameters

string $thing_id

Thing ID of object to be ignored.

Returns

object —

Response to API call, probably empty.

unignoreReports()

unignoreReports(string  $thing_id) : object

Unignores reports for the specified thing.

Parameters

string $thing_id

Thing ID of object to be unignored.

Returns

object —

Response to API call, probably empty.

leaveContributor()

leaveContributor(string  $subreddit) : object

Abdicate approved submitter status in a subreddit.

Parameters

string $subreddit

Name of subreddit to leave.

Returns

object —

Response to API call, probably empty.

leaveModerator()

leaveModerator(string  $subreddit) : object

Abdicate moderator status in a subreddit.

Parameters

string $subreddit

Name of subreddit to leave.

Returns

object —

Response to API call, probably empty.

ban()

ban(string  $subreddit, string  $user, string|null  $note = null, string|null  $message = null, integer|null  $duration = null) : object

Ban a user from the selected subreddit.

Parameters

string $subreddit

Subreddit from which to ban user.

string $user

Username of user to ban.

string|null $note

Ban note in banned users list. Not shown to user.

string|null $message

Ban message sent to user.

integer|null $duration

Duration of ban in days.

Returns

object —

Response to API call.

unban()

unban(string  $subreddit, string  $user) : object

Unban a user from a subreddit.

Parameters

string $subreddit

Subreddit from which to unban the user.

string $user

Username of user to unban.

Returns

object —

Response to API call, probably empty.

addContributor()

addContributor(string  $subreddit, string  $user) : object

Add a user as a contributor to a subreddit.

Parameters

string $subreddit

Subreddit to which to add user.

string $user

Username of user to add.

Returns

object —

Response to API call.

removeContributor()

removeContributor(string  $subreddit, string  $user) : object

Remove a user as a contributor from a subreddit.

Parameters

string $subreddit

Subreddit from which to remove the user.

string $user

Username of user to remove.

Returns

object —

Response to API call, probably empty..

inviteModerator()

inviteModerator(string  $subreddit, string  $user, boolean  $perm_all = true, boolean  $perm_access = false, boolean  $perm_config = false, boolean  $perm_flair = false, boolean  $perm_mail = false, boolean  $perm_posts = false, boolean  $perm_wiki = false) : object

Invite a user to become a moderator to a subreddit.

Parameters

string $subreddit

Subreddit to which to invite user.

string $user

Username of user to invite.

boolean $perm_all

If the user should have full permissions.

boolean $perm_access

If the user should have the 'access' permission.

boolean $perm_config

If the user should have the 'config' permission.

boolean $perm_flair

If the user should have the 'flair' permission.

boolean $perm_mail

If the user should have the 'mail' permission.

boolean $perm_posts

If the user should have the 'posts' permission.

boolean $perm_wiki

If the user should have the 'wiki' permission.

Returns

object —

Response to API call.

removeModerator()

removeModerator(string  $subreddit, string  $user) : object

Remove an existing moderator as a moderator from a subreddit. To revoke an invitation, use uninviteModerator().

Parameters

string $subreddit

Subreddit from which to remove a user as a moderator.

string $user

Username of user to remove

Returns

object —

Response to API call, probably empty.

uninviteModerator()

uninviteModerator(string  $subreddit, string  $user) : object

Revoke a user's pending invitation to moderate a subreddit. To remove an existing moderator, use removeModerator().

Parameters

string $subreddit

Subreddit from which to revoke a user's invitation.

string $user

User whose invitation to revoke.

Returns

object —

Response to API call, probably empty.

setModeratorPermissions()

setModeratorPermissions(string  $subreddit, string  $user, boolean  $perm_all = true, boolean  $perm_access = false, boolean  $perm_config = false, boolean  $perm_flair = false, boolean  $perm_mail = false, boolean  $perm_posts = false, boolean  $perm_wiki = false) : object

Modify an existing moderator's permission set. To modify an invited moderator's permissions, use setInvitationPermissions().

Parameters

string $subreddit

Subreddit in which to edit a user's permissions

string $user

Username of user to edit permissions.

boolean $perm_all

If the user should have full permissions.

boolean $perm_access

If the user should have the 'access' permission.

boolean $perm_config

If the user should have the 'config' permission.

boolean $perm_flair

If the user should have the 'flair' permission.

boolean $perm_mail

If the user should have the 'mail' permission.

boolean $perm_posts

If the user should have the 'posts' permission.

boolean $perm_wiki

If the user should have the 'wiki' permission.

Returns

object —

Response to API call.

setInvitationPermissions()

setInvitationPermissions(string  $subreddit, string  $user, boolean  $perm_all = true, boolean  $perm_access = false, boolean  $perm_config = false, boolean  $perm_flair = false, boolean  $perm_mail = false, boolean  $perm_posts = false, boolean  $perm_wiki = false) : object

Modify an invited moderator's permission set. To modify an existing moderator's permissions, use setModeratorPermissions().

Parameters

string $subreddit

Subreddit in which to edit a user's permissions

string $user

Username of user to edit permissions.

boolean $perm_all

If the user should have full permissions.

boolean $perm_access

If the user should have the 'access' permission.

boolean $perm_config

If the user should have the 'config' permission.

boolean $perm_flair

If the user should have the 'flair' permission.

boolean $perm_mail

If the user should have the 'mail' permission.

boolean $perm_posts

If the user should have the 'posts' permission.

boolean $perm_wiki

If the user should have the 'wiki' permission.

Returns

object —

Response to API call.

wikiBan()

wikiBan(string  $subreddit, string  $user, string|null  $note = null, integer|null  $duration = null) : object

Ban a user from contributing to a subreddit's wiki.

Parameters

string $subreddit

Subreddit from which to ban user.

string $user

Username of user to ban.

string|null $note

Ban note in banned users list. Not shown to user.

integer|null $duration

Duration of ban in days.

Returns

object —

Response to API call.

wikiUnban()

wikiUnban(string  $subreddit, string  $user) : object

Unban a user from a subreddit's wiki.

Parameters

string $subreddit

Subreddit from which to unban the user.

string $user

Username of user to unban.

Returns

object —

Response to API call, probably empty.

addWikiContributor()

addWikiContributor(string  $subreddit, string  $user) : object

Add a user as a contributor to a subreddit's wiki.

Parameters

string $subreddit

Subreddit to which to add user.

string $user

Username of user to add.

Returns

object —

Response to API call.

removeWikiContributor()

removeWikiContributor(string  $subreddit, string  $user) : mixed|null

Remove a user as a contributor from a subreddit's wiki.

Parameters

string $subreddit

Subreddit from which to remove the user.

string $user

Username of user to remove.

Returns

mixed|null —

Response to API call, probably empty.

mute()

mute(string  $subreddit, string  $user, string|null  $note = null) : object

Mute a user in the specified subreddit by username.

Parameters

string $subreddit

Subreddit in which to mute the user.

string $user

Username of user to mute.

string|null $note

Mute note in muted users list. Not shown to user.

Returns

object —

Response to API call.

unmute()

unmute(string  $subreddit, string  $user) : object

Unmute a user in the specified subreddit by username.

Parameters

string $subreddit

Subreddit to which to unmute the user.

string $user

Username of user to unmute.

Returns

object —

Response to API call, probably empty.

muteUserByMessage()

muteUserByMessage(string  $thing_id) : object

Mute a user from a subreddit based on the thing ID of a message they sent.

Parameters

string $thing_id

Thing ID of the message author to be muted.

Returns

object —

Response to API call, probably empty.

unmuteUserByMessage()

unmuteUserByMessage(string  $thing_id) : object

Unmute a user from a subreddit based on the thing ID of a message they sent.

Parameters

string $thing_id

Thing ID of the message author to be unmuted.

Returns

object —

Response to API call, probably empty.

lockThread()

lockThread(string  $thing_id) : object

Lock a post and prevent any new comments by non-moderators.

Parameters

string $thing_id

Thing ID of post to lock. Must be a post, not a comment.

Returns

object —

Response to API call, probably empty.

unlockThread()

unlockThread(string  $thing_id) : object

Unlock a post and allow any new comments.

Parameters

string $thing_id

Thing ID of post to unlock.

Returns

object —

Response to API call, probably empty.

multiCopy()

multiCopy(string  $from_user, string  $from_name, string  $to_name) : object

Copy an existing multireddit to your own set.

Parameters

string $from_user

Owner of multireddit to copy.

string $from_name

Name of multireddit to copy.

string $to_name

Name of destination multireddit.

Returns

object —

Resulting multireddit object.

multiGetMine()

multiGetMine() : array

Retrieves a list of multireddits that are owned by the current user.

Returns

array —

Contains multireddit objects.

multiGetUser()

multiGetUser(string  $user, boolean  $expand_srs = false) : array

Retrieves a list of multireddits owned by the specified user.

Parameters

string $user

Username of user for which to retrieve owned multireddits.

boolean $expand_srs

Obtain extra details about the subreddits of each multireddit.

Returns

array —

Multireddit objects.

multiRename()

multiRename(string  $from_name, string  $to_name) : object

Renames a subreddit. Functions like copying the existing subreddit then deleting the old one.

Parameters

string $from_name

Name of multireddit to rename.

string $to_name

Destination name.

Returns

object —

Resulting multireddit object.

multiGet()

multiGet(string  $user, string  $name) : object

Retrieves a multireddit.

Parameters

string $user

Owner of multireddit to retrieve.

string $name

Name of multireddit to retrieve.

Returns

object —

Multireddit object.

multiCreate()

multiCreate(string  $name, string|array  $subreddits = array(), string|null  $description = null, string  $visibility = 'private', string  $weighting_scheme = 'classic', string|null  $icon = null, string  $key_color = '#cee3f8') : object

Create a multireddit. If multireddit of name already exists, an incremented number is appended to the end.

Parameters

string $name

Name (and URL) of new multireddit.

string|array $subreddits

Array or comma-delimited string of one or more subreddits that should go in the multireddit.

string|null $description

Multireddit sidebar text.

string $visibility

One of 'public', 'private', 'hidden'. Hidden multireddits will not be visible to you except through the API.

string $weighting_scheme

One of 'classic', 'fresh'.

string|null $icon

Not really used, but see https://www.reddit.com/dev/api#POST_api_multi_{multipath} for possible values.

string $key_color

Not really used, but can be hex color.

Returns

object —

Multireddit object of new multireddit.

multiEdit()

multiEdit(string  $name, string|null  $subreddits = null, string|null  $description = null, string  $visibility = null, string|null  $weighting_scheme = null, string|null  $icon = null, string|null  $key_color = null) : object

Update an existing multireddit. If one of the specified name does not exits, one will be created.

Fields to not be updated should be null.

Parameters

string $name

Name (and URL) of new multireddit.

string|null $subreddits

Array or comma-delimited string of one or more subreddits that should go in the multireddit.

string|null $description

Multireddit sidebar text.

string $visibility

One of 'public', 'private', 'hidden'. Hidden multireddits will not be visible to you except through the API.

string|null $weighting_scheme

One of 'classic', 'fresh'.

string|null $icon

Not really used, but see https://www.reddit.com/dev/api#POST_api_multi_{multipath} for possible values.

string|null $key_color

Not really used, but can be hex color.

Returns

object —

Multireddit object of resulting multireddit.

multiDelete()

multiDelete(string  $name) : null

Deletes the specified multireddit.

Parameters

string $name

Name of multireddit to delete.

Returns

null —

Response to API call, probably null.

multiGetDescription()

multiGetDescription(string  $user, string  $name) : object

Get the description/sidebar for the specified multireddit.

Parameters

string $user

Owner of multireddit.

string $name

Name of multireddit.

Returns

object —

Response to API call, a LabeledMultiDescription object.

multiEditDescription()

multiEditDescription(string  $name, string  $description) : object

Edit the description/sidebar for the specified multireddit.

Parameters

string $name

Name of multireddit.

string $description

New description.

Returns

object —

Response to API call, LabeledMultiDescription object.

multiGetSubreddit()

multiGetSubreddit(string  $user, string  $name, string  $subreddit) : object

Get information about the specified subreddit in the specified multireddit. Kinda useless, since it only returns the name at this point.

Parameters

string $user

Owner of multireddit.

string $name

Name of multireddit.

string $subreddit

Subreddit for which to obtain information.

Returns

object —

Response to API call, only contains subreddit name.

multiAddSubreddit()

multiAddSubreddit(string  $name, string  $subreddit) : object

Add the specified subreddit to the specified multireddit.

Parameters

string $name

Name of multireddit.

string $subreddit

Name of subreddit to add.

Returns

object —

Response to API call, only contains the subreddit name.

multiRemoveSubreddit()

multiRemoveSubreddit(string  $name, string  $subreddit) : object

Remove the specified subreddit from the specified multireddit.

Parameters

string $name

Name of multireddit.

string $subreddit

Name of subreddit to remove.

Returns

object —

Response to API call, probably null.

search()

search(string  $query, string|null  $subreddit = null, string|null  $sort = null, string|null  $time = null, string|null  $type = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Perform a search query.

Somewhat untested due to the complexity of and possible combinations to use in the search function.

Parameters

string $query

Query of which to search.

string|null $subreddit

Subreddit to which to restrict search.

string|null $sort

Sort results by one of 'relevance', 'hot', 'top', 'new', 'comments'. Defaults to 'relevance'.

string|null $time

One of 'hour', 'day', 'week', 'month', 'year', 'all'. Defaults to all.

string|null $type

Comma-delimited list of result types: 'sr', 'link', or null.

integer $limit

Upper limit of results to return.

string|null $after

Obtain list items below this thing ID.

string|null $before

Obtain list of items above this thing ID.

Returns

object —

Listing of search results

aboutSubreddit()

aboutSubreddit(string  $subreddit) : object

Retrieves information about the specified subreddit, including subreddit ID.

Parameters

string $subreddit

Name of subreddit for which to retrieve information.

Returns

object —

Contains subreddit information.

getBanned()

getBanned(string  $subreddit, string|null  $user = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieve a list of banned users from the specified subreddit. Must be a mod with access permissions.

Using pagination will result in the last item of the previous page appearing as the first item of the next page.

Parameters

string $subreddit

Subreddit for which to retrieve banned users.

string|null $user

Jump to a specific user. Will return an empty list if user is not on list.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of users.

getMuted()

getMuted(string  $subreddit, string|null  $user = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieve a list of muted users from the specified subreddit. Must be a mod with access permissions.

Using pagination will result in the last item of the previous page appearing as the first item of the next page.

Parameters

string $subreddit

Subreddit for which to retrieve muted users.

string|null $user

Jump to a specific user. Will return an empty list if user is not on list.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of users.

getWikiBanned()

getWikiBanned(string  $subreddit, string|null  $user = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieve a list of wiki banned users from the specified subreddit. Must be a mod with access permissions.

Using pagination will result in the last item of the previous page appearing as the first item of the next page.

Parameters

string $subreddit

Subreddit for which to retrieve wiki banned users.

string|null $user

Jump to a specific user. Will return an empty list if user is not on list.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of users.

getContributors()

getContributors(string  $subreddit, string|null  $user = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieve a list of approved submitters from the specified subreddit. Must be a mod or approved submitter in subreddit.

Using pagination will result in the last item of the previous page appearing as the first item of the next page.

Parameters

string $subreddit

Subreddit for which to retrieve approved submitters.

string|null $user

Jump to a specific user. Will return an empty list if user is not on list.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of users.

getWikiContributors()

getWikiContributors(string  $subreddit, string|null  $user = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieve a list of approved wiki contributors from the specified subreddit. Must be a mod or approved wiki contributor in subreddit.

Using pagination will result in the last item of the previous page appearing as the first item of the next page.

Parameters

string $subreddit

Subreddit for which to retrieve approved wiki contributors.

string|null $user

Jump to a specific user. Will return an empty list if user is not on list.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of users.

getModerators()

getModerators(string  $subreddit, string|null  $user = null) : object

Retrieve a list of moderators from the specified subreddit. Must have read access to subreddit.

This function does not use pagination, but it's here anyway in case that's changed in the future.

Parameters

string $subreddit

Subreddit for which to retrieve moderators.

string|null $user

Jump to a specific user. Will return an empty list if user is not on list.

Returns

object —

Listing of users.

uploadSubredditImage()

uploadSubredditImage(string  $subreddit, string  $file, string  $name, string  $upload_type = 'img', string  $image_type = 'png') : object

Upload an image to the specified subreddit.

Parameters

string $subreddit

Subreddit to which to upload image.

string $file

Relative or absolute path of file to upload from local machine.

string $name

If $upload_type is 'img', assign the image this name. Ignored otherwise.

string $upload_type

One of 'img', 'header', 'icon', 'banner'. As of now, 'icon' and 'banner' will result in an error.

string $image_type

One of 'png' or 'jpg'.

Returns

object —

Response to API call. On success, shows image URL. Null if the local file cannot be found.

deleteSubredditBanner()

deleteSubredditBanner(string  $subreddit) : object

Remove the subreddit's custom mobile banner.

Parameters

string $subreddit

Subreddit from which to remove the banner.

Returns

object —

Response to API call.

deleteSubredditHeaderImage()

deleteSubredditHeaderImage(string  $subreddit) : object

Remove the subreddit's custom header image.

Parameters

string $subreddit

Subreddit from which to remove the header image.

Returns

object —

Response to API call.

deleteSubredditIcon()

deleteSubredditIcon(string  $subreddit) : object

Remove the subreddit's custom mobile icon.

Parameters

string $subreddit

Subreddit from which to remove the icon.

Returns

object —

Response to API call.

deleteSubredditImage()

deleteSubredditImage(string  $subreddit, string  $image_name) : object

Remove an image from the subreddit's custom image set.

Parameters

string $subreddit

Subreddit from which to remove the image.

string $image_name

The name of the image to delete.

Returns

object —

Response to API call.

getRecommendedSubreddits()

getRecommendedSubreddits(string  $subreddits, string|null  $omit = null) : array

Retrieve a list of recommended subreddits based on the names of existing ones.

Parameters

string $subreddits

Comma-delimited list of subreddits on which to base recommendations.

string|null $omit

Omit these specific subreddits from results.

Returns

array —

Recommended subreddit objects containing subreddit names.

searchSubredditsByName()

searchSubredditsByName(string  $query, boolean  $include_nsfw = true, boolean  $exact = false) : object

List subreddit names that begin with a query string.

Parameters

string $query

Search for subreddits that start with this. Maximum 50 characters, all printable.

boolean $include_nsfw

Include subreddits that are set as NSFW (over_18).

boolean $exact

Only return exact match.

Returns

object —

Contains an array of subreddit names.

getSubmitText()

getSubmitText(string  $subreddit) : object

Retrieves the "submitting to /r/$subreddit" text for the selected subreddit.

Parameters

string $subreddit

Name of subreddit from which to obtain submit text.

Returns

object —

Response to API call, containing the subreddit's submit_text.

getSubredditStylesheet()

getSubredditStylesheet(string  $subreddit) : object

Get a subreddit's stylesheet.

Parameters

string $subreddit

Subreddit of which to retrieve stylesheet.

Returns

object —

Wikipage object of subreddit's stylesheet, including text and list of images.

setSubredditStylesheet()

setSubredditStylesheet(string  $subreddit, string  $contents, string|null  $reason = null) : object

Set a subreddit's stylesheet.

Parameters

string $subreddit

Subreddit of which to set stylesheet.

string $contents

Contents of stylesheet, probably pretty long.

string|null $reason

Since the stylesheet is a wiki page, optionally provide a reason for editing.

Returns

object —

Response to API call, possibly containing errors if invalid CSS.

searchSubredditsByTopic()

searchSubredditsByTopic(string  $query) : array

Search for subreddits by topic keywords.

Parameters

string $query

Query with which to search.

Returns

array —

List of objects containing subreddit names.

subscribe()

subscribe(string  $subreddit) : object

Subscribe to a subreddit. Must have read access to the subreddit.

Parameters

string $subreddit

Subreddit to which to subscribe.

Returns

object —

Response to API call, probably empty.

unsubscribe()

unsubscribe(string  $subreddit) : object

Unsubscribe from a subreddit.

Parameters

string $subreddit

Subreddit from which to unsubscribe.

Returns

object —

Response to API call, probably empty. 404 error if not already subscribed.

getSubredditSettings()

getSubredditSettings(string  $subreddit) : object

Retrieve a list of the subreddit's settings. Must be a moderator.

Parameters

string $subreddit

The subreddit to retrieve.

Returns

object —

Contains information about a subreddit's settings.

getSubredditSidebar()

getSubredditSidebar(string  $subreddit) : object

Get a subreddit's sidebar contents.

Parameters

string $subreddit

Subreddit of which to retrieve sidebar.

Returns

object —

Wikipage object of subreddit's sidebar.

getStickies()

getStickies(string  $subreddit) : array

Retrieve a subreddit's stickied posts.

Parameters

string $subreddit

Subreddit from which to retrieve sticky posts.

Returns

array —

Contains link objects that are stickied in the subreddit. None if no sticky. If two, top sticky is first.

searchSubreddits()

searchSubreddits(string  $query, string  $sort = 'relevance', integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Search for subreddits by title and description.

Parameters

string $query

Query with which to search

string $sort

Sorting method. One of 'relevance', 'activity'

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of subreddits that match the search query.

getMySubscribedSubreddits()

getMySubscribedSubreddits(integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieve a list of the current user's subscribed subreddits.

Parameters

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of subreddits.

getMyContributedSubreddits()

getMyContributedSubreddits(integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieve a list of the current user's subreddits in which they are an approved submitter.

Parameters

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of subreddits.

getMyModeratedSubreddits()

getMyModeratedSubreddits(integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieve a list of the current user's subreddits in which they are a moderator.

Parameters

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of subreddits.

getPopularSubreddits()

getPopularSubreddits(integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves a list of popular subreddits.

Parameters

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of subreddits.

getNewSubreddits()

getNewSubreddits(integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves a list of new subreddits.

Parameters

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of subreddits.

getGoldOnlySubreddits()

getGoldOnlySubreddits(integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves a list of gold-only subreddits.

Parameters

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of subreddits.

getDefaultSubreddits()

getDefaultSubreddits(integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves a list of default subreddits.

Parameters

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of subreddits.

createSubreddit()

createSubreddit(string  $subreddit, array  $settings, boolean  $i_read_the_documentation = false) : object

Create a new subreddit.

Parameters

string $subreddit

Name of subreddit to create.

array $settings

An array containing a key-value pair for each option you want to set (TITLE IS REQUIRED): 'allow_top' (boolean) Allow this subreddit to be included /r/all as well as the default and trending lists. 'collapse_deleted_comments' (boolean) Collapse deleted and removed comments. 'comment_score_hide_mins' (int) Minutes to hide comment scores. 'description' (string) Sidebar text. 'exclude_banned_modqueue' (boolean) Exclude posts by site-wide banned users from modqueue/unmoderated. 'header-title' (string) Header mouseover text. 'hide_ads' (boolean) Hide ads (only available for gold only subreddits). 'lang' (string) Language, a valid IETF language tag (underscore separated). 'link_type' (string) Content options. One of 'any', 'link', 'self'. 'over_18' (boolean) Viewers must be over eighteen years old. 'public_description' (string) Description, appears in search results and social media links. 'public_traffic' (boolean) Make the traffic stats page available to everyone. 'show_media' (boolean) Show thumbnail images of content. 'spam_comments' (string) Spam filter strength for comments. One of 'low', 'high', 'all'. 'spam_links' (string) Spam filter strength for links. One of 'low', 'high', 'all'. 'spam_selfposts' (string) Spam filter strength for self posts. One of 'low', 'high', 'all'. 'submit_link_label' (string) Custom label for submit link button (blank for default). 'submit_text' (string) Submission text, text to show on submission page. 'submit_text_label' (string) Custom label for submit text post button (blank for default). 'suggested_comment_sort' (string) Suggested comment sort. One of 'confidence', 'top', 'new', 'hot', 'controversial', 'old', 'random', 'qa' 'title' (string) Subreddit title, shown in the browser tab. 'type' (string) Subreddit type. One of 'restricted', 'private', 'public'. Other values are 'gold_restricted', 'archived', 'gold_only' and 'employees_only', but result in errors. 'wiki_edit_age' (int) Account age (days) required to edit and create wiki pages. 'wiki_edit_karma' (int) Subreddit karma required to edit and create wiki pages. 'wikimode' (string) Who should be able to edit the wiki. One of 'disabled', 'modonly', 'anyone'.

boolean $i_read_the_documentation

Must be set to true to show that you've read this.

Returns

object —

Response to API call. (Watch for RATELIMIT errors.)

editSubreddit()

editSubreddit(string  $subreddit, array  $settings, boolean  $i_read_the_documentation = false) : object

Change a subreddit's configuration.

Parameters

string $subreddit

Name of subreddit to change.

array $settings

An array containing a key-value pair for each option you want to change: 'allow_top' (boolean) Allow this subreddit to be included /r/all as well as the default and trending lists. 'collapse_deleted_comments' (boolean) Collapse deleted and removed comments. 'comment_score_hide_mins' (int) Minutes to hide comment scores. 'description' (string) Sidebar text. 'exclude_banned_modqueue' (boolean) Exclude posts by site-wide banned users from modqueue/unmoderated. 'header-title' (string) Header mouseover text. 'hide_ads' (boolean) Hide ads (only available for gold only subreddits). 'lang' (string) Language, a valid IETF language tag (underscore separated). 'link_type' (string) Content options. One of 'any', 'link', 'self'. 'over_18' (boolean) Viewers must be over eighteen years old. 'public_description' (string) Description, appears in search results and social media links. 'public_traffic' (boolean) Make the traffic stats page available to everyone. 'show_media' (boolean) Show thumbnail images of content. 'spam_comments' (string) Spam filter strength for comments. One of 'low', 'high', 'all'. 'spam_links' (string) Spam filter strength for links. One of 'low', 'high', 'all'. 'spam_selfposts' (string) Spam filter strength for self posts. One of 'low', 'high', 'all'. 'submit_link_label' (string) Custom label for submit link button (blank for default). 'submit_text' (string) Submission text, text to show on submission page. 'submit_text_label' (string) Custom label for submit text post button (blank for default). 'suggested_comment_sort' (string) Suggested comment sort. One of 'confidence', 'top', 'new', 'hot', 'controversial', 'old', 'random', 'qa'. 'title' (string) Subreddit title, shown in the browser tab. 'type' (string) Subreddit type. One of 'restricted', 'private', 'public'. Other values are 'gold_restricted', 'archived', 'gold_only' and 'employees_only', but result in errors. 'wiki_edit_age' (int) Account age (days) required to edit and create wiki pages. 'wiki_edit_karma' (int) Subreddit karma required to edit and create wiki pages. 'wikimode' (string) Who should be able to edit the wiki. One of 'disabled', 'modonly', 'anyone'.

boolean $i_read_the_documentation

Must be set to true to show that you've read this.

Returns

object —

Response to API call. (RATELIMIT errors can be ignored if you have recently created a subreddit.)

addFriend()

addFriend(string  $user, string|null  $note = null) : object

Adds the specified user as a friend.

Parameters

string $user

Username of friend to add.

string|null $note

Note to add to friend record. Currently only available to those with reddit gold.

Returns

object —

A friend record object.

removeFriend()

removeFriend(string  $user) : null

Removes the specified user as a friend.

Parameters

string $user

Username of user to remove.

Returns

null —

Response to API call, null for some reason.

unblockUser()

unblockUser(string  $user) : object

Unblock a user by username.

Parameters

string $user

Username of user to unblock.

Returns

object —

Response to API call.

usernameAvailable()

usernameAvailable(string  $username) : object

Presumably checks whether the specified username is available, but endpoint is not working at this time.

Parameters

string $username

Username to check for availability.

Returns

object —

Response to API call.

getNotifications()

getNotifications(string|null  $start_date = null, string|null  $end_date = null, string|null  $sort = null) : array

Check notifications? Not documented by reddit.

Parameters

string|null $start_date

Start date of notification records.

string|null $end_date

End date of notification records.

string|null $sort

One of 'new', 'old', or null.

Returns

array —

List of notification objects from reddit.

markNotificationAsRead()

markNotificationAsRead(string  $thing_id, boolean  $read = true) : mixed

Mark a notification as read based on its thing ID.

Parameters

string $thing_id

Thing ID of the notification to mark as read.

boolean $read

Whether or not to mark as read. False doesn't seem to be working.

Returns

mixed —

Response to API call, probably null, but could change in the future.

getUserTrophies()

getUserTrophies(string  $user) : object

Get a user's trophies.

Parameters

string $user

Username of user for whom to retrieve trophies.

Returns

object —

Listing of trophies.

getUser()

getUser(string  $user) : object

Retrieve information about the specified user.

Parameters

string $user

Username of user to retrieve.

Returns

object —

Response to API call containing user object.

getUserOverview()

getUserOverview(string  $user = null, string|null  $sort = null, string|null  $time = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Obtain posts and comments made by the specified user.

Parameters

string $user

Username of user for whom to retrieve records. Defaults to the current user.

string|null $sort

Sorting method. One of 'hot', 'new', 'top', 'controversial', or null.

string|null $time

One of 'hour', 'day', 'week', 'month', 'year', 'all', or null.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of posts and comments made by the specified user.

getUserSubmitted()

getUserSubmitted(string  $user = null, string|null  $sort = null, string|null  $time = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Obtain only posts made by the specified user.

Parameters

string $user

Username of user for whom to retrieve records. Defaults to the current user.

string|null $sort

Sorting method. One of 'hot', 'new', 'top', 'controversial', or null.

string|null $time

One of 'hour', 'day', 'week', 'month', 'year', 'all', or null.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of posts comments made by the specified user.

getUserComments()

getUserComments(string  $user = null, string|null  $sort = null, string|null  $time = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Obtain only comments made by the specified user.

Parameters

string $user

Username of user for whom to retrieve records. Defaults to the current user.

string|null $sort

Sorting method. One of 'hot', 'new', 'top', 'controversial', or null.

string|null $time

One of 'hour', 'day', 'week', 'month', 'year', 'all', or null.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of comments made by the specified user.

getUserUpvoted()

getUserUpvoted(string  $user = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Obtain posts and comments upvoted by the specified user.

Parameters

string $user

Username of user for whom to retrieve records. Defaults to the current user.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of posts and comments upvoted by the specified user.

getUserDownvoted()

getUserDownvoted(string  $user = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Obtain posts and comments downvoted by the specified user.

Parameters

string $user

Username of user for whom to retrieve records. Defaults to the current user.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of posts and comments downvoted by the specified user.

getUserHidden()

getUserHidden(string  $user = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Obtain posts and comments hidden by the specified user.

Parameters

string $user

Username of user for whom to retrieve records. Defaults to the current user.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of posts and comments hidden by the specified user.

getUserSaved()

getUserSaved(string  $user = null, string|null  $sort = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Obtain posts and comments saved by the specified user.

Parameters

string $user

Username of user for whom to retrieve records. Defaults to the current user.

string|null $sort

Sorting method. One of 'hot', 'new', 'top', 'controversial', or null.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of posts and comments saved by the specified user.

getUserGildingsReceived()

getUserGildingsReceived(string  $user = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Obtain posts and comments gilded (received) by the specified user.

Parameters

string $user

Username of user for whom to retrieve records. Defaults to the current user.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of posts and/or comments made by the specified user.

getUserGildingsGiven()

getUserGildingsGiven(string  $user = null, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Obtain posts and comments gilded (given) by the specified user.

Parameters

string $user

Username of user for whom to retrieve records. Defaults to the current user.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of posts and/or comments made by the specified user.

wikiAllowEditor()

wikiAllowEditor(string  $subreddit, string  $username, string  $pagename) : object

Allow the specified user to edit the specified wiki page.

Parameters

string $subreddit

Subreddit of the wiki page.

string $username

Username of user to allow.

string $pagename

Name of page to allow user to edit.

Returns

object —

Response to API call. Probably empty, but could contain errors, such as PAGE_NOT_FOUND.

wikiDisallowEditor()

wikiDisallowEditor(string  $subreddit, string  $username, string  $pagename) : object

Remove the specified user from the allowed editors list of the specified wiki page.

Parameters

string $subreddit

Subreddit of the wiki page.

string $username

Username of user to allow.

string $pagename

Name of page to disallow user to edit.

Returns

object —

Response to API call. Probably empty, but could contain errors, such as PAGE_NOT_FOUND.

wikiGetPages()

wikiGetPages(string  $subreddit) : object

Retrieves a list of all pages of the specified subreddit's wiki.

Parameters

string $subreddit

Subreddit for which to retrieve pages.

Returns

object —

Listing of wiki pages.

wikiGetPage()

wikiGetPage(string  $subreddit, string  $pagename, string|null  $revision_id = null, string|null  $compare_with = null) : mixed

Retrieves the specified wiki page, optionally at a specific revision or a comparison between revisions.

Parameters

string $subreddit

Subreddit in which to retrieve page.

string $pagename

Page to retrieve.

string|null $revision_id

Specific revision ID to retrieve (optional).

string|null $compare_with

ID of revision with which to compare $revision_id (optional2). May not be working.

Returns

mixed

wikiGetRevisions()

wikiGetRevisions(string  $subreddit, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves a listing of wiki revisions for all pages within the specified subreddit.

Parameters

string $subreddit

Subreddit for which to retrieve revisions.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of wiki page revisions.

wikiGetPageRevisions()

wikiGetPageRevisions(string  $subreddit, string  $pagename, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves a listing of wiki revisions for the specified page within the specified subreddit.

Parameters

string $subreddit

Subreddit for which to retrieve revisions.

string $pagename

Page for which to retrieve revisions.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of wiki page revisions.

wikiEditPage()

wikiEditPage(string  $subreddit, string  $pagename, string  $content, string|null  $reason = null, string|null  $previous = null) : object

Edit or create a wiki page.

Parameters

string $subreddit

Subreddit in which to edit page.

string $pagename

Page to edit.

string $content

Content with which to overwrite page.

string|null $reason

Reason for revision, optional.

string|null $previous

Revision ID on which to base this edit. Handled by function, so optional.

Returns

object

wikiToggleHideRevision()

wikiToggleHideRevision(string  $subreddit, string  $pagename, string  $revision_id) : object

Toggle a revision's status of hidden.

Parameters

string $subreddit

Subreddit of revision.

string $pagename

Pagename of revision.

string $revision_id

ID of revision to toggle hidden status.

Returns

object —

Response to API call. Status attribute is true if the revision is now hidden, false if shown.

wikiHideRevision()

wikiHideRevision(string  $subreddit, string  $pagename, string  $revision_id) : object

Hide a revision from revision listing.

This may take two calls, since the only way to get a revision's hidden status is to toggle it.

Parameters

string $subreddit

Subreddit of revision.

string $pagename

Pagename of revision.

string $revision_id

ID of revision to hide.

Returns

object —

Response to API call. Status attribute is true if the revision is now hidden, false if shown.

wikiUnhideRevision()

wikiUnhideRevision(string  $subreddit, string  $pagename, string  $revision_id) : object

Unhide a revision in the revision listing.

This may take two calls, since the only way to get a revision's hidden status is to toggle it.

Parameters

string $subreddit

Subreddit of revision.

string $pagename

Pagename of revision.

string $revision_id

ID of revision to unhide.

Returns

object —

Response to API call. Status attribute is true if the revision is now hidden, false if shown.

wikiRevertToRevision()

wikiRevertToRevision(string  $subreddit, string  $pagename, string  $revision_id) : object

Revert a wiki page to a previous revision.

Parameters

string $subreddit

Subreddit of revision.

string $pagename

Pagename of revision.

string $revision_id

ID of revision to which to revert.

Returns

object —

Response to API call, probably empty.

wikiGetPageDiscussions()

wikiGetPageDiscussions(string  $subreddit, string  $pagename, integer  $limit = 25, string|null  $after = null, string|null  $before = null) : object

Retrieves a listing of discussions about a certain wiki page.

Parameters

string $subreddit

Subreddit of page.

string $pagename

Page for which to retrieve discussions.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of posts.

wikiGetPageSettings()

wikiGetPageSettings(string  $subreddit, string  $pagename) : object

Get the specified page's settings in the specified subreddit.

Parameters

string $subreddit

Subreddit of page.

string $pagename

Name of page.

Returns

object —

Settings object for wiki page.

wikiUpdatePageSettings()

wikiUpdatePageSettings(string  $subreddit, string  $pagename, integer|null  $permlevel = null, boolean|null  $listed = null) : object

Update the specified page's settings in the specified subreddit.

Parameters

string $subreddit

Subreddit of page.

string $pagename

Name of page.

integer|null $permlevel

Permissions level for page. 0 for use subreddit wiki permissions, 1 for only approved editors, 2 for only mods, null to not update.

boolean|null $listed

Show this page on the list of wiki pages. True to show, false to hide, null to not update.

Returns

object —

Settings object for wiki page.

apiCall()

apiCall(  $path,   $method = 'GET',   $params = null,   $json = false) 

Parameters

$path
$method
$params
$json

getSubredditListing()

getSubredditListing(string  $listing, string  $subreddit, string  $limit, string  $after, string  $before, string|null  $time = null) : mixed|null

Private function to unify process of retrieving several subreddit listings.

Parameters

string $listing

Listing type. Can be hot, new, controversial, top, gilded, ads.

string $subreddit
string $limit
string $after
string $before
string|null $time

Returns

mixed|null

getSubredditModListing()

getSubredditModListing(string  $subreddit, string  $location, integer  $limit, string|null  $after, string|null  $before, string|null  $only) : object

Private function to unify process of retrieving several subreddit mod listings.

Parameters

string $subreddit

Subreddit for which to retrieve a listing.

string $location

One of 'reports', 'spam', 'modqueue', 'unmoderated', 'edited'.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

string|null $only

Obtain only links or comments. One of 'links' or 'comments'. Null for both.

Returns

object —

Listing of selected subreddit's posts and/or comments at the selected location.

getSubredditUsers()

getSubredditUsers(string  $location, string  $subreddit, string|null  $user, integer  $limit, string|null  $after, string|null  $before) : object

Private function for obtaining a subreddit's /about/$location user listings.

Using pagination will result in the last item of the previous page appearing as the first item of the next page.

Parameters

string $location

One of 'banned', 'muted', 'wikibanned', 'contributors', 'wikicontributors', 'moderators'

string $subreddit

Subreddit for which to obtain the listing.

string|null $user

Jump to a specific user.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of users.

getMySubreddits()

getMySubreddits(string  $location, integer  $limit, string|null  $after, string|null  $before) : object

Private method for retrieving /subreddits/mine/$location.

Parameters

string $location

One of 'subscriber', 'contributor', 'moderator'

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of subreddits.

getSubreddits()

getSubreddits(string  $location, integer  $limit, string|null  $after, string|null  $before) : object

Private function for retrieving a list of all subreddits by $location

Parameters

string $location

One of 'popular', 'new', 'gold', 'default'.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

Returns

object —

Listing of subreddits.

getUserListing()

getUserListing(string  $location, string  $user, string|null  $sort, integer  $limit, string|null  $after, string|null  $before, string|null  $time = null, string|null  $show = null) : object

Private method for obtaining a specific user's post and comment listings.

Parameters

string $location

One of 'overview', 'submitted', 'comments', 'upvoted', 'downvoted', 'hidden', 'saved', 'gilded'.

string $user

Username of user for whom to retrieve records. Defaults to the current user.

string|null $sort

Sorting method. One of 'hot', 'new', 'top', 'controversial', or null.

integer $limit

Upper limit of number of items to retrieve. Maximum is 100.

string|null $after

Get items lower on list than this entry. Does not mean chronologically.

string|null $before

Get items higher on list than this entry. Does not mean chronologically.

string|null $time

One of 'hour', 'day', 'week', 'month', 'year', 'all', or null.

string|null $show

When getting gildings, use 'given' to show gildings issued by the user. Defaults to gildings received.

Returns

object —

Listing of posts and/or comments made by the specified user.

getCaptchaResponse()

getCaptchaResponse(  $iden) 

Parameters

$iden