API:Patrol
From MediaWiki.org
This page is part of the MediaWiki action API documentation. |
MediaWiki action API
- Introduction and quick start
- FAQ
- Tutorial
- Formats
- Error reporting
- Restricting usage
- Cross-site requests
- Authentication
- Queries
- Searching (by title, content, coordinates...)
- Parsing wikitext and expanding templates
- Purging pages' caches
- Parameter information
- Changing wiki content
- Create and edit pages
- Move pages
- Merge pages
- Rollback
- Delete pages
- Restore deleted revisions
- (Un)protect pages
- (Un)block users
- (Un)watch pages
- Mark revisions of watched pages as visited
- Send email
- Patrol changes
- Import pages
- Change user group membership
- Upload files
- User options
- Tokens
- Page language
- More...
- Watchlist feed
- Wikidata
- Extensions
- Using the API in MediaWiki and extensions
- Miscellaneous
- Implementation
- Client code
- Asserting
MediaWiki version: | ≥ 1.14 |
Token[edit]
To patrol a request, a patrol token is required. Since MediaWiki 1.17, the patrol token has no longer been the same as the edit token. The patrol token is the same for all pages, but changes at every login. Patrol tokens can be obtained via action=tokens with type=patrol (MW 1.20+), or by using the following method:
Obtaining a patrol token
Result |
---|
<?xml version="1.0" encoding="utf-8"?>
<api>
<query-continue>
<recentchanges rcstart="2008-09-06T10:49:06Z" />
</query-continue>
<query>
<recentchanges>
<rc type="edit" ns="0" title="Sites using MediaWiki/uk"
rcid="228053" pageid="25473" revid="210889"
old_revid="210888" timestamp="2008-09-06T10:58:33Z"
patroltoken="8f45aa1dfd9725b4d6a71c66959b111f+\" />
</recentchanges>
</query>
</api>
|
Patrolling changes[edit]
You can patrol changes using action=patrol. Note that this module only accepts POST requests.
Parameters[edit]
rcid
: Recentchanges ID to patrol.revid
: Revision ID to patrol. 1.22+tags
: Change tags to apply to the entry in the patrol log. 1.27+token
: The token obtained in the previous request. Take care to encode the+
as%2B
Example[edit]
Patrolling rcid 242005359
Result |
---|
<?xml version="1.0" encoding="utf-8"?>
<api>
<patrol rcid="242005359" />
</api>
|
Possible errors[edit]
In addition to the usual stuff:
Code | Info |
---|---|
nosuchrcid | There is no change with rcid "id" |
patroldisabled | Patrolling is disabled on this wiki |
noautopatrol | You are not allowed to mark your own changes as patrolled. Only users with the
autopatrol right can do this |
The following documentation is the output of Special:ApiHelp/patrol, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
action=patrol
(main | patrol)
- This module requires read rights.
- This module requires write rights.
- This module only accepts POST requests.
- Source: MediaWiki
- License: GPL-2.0+
Patrol a page or revision.
Parameters:
- rcid
-
Recentchanges ID to patrol.
- Type: integer
- revid
-
Revision ID to patrol.
- Type: integer
- tags
-
Change tags to apply to the entry in the patrol log.
- Values (separate with | or alternative):
- token
-
A "patrol" token retrieved from action=query&meta=tokens
- This parameter is required.
Examples:
- Patrol a recent change.
- api.php?action=patrol&token=123ABC&rcid=230672766 [open in sandbox]
- Patrol a revision.
- api.php?action=patrol&token=123ABC&revid=230672766 [open in sandbox]