API:User group membership/ja

トークン
A user rights token is required and can since MediaWiki 1.24 be obtained by action=query&meta=tokens&type=userrights.

For compatibility, the token used in the web UI is also accepted.

Previously, to change a user's group membership, the required token would depend on the name of the user whose rights were being changed. A user rights token could be obtained as follows:

グループへの利用者の追加や削除
action=userrights で利用者をグループに追加または除去できます. Under normal circumstances, no specific rights are required to do this, but the user must have changeable groups available to them (see API:Userinfo). Blocked users require the userrights right, given only to bureaucrats by default.

パラメーター
Only one of user or userid must be specified.
 * : 権限を変更される利用者の利用者名
 * : A "userrights" token retrieved from . 必ず '+' を '%2B' に urlencode するようにしてください.
 * : 変更理由 (省略可能)
 * : 変更理由 (省略可能)
 * : 変更理由 (省略可能)
 * : 変更理由 (省略可能)

リクエストの例
注記: In this example, all parameters are passed in a GET request just for the sake of simplicity. However, action=userrights requires POST requests; GET requests will cause an error.

注記: If you don't have permission to add/remove users to/from groups, you'll get a result with empty  and   tags rather than an error message, because all the groups you specified were silently ignored.

起こりうるエラー
All errors are formatted as: