Page MenuHomePhabricator

API does not return an edit token for nonexistent pages when logged in
Closed, ResolvedPublic

Description

Author: craig

Description:
The API does not return an edit token for nonexistent pages when logged in. This makes it impossible to get an edit token for the creation of new pages without resorting to screen scraping(such as for a bot). When logged out it returns +\.


Version: unspecified
Severity: trivial

Details

Reference
bz10898

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:51 PM
bzimport set Reference to bz10898.
bzimport added a subscriber: Unknown Object (MLST).
  • Bug 11017 has been marked as a duplicate of this bug. ***

Since edit tokens are the same for each page, but only differ per session (i.e. they only change between logins), you can just request an edit token for a page you know exists (try Main Page) as a temporary measure. I'll work on getting tokens to work for non-existent pages, but since the computer that stores my SVN stuff is temporarily unavailable, it may take some time.

Whoops, that has to be r25457. Sorry.

Bryan.TongMinh wrote:

Does still not work: http://commons.wikimedia.org/w/api.php?action=query&prop=info&intoken=edit&titles=Main%20Pageeeeee. Wikimedia appears to be running $Id: ApiQueryInfo.php 25457 2007-09-03 20:17:53Z catrope $.

It did work, but only if at least one existing title was specified. Fixed this in r25581 by adding a '&'.