Wikibase/API

Moved to Extension:Wikibase/API3

Modules
There are some parameters that is always available...

Plural forms are used in those cases where a parameter can take several values.


 * id|ids : Identifies a specific item or items.
 * site|sites ∩ title|titles : Identifies a single item or multiple items. Both sites and titles can't have multiple values at the same time.
 * language : The language is used as a filter mechanism to filter labels and descriptions in get actions or to identify a specific language for set actions.
 * format : Should always be set to json (or jsonfm for debygging)

wbgetitemid
getItemId( site, title )
 * Example : http://localhost/repo/api.php?action=wbgetitemid&title=Wikimedia&site=nn&format=jsonfm

wblinksite
linkSite( ( id XOR ( site, title ) ), linksite, linktitle *badge, *summary)
 * Example : http://localhost/repo/api.php?action=wblinksite&site=nn&title=Wikimedia&linksite=no&linktitle=Mediawiki&format=jsonfm&link=set
 * Example : http://localhost/repo/api.php?action=wblinksite&id=42&linksite=no&linktitle=Mediawiki&format=jsonfm&link=set

Note that adding multiple links to a single external page will result in a database error.

wbsetlanguageattribute
setLanguageAttribute(id XOR (site, title), (label OR description), "update"|"add", *summary)
 * "update" throws an error if no value exists
 * "add" will throw an error if the value already exists
 * "set" always works
 * Example : http://localhost/repo/api.php?action=wbsetlanguageattribute&item=set&id=44&&label=Anything&language=en&format=jsonfm
 * Example : http://localhost/repo/api.php?action=wbsetlanguageattribute&item=set&id=44&&description=Anything%20goes&language=en&format=jsonfm

wbdeletelanguageattribute

 * Not implemented

deleteLanguageAttribute(id XOR (site, title), attribute, *summary)

wbgetsitelinks
getSiteLinks( ( id XOR ( site, title ) )
 * Example : http://localhost/repo/api.php?action=wbgetsitelinks&id=44&format=jsonfm
 * Example : http://localhost/repo/api.php?action=wbgetsitelinks&site=nn&title=Wikimedia&format=jsonfm

getitems
getItems( ( ids XOR ( sites, titles )) ), *language)
 * Example : http://localhost/repo/api.php?action=wbgetitems&ids=43&format=jsonfm
 * Example : http://localhost/repo/api.php?action=wbgetitems&sites=nn&titles=Wikimedia&format=jsonfm

Note that naming deviates slightly from the proposed one getItems( ( ListOfIds XOR ( ListOfSites, ListOfTitles )) ), *language)

setitem
getItems( data )
 * Example : http://localhost/repo/api.php?action=wbsetitem&data={}&format=jsonfm
 * Example : http://localhost/repo/api.php?action=wbgsetitemdata={}&format=jsonfm