Page MenuHomePhabricator

Query: How to add tags while making Wikidata edits using Wikimedia Commons Android App
Closed, ResolvedPublic

Description

As part of #252 we are making P18 edits to the corresponding wikidata entity whenever an image is uploaded to commons. We want to maintain a log of all such edits made using the Wikimedia Commons Android App client.

I checked out Tags and was wondering how we could get a special tag that could be appended with every edit made using Commons app.

The recent changes list already tags the edits made by the commons app with Mobile app edit, Mobile edit, but these tags are apparently used by other clients as well. Is it possible to get another tag that just the Commons Android app uses?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 30 2018, 12:14 PM

Thanks @matej_suchanek. I will contact the administrators to create a tag for us.

Once the tag is created how can i add this tag while making wikidata edits. The mobile edits tags are being added automatically for us and the wbcreateclaims method of wikidata API doesn’t seem to have any parameter for adding tags.

Indeed, it does not (T155109). But you can make it in two steps: first create the claim and then add the tag via action=tag&revid={data.pageinfo.lastrevid} (with "data" being JSON of the response).

Thanks a lot @matej_suchanek! This is precious information for us. :)

@matej_suchanek I was trying to add this tag but I get the following exception:

{
    "error": {
        "code": "tags-apply-not-allowed-one",
        "info": "The tag \"'wikimedia-commons-app'\" is not allowed to be manually applied.",
        "*": "See https://www.wikidata.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
    },
    "servedby": "mw1221"
}

Does this API require any special permissions? The Android app would be making this call on behalf of the logged in user. What would be the best way to go ahead if this permission can't be provided to all users.

Per https://www.wikidata.org/wiki/Special:ListGroupRights#user, every logged in user should be able to apply a change tag. You have already managed to do so.

By the way, since change tags can be applied by any user, they can also become subject of vandalism. Rarely some users apply them manually to arbitrary revisions (but it isn't problem for anyone to revert it). So you may want to use reason= parameter to confirm it's a valid addition.

maskaravivek closed this task as Resolved.Jun 3 2018, 11:31 AM
maskaravivek claimed this task.

Thanks, @matej_suchanek I figured out my mistake. I was sending the tag inside a single quote mark so the API was throwing an error. It's working for me now. Thanks a lot for your help. :)

Vvjjkkii renamed this task from Query: How to add tags while making Wikidata edits using Wikimedia Commons Android App to zzbaaaaaaa.Jul 1 2018, 1:06 AM
Vvjjkkii reopened this task as Open.
Vvjjkkii triaged this task as High priority.
Vvjjkkii removed maskaravivek as the assignee of this task.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot assigned this task to maskaravivek.
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot closed this task as Resolved.
CommunityTechBot renamed this task from zzbaaaaaaa to Query: How to add tags while making Wikidata edits using Wikimedia Commons Android App.
CommunityTechBot added a subscriber: Aklapper.