-
Notifications
You must be signed in to change notification settings - Fork 7
Trouble while making authenticated cross wiki calls #21
Comments
@dbrant @sharvaniharan It would be great if someone could help us with this. :) Authenticated cross-wiki calls are the only thing that we haven't been to figure out on our own. It would be great if someone could take a look and help us finish the network overhaul. This is the branch that has all the changes: |
This is what I have been trying to use:
|
Hey @dbrant I was working on Uploading captions and I also faced similar issue
Can you please look into the issue :-) |
Both of those error messages seem straightforward: the first complains about the |
The
So I’m not sure where the error from the Wikibase API is coming from. |
Hm, yeah, that's strange. |
This does not seem to be your primary issue (based on error post params seem not recognized at all), but it also looks like you are using a commons csrf token at wikidata. I think you need to fetch the csrf token from wikidata that you use at wikidata |
The user who filed https://phabricator.wikimedia.org/T109175 experienced similar problems. Unfortunately he didn't record the fixes for posterity, but as best I can tell, the issues were around headers and/or cookie handling. |
Didn't see this until after posting. This sounds highly likely. |
Thank you, everyone, for your inputs. :) Based on the discussion I fixed the CSRF token and am now getting the CSRF token from Wikidata itself. This is the new flow:
I am still getting the same error as before.
I double-checked and all the params are set.
@lucaswerkmeister Yes, i think none of the parameters are being recognized by the API. Moreover, none of the sandbox examples work for me either. For eg. https://www.wikidata.org/wiki/Special:ApiSandbox#action=wbcreateclaim&entity=Q42&property=P9001&snaktype=novalue doesn't work for me. I get the following error.
It looks like the parameters are not being accepted by the API correctly. |
Here are the changes that I have tried. commons-app/apps-android-commons#3199 |
This is fixed now. Thanks, everyone for your inputs. :) |
All of the authenticated calls(ie login, upload, nomination for deletion, thank, notifications etc) made to commons wiki is working perfectly. I am stuck with a cross-wiki call to Wikidata. I am trying to call
Service:wbcreateclaim
to create a claim on Wikidata but the call is failing. I have attached the relevant logs below.@dbrant It would be great if you could take a look at the logs and suggest what might be wrong. Is it because of some issue with cookies because as far as I see, as expected I am sending the params in POST request body with
application/x-www-form-urlencoded
?The text was updated successfully, but these errors were encountered: