עזרה של MediaWiki API
זהו דף תיעוד של API שנוצר באופן אוטומטי.
תיעוד ודוגמאות: https://www.mediawiki.org/wiki/API
action=protect
- יחידה זו דורשת הרשאות קריאה.
- יחידה זו דורשת הרשאות כתיבה.
- יחידה זו מקבלת רק בקשות POST.
Change the protection level of a page.
- title
Title of the page to (un)protect. Cannot be used together with pageid.
- pageid
ID of the page to (un)protect. Cannot be used together with title.
- protections
List of protection levels, formatted action=level (e.g. edit=sysop).
Note: Any actions not listed will have restrictions removed.
- פרמטר זה נדרש.
- הפרדה בין ערכים נעשית באמצעות | מספר הערכים המרבי הוא 50 (עבור בוטים – 500).
- expiry
Expiry timestamps. If only one timestamp is set, it'll be used for all protections. Use infinite, indefinite, infinity, or never, for a never-expiring protection.
- הפרדה בין ערכים נעשית באמצעות | מספר הערכים המרבי הוא 50 (עבור בוטים – 500).
- ברירת מחדל: infinite
- reason
Reason for (un)protecting.
- ברירת מחדל: (ריק)
- cascade
Enable cascading protection (i.e. protect pages included in this page). Ignored if all protection levels given do not support cascading.
- watch
- מיושן.
If set, add the page being (un)protected to the current user's watchlist.
- watchlist
Unconditionally add or remove the page from the current user's watchlist, use preferences or do not change watch.
- ערך אחד: watch, unwatch, preferences, nochange
- ברירת מחדל: preferences
- token
אסימון "csrf" אוחזר מ־action=query&meta=tokens
- פרמטר זה נדרש.
- הגנה על דף.
- api.php?action=protect&title=Main%20Page&token=123ABC&protections=edit=sysop|move=sysop&cascade=&expiry=20070901163000|never
- Unprotect a page by setting restrictions to all.
- api.php?action=protect&title=Main%20Page&token=123ABC&protections=edit=all|move=all&reason=Lifting%20restrictions
- Unprotect a page by setting no restrictions.
- api.php?action=protect&title=Main%20Page&token=123ABC&protections=&reason=Lifting%20restrictions