NOTE: Task resolved in T228567: Send edit API options to server in contribution data
Docs: https://commons.wikimedia.org/w/api.php?action=help&modules=wbsetclaim
This API call is used for both creating and editing depicts statements - i.e. all contributions with:
edit_type: "depicts"
edit_action: "add" or "edit"
Post request to: https://test-commons.wikimedia.org/w/api.php
Parameters:
action | "wbsetclaim" |
claim | json statement data |
token | user edit token |
baserevid | current revision id of file |
Example format for "claim" property
1. Changing Prominent value for existing statement:
{
"type": "statement", "mainsnak": { "snaktype": "value", "property": "P180", "datavalue": { "type": "wikibase-entityid", "value": { "id": "Q1001329" } } }, "id": "M77105364$736c7c1e-4fb7-f74f-042e-4b4b5ecb61c3", "rank": "preferred"
}
2. Creating new statement:
Question: Do we generate the statement ID ourselves?
{
"type": "statement", "mainsnak": { "snaktype": "value", "property": "P180", "datavalue": { "type": "wikibase-entityid", "value": { "id": "Q726" } } }, "id": "M58847006$1358ce41-4c40-c3eb-142f-c3a745ed1c13", "rank": "normal"
}