Extension:StructuredDiscussions/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
.
DetectionEdit
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, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
prop=flowinfo (fli)
- This module is deprecated.
- This module requires read rights.
- Source: Flow
- License: GPL-2.0-or-later
Get basic Structured Discussions information about a page.
- Fetch Structured Discussions information about Talk:Sandbox, Main Page, and Talk:Structured Discussions
- api.php?action=query&prop=flowinfo&titles=Talk:Sandbox|Main_Page|Talk:Flow [open in sandbox]
action=flowEdit
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
view-topiclistEdit
The following documentation is the output of Special:ApiHelp/flow+view-topiclist, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
submodule=view-topiclist (vtl)
- This module requires read rights.
- Source: Flow
- License: GPL-2.0-or-later
View a list of topics.
- vtloffset-dir
Direction to order the topics.
- One of the following values: fwd, rev
- Default: fwd
- vtlsortby
Sorting option of the topics, either updated (ordered by topic update time), or newest (ordered by topic creation time).
- One of the following values: newest, updated, user
- Default: user
- vtlsavesortby
Save sortby option to user preferences, if set.
- Type: boolean (details)
- vtloffset-id
Offset value (in UUID format) to start fetching topics at; used only with newest ordering
- vtloffset
Offset value (as a topic update timestamp, in
TS_MW
format (YYYYMMDDHHMMSS
)), to start fetching topics at; used only with updated ordering- vtlinclude-offset
Includes the offset item in the results as well.
- Type: boolean (details)
- vtllimit
Number of topics to fetch.
- Type: integer or max
- The value must be between 0 and 100.
- Default: 10
- vtltoconly
Whether to respond with only the information required for the TOC.
- Type: boolean (details)
- vtlformat
Format to return the content in.
- One of the following values: fixed-html, html, wikitext
- Default: fixed-html
new-topicEdit
The following documentation is the output of Special:ApiHelp/flow+new-topic, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
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-or-later
Creates a new Structured Discussions 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)
- 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-utilsEdit
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, automatically generated by the pre-release version of MediaWiki that is running on this site (MediaWiki.org). |
action=flow-parsoid-utils
- This module requires read rights.
- Source: Flow
- License: GPL-2.0-or-later
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 [open in sandbox]