MediaWiki API help

This is an auto-generated MediaWiki API documentation page.

Documentation and examples: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page

action=block

(main | block)
  • This module requires read rights.
  • This module requires write rights.
  • This module only accepts POST requests.
  • Source: MediaWiki
  • License: GPL-2.0-or-later

บล็อกผู้ใช้

Parameters:
user

ผู้ใช้ที่จะบล็อก

Type: user, by any of ชื่อผู้ใช้, ไอพี, ช่วงไอพี และ ไอดีผู้ใช้ (เช่น "#12345")
userid
Deprecated.

ไอดีผู้ใช้ที่ต้องการบล็อก ไม่สามารถใช้ร่วมกับ user ได้

Type: integer
expiry

เวลาหมดอายุ อาจเป็นค่าสัมพัทธ์ (เช่น 5 months หรือ 2 weeks) หรือค่าสัมบูรณ์ (เช่น 2014-09-18T12:34:56Z) ถ้ากำหนดเป็น infinite, indefinite หรือ never การบล็อกจะไม่มีเวลาหมดอายุ

Default: never
reason

เหตุผลสำหรับการบล็อก

Default: (empty)
anononly

บล็อกเฉพาะผู้ใช้นิรนามเท่านั้น (เช่น ปิดใช้การแก้ไขนิรนามสำหรับที่อยู่ไอพีนี้)

Type: boolean (details)
nocreate

ป้องกันการสร้างบัญชี

Type: boolean (details)
autoblock

บล็อกที่อยู่ไอพีที่ใช้ล่าสุด และที่อยู่ไอพีที่ใช้ลองเข้าสู่ระบบหลังจากนี้โดยอัตโนมัติ

Type: boolean (details)
noemail

ป้องกันผู้ใช้จากการส่งอีเมลผ่านวิกิ (ต้องการสิทธิ blockemail)

Type: boolean (details)
hidename

ซ่อนชื่อผู้ใช้จากปูมการบล็อก (ต้องการสิทธิ hideuser)

Type: boolean (details)
allowusertalk

อนุญาตให้ผู้ใช้แก้ไขหน้าพูดคุยของตนเอง (ขึ้นอยู่กับ $wgBlockAllowsUTEdit)

Type: boolean (details)
reblock

ถ้าผู้ใช้ถูกบล็อกแล้ว ให้เขียนทับการบล็อกที่มีอยู่

Type: boolean (details)
watchuser

เฝ้าดูหน้าผู้ใช้และหน้าพูดคุยของผู้ใช้หรือที่อยู่ไอพี

Type: boolean (details)
tags

Change tags to apply to the entry in the block log.

Values (separate with | or alternative):
partial

Block user from specific pages or namespaces rather than the entire site.

Type: boolean (details)
pagerestrictions

List of titles to block the user from editing. Only applies when partial is set to true.

Separate values with | or alternative.
Maximum number of values is 10.
namespacerestrictions

List of namespace IDs to block the user from editing. Only applies when partial is set to true.

Values (separate with | or alternative): 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 828, 829, 2300, 2301, 2302, 2303
To specify all values, use *.
token

A "csrf" token retrieved from action=query&meta=tokens

This parameter is required.
Examples:
Block IP address 192.0.2.5 for three days with a reason.
api.php?action=block&user=192.0.2.5&expiry=3%20days&reason=First%20strike&token=123ABC [open in sandbox]
บล็อกผู้ใช้ Vandal อย่างไม่มีกำหนดพร้อมระบุเหตุผล และป้องกันการสร้างบัญชีใหม่และการส่งอีเมล
api.php?action=block&user=Vandal&expiry=never&reason=Vandalism&nocreate=&autoblock=&noemail=&token=123ABC [open in sandbox]