Page MenuHomePhabricator

API: wbgetitems should only return tokens when requested
Closed, ResolvedPublic

Description

http://wikidata-test-repo.wikimedia.de/w/api.php?action=wbgetitems&sites=dewiki&titles=Helium&prop=sitelinks

also returns descriptions, labels and a token altough this was not requested by the api query above.

The response would only be correct if i would send this request:

http://wikidata-test-repo.wikimedia.de/w/api.php?action=wbgetitems&sites=dewiki&titles=Helium&prop=sitelinks|aliaseslabels|descriptions&gettoken

This creates unneeded database load and tcp traffic.


Version: unspecified
Severity: normal
Whiteboard: storypoints: 3
URL: http://wikidata-test-repo.wikimedia.de/w/api.php?action=wbgetitems&sites=enwiki|dewiki&titles=Berlin|Helium&prop=sitelinks

Details

Reference
bz38521

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:51 AM
bzimport set Reference to bz38521.
bzimport added a subscriber: Unknown Object (MLST).

From the API documentation

props - The names of the properties to get back from each item.

Will be further filtered by any languages given.
Values (separate with '|'): sitelinks, aliases, labels, descriptions
Default: sitelinks|aliases|labels|descriptions

Note that there are defaults and that those will be delivered unless overridden. Always specify what information you want back, otherwise the items will be quite large. Especially use the language parameter to limit the number of entries for labels and descriptions if you can.

The amount of information will not generate additional database load as they are all read from the item itself, which is stored as a serialized object on the page.

The token should not be generated unless requested, that is an error.

It is better, if you not using gettoken, see bug 35993