Board Thread:Support Requests - Getting Technical/@comment-24551580-20160504212503

Hi.

I am trying to find out how to leave a comment on a thread using a POST request, but so far my attempts have been unsuccessful.

I've been using Chrome's Developer Tools to grab the request that is being sent when I leave a reply normally, and attempting to duplicate the process using Ruby. By doing this, I can close a thread, but trying to use the same technique to leave a comment rewards me with the statement:

"There seems to be a problem with your login session;\nthis action has been canceled as a precaution against session hijacking.\nGo back to the previous page, reload that page and then try again."

The parameters of the query appear to be as follows:
 * controller: WallExternal
 * method: replyToMessage
 * body: message being send
 * parent: threadname (eg 2991)
 * pagetitle: as above
 * pagenamespace: 1201
 * token: .......

As far as I know, an edit token is required to complete this, and using mw.user.tokens.get('editToken') and comparing it to the value submitted in the test, they appear to be identical.

Unfortunately, using api.php to get an edit token and then passing that to the query gives me the error mentioned earlier, and I can't for the life of me work out why.

I'm fairly sure that I am successfully logged in, as the Mediawiki documentation says that anonymous users will get an edit token of "+\", which is definitely not what I am getting.

If I've left out any important details please say. Any help or pointers in the right direction would be most gratefully received. 