API talk:User group membership
Getting a token doesn't work. There is no (more) value named "users" for "list" as written in the displayed error help screen.
Empty added/removed fields with correct rights
editHello everyone,
I'm having hard times to make the API work, especially with the userrights action : No matter the account, the API response will always have the added/removed fields empty.
All my tokens & logins calls are fine and have correct answers from the api, but the userrights seems a bit capricious...
From an account that belongs to both bureaucrats and bots groups (let's call it user_dev), I created a bot named user_dev@bot.
I then gave my user user_dev@bot all the rights I could, and allowed him on every IP address as specified in the help box below :
0.0.0.0/0
::/0
Now, when I use this bot account to change any user's group (To add or to remove from groups), the fields added/removed from the api response are always empty...
I tried from postman and python but it didn't change anything...
It says in the wiki's additional notes
- If you do not possess the ability to grant or remove rights to the target user, the API will not throw an error; instead, the
add
andremove
fields in the response will simply contain empty arrays.
But it looks like I have all the rights to make these changes...
Could someone help me with this ? I would greatly appreciate
Thank you !
Maxence 163.62.112.95 15:48, 31 January 2024 (UTC)
- Have you tried changing rights from the wiki directly at Special:UserRights? Maybe not actually changing, but checking if it allows you to mark the checks to add the groups you want to change. Ciencia Al Poder (talk) 16:08, 31 January 2024 (UTC)
- I have tried that and it does allow me to check/uncheck all the checkboxes ! I can do everything from the UI but the API won't let me...
- Maxence 163.62.112.95 16:20, 31 January 2024 (UTC)
- Another thing to check is to be sure you're actually logged in when performing the action. For example, action=query&meta=userinfo gives information about your current user. If it doesn't display your account information, this means you're not logged in. This may happen if you forget to log-in and/or store the cookies received during login and send them on next requests. Ciencia Al Poder (talk) 22:06, 31 January 2024 (UTC)
- Thanks for the tip, however, I'm logged in, action=query&meta=userinfo gives me the right information about the user account I'm using... So there must be something else... I just don't know what... 163.62.112.125 07:23, 1 February 2024 (UTC)
- I'm out of ideas too. Sorry. If it doesn't work, it may be worth a bugreport providing all the details. Ciencia Al Poder (talk) 22:23, 1 February 2024 (UTC)
- Thanks for the tip, however, I'm logged in, action=query&meta=userinfo gives me the right information about the user account I'm using... So there must be something else... I just don't know what... 163.62.112.125 07:23, 1 February 2024 (UTC)
- Another thing to check is to be sure you're actually logged in when performing the action. For example, action=query&meta=userinfo gives information about your current user. If it doesn't display your account information, this means you're not logged in. This may happen if you forget to log-in and/or store the cookies received during login and send them on next requests. Ciencia Al Poder (talk) 22:06, 31 January 2024 (UTC)