Extension:FileApi

MediaWiki extensions manual
FileApi
Release status: unknown
Implementation API
Description Implements file downloads via the action api for consumption by any client, including api-only clients (e. g. via bot password or OAuth).
Author(s) (Simon Stiertalk)
Latest version 0.1.0
MediaWiki 1.39
Database changes No
License GNU Affero General Public License 3.0 or later
Download
Read Me

Implements file downloads via the action api for consumption by any client, including api-only clients (e. g. via bot password or OAuth).

Installation

edit
  • Download and place the file(s) in a directory called FileApi in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'FileApi' );
    
  •   Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Endpoints

edit

action=download

Params:

  • title: The title of the file page
  • pageid: The pageid of the file page
  • format: The result format if an error occurs (ApiBase error message)

Example

edit

https://my.wiki.com/w/api.php?action=download&format=json&title=File:SomeFile.png

See also

edit