API:Protectedtitles
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
| Protectedtitles | ||
|---|---|---|
This module can be used as a Generator. |
||
| Prefix | pt | |
| Required rights | none | |
| Post only? | No | |
| Generated help | Current | |
| Version added |
|
|
Get a list of titles protected from creation.
Parameters[edit]
ptnamespace: Only list titles in these namespaces Type: namespace (pipe-separated)ptlevel: Only list titles with this protection level Type: string (pipe-separated)ptlimit: Maximum number of titles to return No more than 500 (5000 for bots) allowed. (Default: 10)ptdir: Direction to list in. (Default:older)older: List most recently protected titles first. Note:ptstartmust be later thanptend.newer: List least recently protected titles first. Note:ptstartmust be earlier thanptend.
ptstart: Start listing at this protection timestampptend: End listing at this protection timestampptprop: A pipe-separated list of properties to get. (Default:timestamp|level)timestamp: Timestamp the title was protecteduser: User who protected the titleuserid: User id who protected the title 1.17+comment: Protection log commentparsedcomment: Parsed protection log comment 1.16+expiry: Expiry timestamplevel: Protection level (i.e. the right needed to be able to create the page)
continue: When more results are available, use this to continue 1.23+
Example[edit]
Get the first 2 titles only sysops can create
| Result |
|---|
<?xml version="1.0" encoding="utf-8"?>
<api>
<query>
<protectedtitles>
<pt ns="0" title="Add article" timestamp="2009-02-13T21:26:59Z" level="sysop" />
<pt ns="0" title="Add an article" timestamp="2008-04-17T12:44:53Z" level="sysop" />
</protectedtitles>
</query>
</api>
|
Error Codes[edit]
None