Page MenuHomePhabricator

Add wbsetclaim API call for creating and editing depict statements
Closed, ResolvedPublic

Description

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"
claimjson statement data
tokenuser edit token
baserevidcurrent 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"

}

Event Timeline

NavinoEvans renamed this task from Add wbsetclaim API call for creating depict statements to Add wbsetclaim API call for creating and editing depict statements.Jul 9 2019, 2:30 PM
NavinoEvans updated the task description. (Show Details)
NavinoEvans updated the task description. (Show Details)
NavinoEvans updated the task description. (Show Details)