As a tool developer I want to remove statements from an item so that my tool can remove incorrect data
As a gadget developer I want to remove statements from an item so that my tool can remove duplicated statements
DELETE /entities/items/{item_id}/statements/{statement_id}
DELETE /statements/{statement_id}
Responses:
- On the successful removal, API should respond with 200 and "Statement deleted" as a response body.
- 200 response should also contain Content-Language header with "en" as a value
- If the statement with the request ID does not exist, API would respond with 404.
- If the item requested (via item_id or identifiable in statement_id) has been merged and redirected into other item, it is also considered the situation that the statement does not exist, and the API would respond with 404.
Authenticating user and checking their permission to make a change (including on a protected item) are out of scope of this story, and will be addressed separately.
All editing REST API endpoints are meant to include a consistent "metadata" optional parameters
- mediawiki "metadata" can be specified:
- "comment" to be included in the edit summary
- mediawiki tag(s) for the edit
- flag edit as made by a bot
- to help Wikibase solve potential edit conflict ("lost update problem"), the latest revision of an item known by a client when making the request can also be provided using If-Match HTTP header. In case the ETag provided is not the most recent version if the item, the API would response in 412 Precondition Failed response code.
- As a timestamp-based counterpart, also used If-Unmodified-Since header with a respective logic.
- 412 respond should not include any extra text in response body. The response should also not include ETag and Last-Modified header
For a possible inspiration could also see: https://wmde.github.io/wikibase-rest-api-proposal/#/statements/delete_statements__statement_id_ (non binding reference)