As a tool developer I want to get data of descriptions of properties so I can show them in my tool.
GET /entities/properties/{property_id}/descriptions/{language_code}
Notes
- Request and response structures to follow what the item-related counterpart does, see https://doc.wikimedia.org/Wikibase/master/js/rest-api/#descriptions/get_entities__items___item_id__descriptions__lang_
- Handle HTTP conditional request headers as in GET /entities/items/{item_id}/descriptions/{language_code}
- Handle user authentication/authorization like in GET /entities/items/{item_id}/descriptions/{language_code}
Error cases to consider
HTTP response code | response payload | |
---|---|---|
Property does not exist | 404 | "code": "property-not-found" "message": "Could not find a property with the ID: {property_id}" |
Invalid property ID | 400 | "code": "invalid-property-id" "message": "Not a valid property ID: {property_id}" "context": {"property": "{property-id}"} |
Invalid language code | 400 | { "code": "invalid-language-code", "message": "Not a valid language code: {language_code}"} |
Property does not have descriptions in the give language | 404 | { "code": "description-not-defined", "message": "Property with the ID {property_id} does not have description in the language: {language_code}" } |
Possibly relevant pointers:
- Suggestion in 2020 Wikibase REST API proposal: https://wmde.github.io/wikibase-rest-api-proposal/#/descriptions/get_entities__entity_type___entity_id__descriptions__lang_
- How Wikibase Action API handles this: https://www.wikidata.org/w/api.php?action=help&modules=wbsearchentities