Difference between revisions of "API"

From Freephile Wiki
Jump to navigation Jump to search
Line 14: Line 14:
 
== MediaWiki API ==
 
== MediaWiki API ==
 
An example of the MediaWiki API in use is at the "[https://freephile.org/wikireport/index.php Wiki Report]" project.  Another very interesting example is the [https://wikiapiary.com/wiki/Freephile_Wiki Wiki Apiary] (clever name!)
 
An example of the MediaWiki API in use is at the "[https://freephile.org/wikireport/index.php Wiki Report]" project.  Another very interesting example is the [https://wikiapiary.com/wiki/Freephile_Wiki Wiki Apiary] (clever name!)
 +
 +
===Example Questions ===
 +
Here are some example requests to the API
 +
# https://freephile.org/w/api.php?action=query&meta=siteinfo&siprop=extensions With no 'format' argument, you will get a "pretty" HTML output that you can read in your browser.
 +
# https://freephile.org/w/api.php?action=query&meta=siteinfo&siprop=extensions&format=json With *json* explicitly requested as the format, you can get values suitable for actual programming.
  
 
== Developer Tools ==
 
== Developer Tools ==

Revision as of 07:10, 21 August 2017

Commentary and examples of using the APIs (Application Programming Interface) for software like CiviCRM, MediaWiki, Drupal and web services. Both API documentation and API tools. OS and Internet API references.

Application Programming Interface (API) is the information about the exposed or 'public' variables, methods and objects or classes that a system makes available to the developer who wishes to interface with the system programmatically. If you make an API, documenting the API is a critical software development function. In documentation terms, the API must almost be treated like a separate piece of software within or "attached" to the main program.

Programming APIs[edit | edit source]

SWIG wp:Swig (Executive Summary) helps application developers create an API. Several open source projects leverage SWIG, such as Subversion, wxPython and wxWindows. In turn, other developers can enhance these generic APIs to customize them for a particular programming language. For example Python developers can use pySVN while work is underway to expand the PHP interface. See more in the Subversion manual http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.developer.usingapi

Resources[edit | edit source]

  • http://gotapi.com publishes several API references for everything from HTML and CSS to DocBook and Drupal. This organized list of API references also features fast, as-you-type search.
  • Some other documentation resources:

MediaWiki API[edit | edit source]

An example of the MediaWiki API in use is at the "Wiki Report" project. Another very interesting example is the Wiki Apiary (clever name!)

Example Questions[edit | edit source]

Here are some example requests to the API

  1. https://freephile.org/w/api.php?action=query&meta=siteinfo&siprop=extensions With no 'format' argument, you will get a "pretty" HTML output that you can read in your browser.
  2. https://freephile.org/w/api.php?action=query&meta=siteinfo&siprop=extensions&format=json With *json* explicitly requested as the format, you can get values suitable for actual programming.

Developer Tools[edit | edit source]

Among other tools, you're going to need to look at HTTP requests and responses to develop web services using APIs. So, check out tools like Wireshark (https://www.wireshark.org/), the Network Monitor[1] in Developer Tools for Firefox, or Chrome Developer Tools

Integrators[edit | edit source]

Companies like IFTTT (If This Then That) and Zapier offer API integrations so that you can tie together applications via their APIs without any coding.

References[edit source]

  1. The "Live HTTP Headers" add-on still exists, but that is no longer neccessary given the development of the core features of the in-browser developer tools