راهنمای واسط برنامه‌نویسی کاربردی مدیاویکی

این یک صفحهٔ مستندات برای واسط برنامه‌نویسی کاربردی مدیاویکی است که به‌طور خودکار ایجاد شده‌است.

مستندات و نمونه‌ها: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page

(main | wbsetsitelink)
  • این پودمان نیازمند اختیارات خواندن است.
  • این پودمان نیازمند اختیارات خواندن است.
  • این پودمان تنها درخواست‌های POST را می‌پذیرد.
  • منبع: WikibaseClient
  • مجوز: GPL-2.0-or-later

Associates a page on a wiki with a Wikibase item or removes an already made such association.

پارامترها:
id

The identifier for the entity, including the prefix. Use either id or site and title together.

new

If set, a new entity will be created. Set this to the type of the entity you want to create.

یکی از مقدارهای زیر: item، property
site

An identifier for the site on which the page resides. Use together with title to make a complete sitelink.

یکی از مقدارهای زیر:
title

Title of the page to associate. Use together with site to make a complete sitelink.

baserevid

The numeric identifier for the revision to base the modification on. This is used for detecting conflicts during save.

نوع: عدد صحیح
summary

خلاصه ویرایش. یک نظر خود به خودی ایجاد می‌شود. محدودیت طول آن، ۲۶۰ نویسه است. دقت کنید که بیشتر از آن نشان داده نمی‌شود.

tags

Change tags to apply to the revision.

مقدارهای (جداشده با | یا جایگزین‌های آن):
token

یک بلیط «csrf» واکشی‌شده از action=query&meta=tokens

این پارامتر الزامی است.
bot

این ویرایش را به عنوان ربات علامتگذاری کن. فلگ یوآرال تنها در صورتی قابل اعتنا است که کاربر موردنظر عضو گروه «ربات» باشد.

نوع: بولی (جزئیات)
linksite

The identifier of the site on which the page to link resides

این پارامتر الزامی است.
یکی از مقدارهای زیر:
linktitle

The title of the page to link. If this parameter is an empty string or both linktitle and badges are not set, the link will be removed.

badges

The IDs of items to be set as badges. They will replace the current ones. If this parameter is not set, the badges will not be changed

مقدارهای (جداشده با | یا جایگزین‌های آن):
نمونه‌ها:
Add a sitelink to the English page "Hydrogen" to the item with ID Q999999998, if the sitelink does not exist
api.php?action=wbsetsitelink&id=Q999999998&linksite=enwiki&linktitle=Hydrogen [باز کردن در صفحهٔ تمرین]
Add a sitelink to the English page "Hydrogen" to the item with ID Q999999998, if the sitelink does not exist. Also appends "Loves Oxygen" to the edit summary.
api.php?action=wbsetsitelink&id=Q999999998&linksite=enwiki&linktitle=Hydrogen&summary=Loves%20Oxygen [باز کردن در صفحهٔ تمرین]
Add a sitelink to the German page "Wasserstoff" to the item that is linked with the English page "Hydrogen", if the sitelink does not exist
api.php?action=wbsetsitelink&site=enwiki&title=Hydrogen&linksite=dewiki&linktitle=Wasserstoff [باز کردن در صفحهٔ تمرین]
حذف پیوند زبان آلمانی از آیتم
api.php?action=wbsetsitelink&site=enwiki&title=Hydrogen&linksite=dewiki [باز کردن در صفحهٔ تمرین]
Add a sitelink to the Polish page "Wodór" to the item that is linked with the English page "Hydrogen", with one badge pointing to the item with ID "Q149"
api.php?action=wbsetsitelink&site=enwiki&title=Hydrogen&linksite=plwiki&linktitle=Wodór&badges=Q149 [باز کردن در صفحهٔ تمرین]
نشان‌های (badges) صفحه لهستانی را از آیتم Q42 به دو نشان افزایش خواهد داد و بدون هیچ عنوان پیوندی به آیتم‌های «Q2» و «Q149» اشاره خواهد کرد
api.php?action=wbsetsitelink&id=Q999999998&linksite=plwiki&badges=Q2|Q149 [باز کردن در صفحهٔ تمرین]
پیوند به صفحه لهستانی را از آیتم Q42 به آیتم دیگری تغییر خواهد داد بدون اینکه در نشان‌ها (badges) تغییری ایجاد کند
api.php?action=wbsetsitelink&id=Q999999998&linksite=plwiki&linktitle=Warszawa [باز کردن در صفحهٔ تمرین]
پیوند به صفحه لهستانی را از آیتم Q42 به آیتم دیگری تغییر خواهد داد ضمن اینکه همه نشان‌ها (badges) را تغییر می‌دهد
api.php?action=wbsetsitelink&id=Q999999998&linksite=plwiki&linktitle=Wodór&badges= [باز کردن در صفحهٔ تمرین]