Jump to content
MediaWiki

API:সাহায্য

From mediawiki.org
This page is a translated version of the page API:Help and the translation is 79% complete.
Outdated translations are marked like this.
এই পাতাটি মিডিয়াউইকি 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)

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)


উদাহরণ

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
"""
import requests
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:প্রধান পৃষ্ঠা - মিডিয়াউইকি Action API-এর একটি ওভারভিউ প্রদান করে।
  • API:FAQ - মিডিয়াউইকি Action API সম্পর্কে প্রায়শই জিজ্ঞাসিত কিছু প্রশ্নের উত্তর প্রদান করে।

AltStyle によって変換されたページ (->オリジナル) /