====Background====
The [[ https://www.mediawiki.org/wiki/API:Main_page | MediaWiki action API ]] is a web service that allows access to some wiki-features like authentication, page operations, and search. It can provide meta information about the wiki and the logged-in user. Several Wikimedia projects make use of this API.
As of now, there are [[ https://www.mediawiki.org/wiki/Category:MediaWiki_action_API | ~128 pages ]] on the Action API on MediaWiki.org. #developer-advocacy did a little [[ https://www.mediawiki.org/wiki/User:SSethi_(WMF)/Sandbox/Research_on_the_state_of_the_docs_of_mw_action_api | research on the state of the docs ]] and documented a few problems and recommendations for the next steps. One of the issues we decided to address was inconsistency. For example, some pages had the automated API docs embedded; some didn’t, some pages had code samples, some didn’t, etc. As a first step, we designed a [[ https://www.mediawiki.org/wiki/API:Documentation_template | documentation template ]] and used it to re-write top 20 viewed pages of the API. But, we realized we could not improve 128 pages all by ourselves, and opened it to new Wikimedia contributors for help :-) Our Outreachy intern @Martyav put in a lot of good work in this and improved the next ~20 viewed pages and brought this project in good shape!
While in this process our team led a survey about the current technical documentation for action API to understand in which areas should we invest our energy more! What is working well, and what could be improved (link TBA). Fifty participants filled out the survey. One of the requests we received in the survey from contributors is to provide sample code in at least two or more programming languages, preferably PHP and Javascript. And, that is exactly what this project is about.
==== Project summary====
This project will be about developing sample code in two or more programming languages (e.g., Javascript and PHP) to demonstrate the use of MediaWiki Action API modules. Here is what this will entail:
* Design a tabbed window to be integrated with MediaWiki either (like on the right here https://www.twilio.com/docs/usage/api). This might be possible with a template or Gadget.
* Generate code samples for modules that received some documentation improvements in Phase 1 and Phase 2 https://phabricator.wikimedia.org/T198916
** Write an auto-generator that would help generate Javascript or Php code samples for some modules that support GET requests like in https://github.com/srish/MediaWiki-Action-API-Code-Samples/blob/master/python/autogenerator.py
** Write sample code to demonstrate the use of Action modules that can be used in combination of a GET + POST request and it may not be feasible to get them to work with an auto-generator.
* Document the code samples on-wiki
* (OPTIONAL) Develop one or two demo apps around the use of Action APIs
====Skills required====
Wiki editing, Templates, creating and managing translatable pages, [[ https://phabricator.wikimedia.org/ | Wikimedia Phabricator ]] tool, basic PHP and/or Javascript programming. Note: some or all of these skills would be nice to have but not required. Come with a desire to learn and that be all!
====Mentor(s)====
@Srishakatux @srodlund
==== Resources ====
* How to use or write Templates https://www.mediawiki.org/wiki/Help:Templates
* Page translation https://www.mediawiki.org/wiki/Help:Extension:Translate/Page_translation_example
* Editing wiki pages https://www.mediawiki.org/wiki/Help:Editing
* Learn how to use Phabricator https://www.mediawiki.org/wiki/Phabricator/Help
==== Microtasks====
* TBD