Extension:Flow/API
- See also Flow/Architecture/API and Gerrit change 107411
Most Flow API read and write interactions are submodules of action=flow. Flow also implements a query property flowinfo and a parsing utility module flow-parsoid-utils.
Detection[edit | edit source]
| flowinfo | |
|---|---|
This module cannot be used as a Generator. |
|
| Prefix | fli |
| Required rights | none |
| Post only? | No |
| Generated help | Current |
prop=flowinfo (details below) is one way to check if Flow is enabled on the specified pages.
You can alternatively use prop=info to retrieve page info including content model. The content model will be 'flow-board' if it's enabled. Compare https://en.wikipedia.org/w/api.php?action=query&titles=Wikipedia%20talk:WikiProject%20Breakfast&prop=info and https://en.wikipedia.org/w/api.php?action=query&titles=Wikipedia%20talk:Articles%20for%20deletion&prop=info .
In client-side JavaScript (for gadgets and user scripts), call mw.config.get( 'wgPageContentModel' ).
| The following documentation is the output of Special:ApiHelp/query+flowinfo, generated from query+flowinfo's source code. |
prop=flowinfo (fli)
- This module is deprecated.
- This module requires read rights.
- Source: Flow
- License: GPL-2.0+
Get basic Flow information about a page.
- Fetch Flow information about Talk:Sandbox, Main Page, and Talk:Flow
- api.php?action=query&prop=flowinfo&titles=Talk:Sandbox|Main_Page|Talk:Flow
action=flow[edit | edit source]
| flow | |
|---|---|
This module cannot be used as a Generator. |
|
| Prefix | none |
| Required rights | none |
| Post only? | No |
| Generated help | Current |
All action=flow requests take the following parameters:
submodule: The specific flow submodule you want to use. See below for documentation on some of themworkflow: Id of the workflow to take action uponpage: Page title of the page to take action upontoken: An edit token (see API:Tokens). This is required for all write modules.render: Include this to have an HTML rendering be returned in the output. Used by the extension's JS modules.
For any action that posts data, you will need a token, which defeats cross-site request forgery. To get this, use meta=tokens: Gets a CSRF token
| Result |
|---|
{
"query": {
"tokens": {
"csrftoken": "d197bab38bd17ee31f0f439202945fdf54c98fb6+\\"
}
}
}
|
new-topic[edit | edit source]
| The following documentation is the output of Special:ApiHelp/flow+new-topic, generated from flow+new-topic's source code. |
submodule=new-topic (nt)
- This module requires read rights.
- This module requires write rights.
- This module only accepts POST requests.
- Source: Flow
- License: GPL-2.0+
Creates a new Flow topic on the given workflow.
- nttopic
-
Text for new topic title.
- This parameter is required.
- ntcontent
-
Content for the topic's initial reply.
- This parameter is required.
- ntformat
-
Format of the new topic's initial reply (wikitext|html)
- This parameter is required.
- One of the following values: html, wikitext
- Default: wikitext
- token
-
A "csrf" token retrieved from action=query&meta=tokens
- This parameter is required.
(Since this edit operation has to be an HTTP POST, the link in the generated example above won't work.)
action=flow-parsoid-utils[edit | edit source]
| flow-parsoid-utils | |
|---|---|
This module cannot be used as a Generator. |
|
| Prefix | none |
| Required rights | none |
| Post only? | No |
| Generated help | Current |
| The following documentation is the output of Special:ApiHelp/flow-parsoid-utils, generated from flow-parsoid-utils's source code. |
action=flow-parsoid-utils
- This module requires read rights.
- Source: Flow
- License: GPL-2.0+
Convert text between wikitext and HTML.
- from
-
Format to convert content from.
- This parameter is required.
- One of the following values: html, wikitext
- to
-
Format to convert content to.
- This parameter is required.
- One of the following values: html, wikitext
- content
-
Content to be converted.
- This parameter is required.
- title
-
Title of the page. Cannot be used together with pageid.
- pageid
-
ID of the page. Cannot be used together with title.
- Type: integer
- Convert wikitext '''lorem''' ''blah'' to HTML
- api.php?action=flow-parsoid-utils&from=wikitext&to=html&content='''lorem'''+''blah''&title=Main_Page

