Topic on Project:Support desk

Andrea.bozzano87 (talkcontribs)

Hi everyone,

for my project, i'm developing some Bots for my Wiki to edit pages.

After i successfully logged in with my script, i need an Edit Token to edit or create pages. My question is: does this mean that I need to retrieve an edit token for each page the bot is gonna edit or do i need just one edit token per session?

I'm using MediaWiki 1.29.2 and developing bots in PHP 7.0.

Bawolff (talkcontribs)

Its probably fine to just use one per session.

If you end up with an error, just fetch a new one and try again.

Andrea.bozzano87 (talkcontribs)

Ok, i'll try to use just 1 edit token. Thank you for your answer :)

Taylor 49 (talkcontribs)

It does not seem to be documented anywhere how long a token is supposed to be valid. In my tests it usually survives many hours and 1000:s of edits.

Bawolff (talkcontribs)

Generally tokens should be tied to the life of the session. There's no particular guarantee how long the session will necessarily last for.

If you want to program defensively, you should have a case to get a new token at any time when you receive a token error.

Reply to "About Edit Tokens"