API:সাহায্য
Appearance
From mediawiki.org
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
This page is a translated version of the page API:Help and the translation is 79% complete.
Outdated translations are marked like this.
Languages:
এই পাতাটি মিডিয়াউইকি action API নথির অংশ।
| MediaWiki Action API |
|---|
| Basics |
| Authentication |
| Accounts and Users |
| Page Operations |
|
| অনুসন্ধান |
| Developer Utilities |
| Tutorials |
| দে · আ · স |
মিডিয়াউইকি সংস্করণ:
≥ 1.8
GET request to display help for the specified modules.
API documentation
নিম্নলিখিত ডকুমেন্টেশনটি Special: ApiHelp/ help এর আউটপুট, এই সাইটে (MediaWiki.org) চলমান মিডিয়াউইকির প্রাক-প্রকাশ সংস্করণ দ্বারা স্বয়ংক্রিয়ভাবে উত্পন্ন হয়।
action=help
(main | help)
- Source: MediaWiki
- License: GPL-2.0-or-later
Display help for the specified modules.
Specific parameters:
Other general parameters are available.
- modules
Modules to display help for (values of the action and format parameters, or main). Can specify submodules with a +.
- Separate values with | or alternative.
- Maximum number of values is 50 (500 for clients that are allowed higher limits).
- Default: main
- submodules
Include help for submodules of the named module.
- Type: boolean (details)
- recursivesubmodules
Include help for submodules recursively.
- Type: boolean (details)
- wrap
Wrap the output in a standard API response structure.
- Type: boolean (details)
- toc
Include a table of contents in the HTML output.
- Type: boolean (details)
Examples:
- Help for the main module.
- api.php?action=help [open in sandbox]
- Help for action=query and all its submodules.
- api.php?action=help&modules=query&submodules=1 [open in sandbox]
- All help in one page.
- api.php?action=help&recursivesubmodules=1 [open in sandbox]
- Help for the help module itself.
- api.php?action=help&modules=help [open in sandbox]
- Help for two query submodules.
- api.php?action=help&modules=query+info|query+categorymembers [open in sandbox]
উদাহরণ
GET request
একটি নির্দিষ্ট মডিউল জন্য সাহায্য পান।
প্রতিক্রিয়া
{ "help":{ "mime":"text/html", "filename":"api-help.html", "help":"<!DOCTYPE html>\n<html class=\"client-nojs\" lang=\"en\" dir=\"ltr\">\n<head>\n<meta charset=\"UTF-8\"/>\n<title>MediaWiki API help - Wikipedia</title>\n<script>document.documentElement.className=\"client-js\";RLCONF={\"wgBreakFrames\":!0,\"wgSeparatorTransformTable\":[\"\",\"\"],\"wgDigitTransformTable\":[\"\",\"\"],\"wgDefaultDateFormat\":\"dmy\",\"wgMonthNames\": ... } }
নমুনা কোড
Python
#!/usr/bin/python3 """ get_help.py MediaWiki API Demos Demo of `Help` module: Get help for a specified module. MIT License """ importrequests S = requests.Session() URL = "https://en.wikipedia.org/w/api.php" PARAMS = { "action": "help", "modules": "query+tokens", "wrap": "", "format": "json" } R = S.get(url=URL, params=PARAMS) DATA = R.json() print(DATA)
PHP
<?php /* get_help.php MediaWiki API Demos Demo of `Help` module: Get help for a specified module. MIT License */ $endPoint = "https://en.wikipedia.org/w/api.php"; $params = [ "action" => "help", "modules" => "query+tokens", "wrap" => "", "format" => "json" ]; $url = $endPoint . "?" . http_build_query( $params ); $ch = curl_init( $url ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); $output = curl_exec( $ch ); curl_close( $ch ); $result = json_decode( $output, true ); var_dump( $result );
JavaScript
/* get_help.js MediaWiki API Demos Demo of `Help` module: Get help for a specified module. MIT License */ varurl="https://en.wikipedia.org/w/api.php"; varparams={ action:"help", modules:"query+tokens", wrap:"", format:"json" }; url=url+"?origin=*"; Object.keys(params).forEach(function(key){url+="&"+key+"="+params[key];}); fetch(url) .then(function(response){returnresponse.json();}) .then(function(response){console.log(response);}) .catch(function(error){console.log(error);});
MediaWiki JS
/* get_help.js MediaWiki API Demos Demo of `Help` module: Get help for a specified module. MIT License */ varparams={ action:'help', modules:'query+tokens', wrap:'', format:'json' }, api=newmw.Api(); api.get(params).done(function(data){ console.log(data); });
সম্ভাব্য ত্রুটি
| কোড | তথ্য |
|---|---|
| badmodule | The module name does not have a submodule "name2". |
পরামিতি ইতিহাস
- v1.25:
submodules,recursivesubmodules,wrap,tocচালু করা হয়েছে - v1.25:
querymodulesসরানো হয়েছে - v1.21: অবচয়
querymodules - v1.17:
action,format,mainচালু করা হয়েছে
আরও দেখুন
- API:Main_page - মিডিয়াউইকি Action API-এর একটি ওভারভিউ প্রদান করে।
- API:FAQ - মিডিয়াউইকি Action API সম্পর্কে প্রায়শই জিজ্ঞাসিত কিছু প্রশ্নের উত্তর প্রদান করে।