API:Deletedrevs

From MediaWiki.org
Jump to: navigation, search
This page is part of the MediaWiki action API documentation.

MediaWiki action API

v · d · e
NOTE: This module's behavior was changed significantly in MediaWiki 1.15. Some of the features described here are not available in MediaWiki 1.14 and earlier.

List deleted revisions. You need the deletedhistory right to use this module. This module cannot be used as a generator. This module can be used in one of three modes:

  1. List deleted revisions for the given titles (through titles or a generator), sorted by timestamp
  2. List deleted contributions for a certain user, sorted by timestamp (druser set, no titles given)
  3. List all deleted revisions in a certain namespace (druser not set, no titles given)

Some parameters are restricted to certain modes only, and are marked accordingly.

Parameters[edit]

  • drlimit: Maximum number of revisions to list No more than 500 (5000 for bots) allowed. (Default: 10)
  • druser: Only list revisions by this user 1.15+
  • drexcludeuser: Don't list revisions by this user 1.15+
  • drstart: The timestamp to start listing from. If not specified, all revisions earlier than drend will be listed.[1]
  • drend: The timestamp to end listing at. If not specified, all revisions later than drstart will be listed.[1]
  • drdir: Direction to list in.[1] (Default: older)
    • older: List newest revisions first. Note: drstart has to be later than drend.
    • newer: List oldest revisions first. Note: drstart has to be earlier than drend.
  • drnamespace: List all deleted revisions in this namespace.[2] (Note that namespace was included in the original 1.12 as a pipe-separated list of values, but was removed in 1.13. In 1.15, it was reintroduced as a single-valued parameter.) 1.15+
  • drunique: List only one revision for each page[2] 1.15+
  • drfrom: Start listing at this title[2] 1.15+
  • drto: Stop listing at this title[2] 1.18+
  • drprefix: Search for all page titles that begin with this value[2] 1.18+
  • drcontinue: When more results are available, use this to continue. Note: prior to MW 1.23, drstart was used as a continue in mode 2 rather than drcontinue.
  • drprop: Which properties to get (Default: user|comment)
    • revid: Revision ID
    • parentid: Revision ID of the previous revision to the page 1.18+
    • user: User who made the revision
    • userid: User ID who made the revision 1.17+
    • comment: Edit comment
    • parsedcomment: Parsed comment of the revision 1.16+
    • minor: Whether the revision was minor
    • len: Revision size
    • content: Revision content. You need the undelete or deletedtext right to use this option
    • token: Undelete token (Deprecated in 1.24)
    • sha1: SHA-1 (base 16) of the revision 1.19+
    • tags: Tags for the revision 1.23+
  • drtag: Only list revisions tagged with this tag 1.23+
  1. 1.0 1.1 1.2 Modes 1 and 2 only
  2. 2.0 2.1 2.2 2.3 2.4 Mode 3 only

Examples[edit]

Listing the 6 most recent deleted revisions from user Catrope dated September 4, 2007 (mode 2).

Error Codes[edit]

Code Info
drpermissiondenied You don't have permission to view deleted revision information. On most wikis, viewing deleted revisions is restricted to sysops, but other wikis may have different rules.
drpermissiondenied You don't have permission to view deleted revision content.




list=deletedrevs (dr)

(main | query | deletedrevs)
  • This module is deprecated.
  • This module requires read rights.
  • Source: MediaWiki
  • License: GPL-2.0+

List deleted revisions.

Operates in three modes:

  1. List deleted revisions for the given titles, sorted by timestamp.
  2. List deleted contributions for the given user, sorted by timestamp (no titles specified).
  3. List all deleted revisions in the given namespace, sorted by title and timestamp (no titles specified, druser not set).

Certain parameters only apply to some modes and are ignored in others.

Parameters:
drstart

The timestamp to start enumerating from.

Modes: 1, 2
Type: timestamp (allowed formats)
drend

The timestamp to stop enumerating at.

Modes: 1, 2
Type: timestamp (allowed formats)
drdir

In which direction to enumerate:

newer
List oldest first. Note: drstart has to be before drend.
older
List newest first (default). Note: drstart has to be later than drend.
Modes: 1, 3
One of the following values: newer, older
Default: older
drfrom

Start listing at this title.

Mode: 3
drto

Stop listing at this title.

Mode: 3
drprefix

Search for all page titles that begin with this value.

Mode: 3
drunique

List only one revision for each page.

Mode: 3
Type: boolean (details)
drnamespace

Only list pages in this namespace.

Mode: 3
One of the following values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 90, 91, 92, 93, 100, 101, 102, 103, 104, 105, 106, 107, 486, 487, 828, 829, 1198, 1199, 2300, 2301, 2302, 2303, 2600, 5500, 5501
Default: 0
drtag

Only list revisions tagged with this tag.

druser

Only list revisions by this user.

Type: user name
drexcludeuser

Don't list revisions by this user.

Type: user name
drprop

Which properties to get:

revid
Adds the revision ID of the deleted revision.
parentid
Adds the revision ID of the previous revision to the page.
user
Adds the user who made the revision.
userid
Adds the ID of the user who made the revision.
comment
Adds the comment of the revision.
parsedcomment
Adds the parsed comment of the revision.
minor
Tags if the revision is minor.
len
Adds the length (bytes) of the revision.
sha1
Adds the SHA-1 (base 16) of the revision.
content
Adds the content of the revision.
token
Deprecated. Gives the edit token.
tags
Tags for the revision.
Values (separate with | or alternative): revid, parentid, user, userid, comment, parsedcomment, minor, len, sha1, content, token, tags
Default: user|comment
drlimit

The maximum amount of revisions to list.

No more than 500 (5,000 for bots) allowed.
Type: integer or max
Default: 10
drcontinue

When more results are available, use this to continue.

Examples:
List the last deleted revisions of the pages Main Page and Talk:Main Page, with content (mode 1).
api.php?action=query&list=deletedrevs&titles=Main%20Page|Talk:Main%20Page&drprop=user|comment|content [open in sandbox]
List the last 50 deleted contributions by Bob (mode 2).
api.php?action=query&list=deletedrevs&druser=Bob&drlimit=50 [open in sandbox]
List the first 50 deleted revisions in the main namespace (mode 3).
api.php?action=query&list=deletedrevs&drdir=newer&drlimit=50 [open in sandbox]
List the first 50 deleted pages in the Talk namespace (mode 3).
api.php?action=query&list=deletedrevs&drdir=newer&drlimit=50&drnamespace=1&drunique= [open in sandbox]