Jump to content

API:Patrol

From mediawiki.org
Revision as of 10:09, 25 November 2018 by Shirayuki (talk | contribs) (translation tweaks)
MediaWiki version:
1.14

Token

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=query&meta=tokens with type=patrol:
Result
{
    "batchcomplete": "",
    "query": {
        "tokens": {
            "patroltoken": "c01933f8aa819a7889e0aa98bfd7533f5a1a5a81+\\"
        }
    }
}


Patrolling changes

You can patrol changes using action=patrol. Note that this module only accepts POST requests.

Parameters

  • 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

Patrolling rcid 242005359
Result
<?xml version="1.0" encoding="utf-8"?>
<api>
  <patrol rcid="242005359" />
</api>

Possible errors

In addition to the usual errors:

Code Info
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
notpatrollable The revision rid can't be patrolled as it's too old.
nosuchrcid There is no recent change with ID rcid.
nosuchrevid There is no revision with ID revid.


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-or-later

Patrol a page or revision.

Specific parameters:
Other general parameters are available.
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): AWB, convenient-discussions
token

A "patrol" token retrieved from action=query&meta=tokens

This parameter is required.