DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:repository:api

Plugin Repository API

An API allows to query the list of available DokuWiki extensions. It's available at http://www.dokuwiki.org/lib/plugins/pluginrepo/api.php

This API is used by the Extension Manager Plugin.

Commands

Using the cmd parameter defines what is returned by the API.

  • ping – just returns a single 1 to show the connection is working
  • query – default query action described below

Formats

Defines the output format and is specified by the fmt parameter. Can be:

  • debug – print_r for easy browsing
  • xml – XML, should not be used if can be avoided
  • yaml – YAML encoded data
  • php – PHP serialized data
  • json – JSON encoded data (default)
    • give a callback name as cb parameter and it's JSONP

example: api.php?fmt=json&cb=my_callback

Filters

All filters can be combined and will be ANDed together.

Extension Name

Provide one or multiple names in the ext[] parameter. Prefix with template: for templates.

Only full matches currently.

example: api.php?ext[]=wrap&ext[]=template:ach

The parameter q allows to specify a full text query (with query expansion). If no limit was given, the limit is set to 50. If no order was given the result is sorted by the result score.

The fulltext index uses the fields plugin, name, description, author and tag.

example: api.php?q=wrap

Type

To filter by the type use the type parameter, multiple types can be added together.

Supported:

  • 1 ⇒ 'Syntax',
  • 2 ⇒ 'Admin',
  • 4 ⇒ 'Action',
  • 8 ⇒ 'Render',
  • 16 ⇒ 'Helper',
  • 32 ⇒ 'Template',
  • 64 ⇒ 'Remote',
  • 128 ⇒ 'Auth'

example: api.php?type=5

Tags

Filter by one or multiple tags (OR) using the tag[] parameter.

Only full matches currently.

example: api.php?tag[]=media&tag[]=video

Email

We do not expose email addresses to avoid spamming. Instead the MD5 of the lowercased email address is used. You can use it to query by email address(es) using the mail parameter.

example: api.php?mail[]=4933823dc5f71300a20a506869fcf4d9

Ordering

You can influence the ordering of the results using the order parameter.

Supported fields:

  • lastupdate
  • popularity
  • plugin ('default')
  • all other non-derived DB fields

example: api.php?order=lastupdate

Limit

You can limit the number of results using the limit parameter.

example: api.php?limit=5

Old Repository API

/lib/plugins/pluginrepo/repository.php returns plugin/template data as XML. Same syntax as for sorting/filtering the repository table can be used as well as querying for an array of named plugins.

Still in use by e.g. Translate Tool

Available filters:

  • plugins – [array of string] returns only named plugins
  • plugintype – [integer] 1, 2, 4, 8, 16, 32=templates
  • plugintag – [string] filters result by plugins with matching tag. It is possible to filter by tag and type at the same time although the table syntax component normally doesn't use this feature.
  • pluginsort – [author/lastupdate/type/popularity/compatibility] result sorted by named field. Shortcuts also available (author=a).
  • showall – [yes] returns plugins regardless of security or obsolete status, normally skipped.
  • includetemplates – [yes] returns templates AND plugins, normally only plugins returned. Combine with plugintype=32 to return templates only.

Example call to get data about syntax plugins:

http://www.dokuwiki.org/lib/plugins/pluginrepo/repository.php?plugintype=1&plugintag=list

Example output:

<repository>
  <plugin>
    <id>captcha</id>
    <dokulink>plugin:captcha</dokulink>
    <popularity>5947</popularity>
    <name>CAPTCHA Plugin</name>
    <description>Use an image verification (CAPTCHA) to defeat spambots</description>
    <author>Andreas Gohr</author>
    <type>Action, Helper</type>
    <lastupdate>2016-01-24</lastupdate>
    <compatible>
      <release>2015-08-10</release>
      <release>2014-09-29</release>
      <release>2014-05-05</release>
      <release>2013-12-08</release>
    </compatible>
    <securityissue></securityissue>
    <securitywarning></securitywarning>
    <tags>
      <tag>captcha</tag>
      <tag>spam</tag>
    </tags>
    <screenshoturl></screenshoturl>
    <thumbnailurl></thumbnailurl>
    <downloadurl>https://github.com/splitbrain/dokuwiki-plugin-captcha/zipball/master</downloadurl>
    <sourcerepo>https://github.com/splitbrain/dokuwiki-plugin-captcha</sourcerepo>
    <bugtracker>https://github.com/splitbrain/dokuwiki-plugin-captcha/issues</bugtracker>
    <donationurl>http://donate.dokuwiki.org/CAPTCHA</donationurl>
    <relations>
      <similar></similar>
      <conflicts></conflicts>
      <depends></depends>
    </relations>
  </plugin>
  <plugin>
    ...
  </plugin>
  ...
</repository>
plugin/repository/api.txt · Last modified: 2016-06-10 11:15 by ach