I just can't find any documentation for 1.19 version on mediawiki. Which requests should I send to get token and login?
I just can't find any documentation for 1.19 version on mediawiki. Which requests should I send to get token and login?
On Fandom, send a POST request to https://services.fandom.com/auth/login with username and password and it should return an auth_token in both JSON response and the Set-Cookie header that needs to be set as a cookie with the same name under the fandom.com domain (assuming your wiki is on fandom.com).
Okay, I got it. Now I need to delete multiple pages. From what I see I need to get delete token from prop=info. Do I need to get specific token for every page I want to delete or I can do everything with one token?
You should be able to delete everything with one token, but that token may expire, so if the MediaWiki API returns a badtoken error you need to refresh your token.
Seems I'm doing something wring since I'm getting "delete token isn't allowed for user" response. Request I'm sending is ?action=query&prop=info&intoken=delete&titles=Main%20Page
I logged in, got no token error with json "token" and "cookieprefix" objects in it as well as 4 Set-Cookie headers(wikicities_session, wikia_beacon_id,wikia_session_id and geo).
I logged in again, this time I send 4 Set-Cookie headers as headers and token as parameter. I got login success json in response with "lgtoken", "cookieprefix=wikicities" and "sessionid" objects.
Sessionid in second response is the same I got from first response header so I'm already sending it in every request header. Lgtoken however is different from the token I got in first response. Do I need to do something with it as well?
"4 Set-Cookie headers"? Set-Cookie is a response header, you're not supposed to be sending those in your requests.
What information are you getting from ?action=query&meta=userinfo? Are you seeing your username there?
Are you making all these queries using the same cookie jar in your HTTP client (assuming your HTTP client supports cookie jars)?
Can you share the source code?
Wiki recognizes me as anon.
First request, gives no token error:
Second request, success:
Third, still thinks I'm anon:
Okay, apparently I didn't need to send back any text in cookies after the semicolon, now it works
What do you think?