API:FAQ/hi

अवलोकन
इस पृष्ठ पर मीडियाविकि प्रतिक्रिया API के बारे में कुछ अक्सर पूछे जाने वाले प्रश्नों के उत्तर मौजूद हैं। This page is intended for technical contributors and software developers who wish to understand and use the MediaWiki Action API.

भी पढ़ें। यह कुछ अनुत्तरित सवालों के जवाब और दूसरे उपयोगी पृष्ठों की ओर इशारा करता है।



API-ओं के बारे में


एक API क्या है?
API ऐप्लिकेशन प्रोग्रामिंग इंटरफ़ेस का एक संक्षिप्त रूप है। इससे अलग-अलग ऐप्लिकेशन्स एक-दूसरे से संपर्क कर सकते हैं। Sometimes an API allows an application to request an action to be done by the application which implements the API. मीडियाविकि के शब्दों में, यह वेब-आधारित API-ओं को दर्शाता है, जो HTTP अनुरोध-उत्तर तंत्र का इस्तेमाल करके JSON/XML संरचित डेटा का निर्माण करते हैं।



एक REST API क्या है?
REST, REpresentational State Transfer का एक संक्षिप्त रूप है। एक RESTful प्रणाली को कुछ सिद्धांतों और बाधाओं के एक समूह द्वारा परिभाषित किया जाता है।



एक API क्या कर सकता है?
API के कुछ उपयोग देखें।



मैं API-ओं के बारे में और जानकारी कहाँ मिलेगी?
ये रहे कुछ संसाधन:


 * API समझना
 * API का परिचय
 * REST क्या है - नए लोगों के लिए एक साधारण व्याख्या, भाग 1: परिचय

साधारण


मीडियाविकि प्रतिक्रिया API क्या है?
मीडियाविकि प्रतिक्रिया API एक RESTful वेब सेवा है जिससे सदस्य पृष्ठ निर्माण, प्रमाणीकरण, पार्सिंग, खोज, आदि जैसे विकि-कार्य कर सकते हैं।



मीडियाविकि प्रतिक्रिया API का इस्तेमाल कैसे किया जा सकता है?
The MediaWiki Action API can be used to:


 * access wiki features.
 * interact with a wiki.
 * obtain meta-information about wikis and public users.

The right sidebar points to many features supported by the API. Also, see some Wikimedia projects that use the MediaWiki Action API.

How can I use (or call) the MediaWiki Action API?
HTTP requests are usually used to call the Action API. For detailed instructions, read the tutorial.

प्रतिक्रिया API के साथ खिलवाड़ के लिए:


 * Special:ApiSandbox का इस्तेमाल करें।
 * Enable your browser's developer console and watch net requests to  as you interact with the wiki.

What is a module, a submodule, and a parameter?
The MediaWiki Action API has numerous modules that we use to perform different tasks. In technical terms, a module is a subclass of ApiBase. A module requires parameters. These parameters may (or may not) be submodules.

Consider the following request:

here:


 * is a parameter of the main module.
 * is another module. It is called the query module.
 * is a parameter of the query module.
 * is also a module. It can be called a submodule of.
 * is a parameter of the search module. It holds the search string 'abc'.
 * is a parameter of the main module.
 * is the output format.

Also, see Introduction and guidelines. It describes the submodules of the  module.

How do I know which module and submodule to call?
मीडियाविकि प्रतिक्रिया API काफ़ी बड़ी है, और एक्सटेंशन्स इसे और भी विस्तृत करते हैं। Here are a few ways to work out your API request:


 * In the sidebar, look for the feature you wish to implement and follow the link for information about which modules to call.
 * The self-documenting API pages contain a list of all modules and submodules with brief descriptions. You can start at the main module and follow the links to different submodules. (Append  to view the expanded version)

Where can I find sample codes for using the API modules?
The API documentation pages contain an 'Examples' section to demonstrate how different modules and submodules can be used. The auto-generated docs also have examples trailing the module descriptions.

See Mediawiki-API-demos for code snippets in Python and JavaScript.

How can I control the output format?
The default output format is JSON. Other output formats have been deprecated or removed in the latest stable MediaWiki version, and their use is discouraged.

In older versions, to control the output format, you can pass  in the query string.

For information, see API:Data formats.

Do I need an access token?
You will require an access token to perform data modifying actions like logging in, editing, moving pages, etc.

To learn more, refer to API:Tokens or the sidebar category 'Authentication'.

How can I make cross-site requests using the API?
You must use JSONP or CORS to make cross-site requests in MediaWiki.

For details, see API:Cross-site requests.

Is there a limit to query results?
Yes, it depends on the query parameter. For example, the results for  and   queries cannot exceed 500 for regular users. The API pages contain information about these limits in the 'Additional notes' section or the 'Limits' section. Note that some modules impose stricter limits under certain conditions.

If you are unsure about what limit to set and just want as many results as possible, set the limit to.

Is there a limit to API calls?
There is no concrete limit. Yet, we recommend making a reasonable number of calls to prevent getting blocked. If you want to make many requests, contact the administrators beforehand.

Also, see API:Etiquette.

Where can I get updates about the MediaWiki Action API?
You can subscribe to the MediaWiki-API-Announce mailing list for announcements and updates.

What are wiki dumps and how can I work with them?
Wikimedia’s data dumps are dumps of wiki collections, content, metadata, search indices, etc. To work with dumps, see using dumps and public dumps.

Where can I get more help?
If you can't find answers in the MediaWiki API documentation or the auto-generated documentation pages, feel free to reach out in the following ways.


 * एक विकिमीडिया खाता बनाएँ (अगर आपके पास पहले से खाता नहीं है) और API चर्चा पृष्ठ पर एक नया विषय जोड़ें।
 * Ask your question on:
 * IRC in the channel.
 * MediaWiki-API mailing list.

How can I create an API module in an extension?
API:Extensions will walk you through the complete process of creating an API module in an extension.

What is the internal structure of the API?
API:Implementation Strategy explains the implementation of the API machinery in MediaWiki Core.

How can I restrict the API usage?
To restrict the API usage, you can either restrict the use of write API or disable individual modules.

For instructions and examples, see API:Restricting API usage.

How can I allow/restrict users from modifying the wiki content using the API?
Users are allowed to modify the wiki content by default. To restrict, you have to set  in.

For more information, see API:Changing wiki content.

How do I detect an error?
If you encounter an error, the error response from the API will set the  HTTP header and return an error structure.

What does this error mean?
Find your error in the list of standard error messages to understand what the error means.

How do I file a bug/feature requests?
You can report bugs and file feature requests on Wikimedia's task tracking tool, Phabricator.

Note:


 * Add the MediaWiki-API project tag to your task.
 * If your report/request is offered by an extension, add that extension's project. (e.g. MediaWiki-extensions-AbuseFilter,  MediaWiki-extensions-FlaggedRevs, etc.)
 * Verify for duplicates before creating a new task.
 * Understand the task creation terms on Phabricator before proceeding.

See How to report a bug for more details.

Am I facing errors due to my API version?
If a website runs a different version of MediaWiki, it would also run a different version of the API. Some module parameters supported in one version might be deprecated (or removed) in others. Such parameters will throw an exception if used. The API pages document any such deprecations.

See the release notes for information regarding different API versions.