MediaWiki API ヘルプ

このページは自動生成された MediaWiki API の説明文書ページです。

説明文書と例: 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.

値 (次の値のいずれか1つ): item、property
site

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

値 (次の値のいずれか1つ):
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

Summary for the edit. Will be prepended by an automatically generated comment. The length limit of the autocomment together with the summary is 260 characters. Be aware that everything above that limit will be cut off.

tags

Change tags to apply to the revision.

値 (| または別の文字列で区切る):
token

action=query&meta=tokens から取得した「csrf」トークン

この変数は必須です。
bot

Mark this edit as bot. This URL flag will only be respected if the user belongs to the group "bot".

型: 真偽値 (詳細)
linksite

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

この変数は必須です。
値 (次の値のいずれか1つ):
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 [サンドボックスで開く]
Remove the German sitelink from the item
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 [サンドボックスで開く]
Change badges for the link to the Polish page from the item with ID Q999999998 to two badges pointing to the items with IDs "Q2" and "Q149" without providing the link title
api.php?action=wbsetsitelink&id=Q999999998&linksite=plwiki&badges=Q2|Q149 [サンドボックスで開く]
Change the link to the Polish page from the item with ID Q999999998 without changing badges
api.php?action=wbsetsitelink&id=Q999999998&linksite=plwiki&linktitle=Warszawa [サンドボックスで開く]
Change the link to the Polish page from the item with ID Q999999998 and remove all of its badges
api.php?action=wbsetsitelink&id=Q999999998&linksite=plwiki&linktitle=Wodór&badges= [サンドボックスで開く]