Zorglub27 created this task.
Zorglub27 added a subscriber: Zorglub27.
Zorglub27 added a project: Wikidata.
Herald added a subscriber: Aklapper.

TASK DESCRIPTION
  hi,
  
  I try to use the wbcreateclaim API module but can't figure out how to pass 
the csrf token correctly:
  
  - when I set it in the query string, I get this error
  
  ```
  { servedby: 'mw1129',
    error:
     { code: 'mustposttoken',
       info: 'The \'token\' parameter was found in the query string, but must 
be in the POST body',
       '*': 'See https://www.wikidata.org/w/api.php for API usage' } }
  ```
  
  from what I could see, this is the normal behavior of the MediaWiki API, cf 
https://phabricator.wikimedia.org/T72656
  
  - when I pass it in the POST body, either as plain text or json, I get :
  
  ```
  { servedby: 'mw1128',
    error:
     { code: 'notoken',
       info: 'The token parameter must be set',
       '*': 'See https://www.wikidata.org/w/api.php for API usage' }
  ```
  
  - when I pass it both in the query string and the body, I get the first error 
again.
  
  And now I'm confused. Any clue on what I might be doing wrong? Could the API 
module documentation include examples of how to pass the token?
  
  thanks in advance

TASK DETAIL
  https://phabricator.wikimedia.org/T109175

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Zorglub27
Cc: Zorglub27, Aklapper, Wikidata-bugs, aude, Malyacko



_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to