راهنمای واسط برنامه‌نویسی کاربردی مدیاویکی

این یک صفحهٔ مستندات برای واسط برنامه‌نویسی کاربردی مدیاویکی است که به‌طور خودکار ایجاد شده‌است.

مستندات و نمونه‌ها: https://www.mediawiki.org/wiki/Special:MyLanguage/API:Main_page

action=voteny

(main | voteny)
  • این پودمان نیازمند اختیارات خواندن است.
  • این پودمان نیازمند اختیارات خواندن است.
  • این پودمان تنها درخواست‌های POST را می‌پذیرد.
  • منبع: VoteNY
  • مجوز: GPL-2.0-or-later

VoteNY API module

پارامترها:
Other general parameters are available.
what

Action to take; valid values are 'vote' (green voting box), 'multi' (voting stars) or 'delete' (delete a previously given vote)

این پارامتر الزامی است.
pageId

Page ID of the page where the voting box/stars is/are

این پارامتر الزامی است.
نوع: عدد صحیح
voteValue

Numerical vote value between 1 and 5

نوع: عدد صحیح
type

Set this to 'stars' to call the voting stars (VoteStars PHP class), otherwise the green vote box (Vote PHP class) is used

token

یک بلیط «csrf» واکشی‌شده از action=query&meta=tokens

این پارامتر الزامی است.
نمونه‌ها:
Cast a vote for the page which has the ID number 666
api.php?action=voteny&what=vote&pageId=666 [باز کردن در صفحهٔ تمرین]
Delete your vote from the page which has the ID number 666
api.php?action=voteny&what=delete&pageId=666 [باز کردن در صفحهٔ تمرین]
Cast a vote (3 stars out of 5) for the page which has the ID number 666
api.php?action=voteny&what=vote&type=stars&pageId=666&voteValue=3 [باز کردن در صفحهٔ تمرین]
Delete your vote from the page which has the ID number 666 which is using the star rating
api.php?action=voteny&what=delete&type=stars&pageId=666 [باز کردن در صفحهٔ تمرین]
Cast a vote (4 stars out of 5) for the page which has the ID number 666, deleting your previous vote, if any
api.php?action=voteny&what=multi&type=stars&pageId=666&voteValue=4 [باز کردن در صفحهٔ تمرین]