< Extension:GlobalBlocking
Global blocking
Allows you to create a new block, remove a block, or modify one.
Parameters
target: Target IP address/rangeexpiry: How long block should last forunblock: If set, will unblock the address/rangereason: (un)block reasonanononly: If set, the block will only affect anonymous usersmodify: If set, the block will modify an existing blocktoken: Edit token
Example
Note: Request must be POSTed.
Blocking 127.0.0.1 indefinitely with the reason of "Cross wiki abuse"
api.php?action=globalblock&target=127.0.0.1&expiry=indefinite&reason=Cross%20wiki%20abuse&token=TOKEN [try in ApiSandbox]
| Result |
|---|
<?xml version="1.0"?>
<api>
<globalblock user="127.0.0.1" blocked="" expiry="infinite" />
</api>
|
List global blocks
View a list of currently blocked IP addresses/ranges.
Parameters
bgstart: The timestamp to start enumerating frombgend: The timestamp to stop enumerating atbgdir: The direction in which to enumerate (older, newer)bgids: Pipe-separated list of block IDs to list (optional)bgaddresses: Pipe-separated list of addresses to search for (optional)bgip: Get all blocks applying to this IP or CIDR range, including range blocks. (Cannot be used together with bkusers. IPv4 CIDR ranges broader than /16 are not accepted; however, IPv6 ranges can be of any size less than /4)bglimit: The maximum number of blocks to listbgprop: Which properties to get (id|address|by|timestamp|expiry|reason|range)
Errors codes
cidrtoobroad: CIDR ranges broader than /16 are not accepted.invalidtitle: Bad title 'title'.readapidenied: You need read permission to use this module.
Example
List all global blocks
| Result |
|---|
<api>
<query-continue>
<globalblocks bgstart="2009-10-03T12:10:59Z" />
</query-continue>
<query>
<globalblocks>
<block id="2301" address="82.49.115.227" />
<block id="2297" address="59.86.157.24" anononly="" />
<block id="2296" address="83.79.31.175" anononly="" />
<block id="2287" address="81.18.116.66" />
<block id="2286" address="141.223.237.76" />
<block id="2280" address="125.184.11.164" />
<block id="2279" address="124.197.47.74" />
<block id="2278" address="115.139.25.18" />
<block id="2277" address="111.92.160.26" />
<block id="2276" address="89.248.172.146" />
</globalblocks>
</query>
</api>
|
| The following documentation is the output of Special: |
Special:ApiHelp/globalblock
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.