API:Deletedrevs
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
- Watchlist feed
- Wikidata
- Extensions
- Using the API in MediaWiki and extensions
- Miscellaneous
- Implementation
- Client code
- Asserting
| Deletedrevs | ||
|---|---|---|
This module cannot be used as a Generator. |
||
| Prefix | dr | |
| Required rights | deletedhistory | |
| Post only? | No | |
| Generated help | Current | |
| Version added |
|
|
- 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:
- List deleted revisions for the given titles (through
titlesor a generator), sorted by timestamp - List deleted contributions for a certain user, sorted by timestamp (
druserset, no titles given) - List all deleted revisions in a certain namespace (
drusernot 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 thatnamespacewas 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,drstartwas used as a continue in mode 2 rather thandrcontinue.drprop: Which properties to get (Default:user|comment)revid: Revision IDparentid: Revision ID of the previous revision to the page 1.18+user: User who made the revisionuserid: User ID who made the revision 1.17+comment: Edit commentparsedcomment: Parsed comment of the revision 1.16+minor: Whether the revision was minorlen: Revision sizecontent: Revision content. You need theundeleteordeletedtextright to use this optiontoken: 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+
Examples[edit]
Listing the 6 most recent deleted revisions from user Catrope dated September 4, 2007 (mode 2).
api.php? action=query& list=deletedrevs& drstart=20070904235959& drend=20070904000000& drprop=revid|user|minor|len|token& drlimit=6& druser=Catrope [try in ApiSandbox]
| Result |
|---|
<?xml version="1.0" encoding="utf-8"?>
<api>
<query-continue>
<deletedrevs drstart="20070904142729" />
</query-continue>
<query>
<deletedrevs>
<page title="Main Page" ns="0" token="e4c475f13be7824135b4edbebf4140ff+\">
<revisions>
<rev timestamp="20070904200804" revid="31" user="Catrope" minor="" len="" />
<rev timestamp="20070904200753" revid="30" user="Catrope" minor="" len="" />
<rev timestamp="20070904193501" revid="29" user="Catrope" minor="" len="568" />
<rev timestamp="20070904193213" revid="28" user="Catrope" minor="" len="470" />
</revisions>
</page>
<page title="User:Catrope" ns="2" token="e4c475f13be7824135b4edbebf4140ff+\">
<revisions>
<rev timestamp="20070904143938" revid="24" user="Catrope" len="52" />
<rev timestamp="20070904142758" revid="23" user="Catrope" len="37" />
</revisions>
</page>
</deletedrevs>
</query>
</api>
|
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. |