Jump to content

API:Stashedit: Difference between revisions

From mediawiki.org
Content deleted Content added
Marked this version for translation
add bullets
Line 14: Line 14:
== Parameters == <!--T:3-->
== Parameters == <!--T:3-->
</translate>
</translate>
{{ApiParam|title|<translate><!--T:4--> Title of the page being edited.</translate>|required=1}}
*{{ApiParam|title|<translate><!--T:4--> Title of the page being edited.</translate>|required=1}}
{{ApiParam|section|<translate><!--T:5--> Section number. 0 for the top section, new for a new section.</translate>}}
*{{ApiParam|section|<translate><!--T:5--> Section number. 0 for the top section, new for a new section.</translate>}}
{{ApiParam|sectiontitle|<translate><!--T:6--> The title for a new section.</translate>}}
*{{ApiParam|sectiontitle|<translate><!--T:6--> The title for a new section.</translate>}}
{{ApiParam|text|<translate><!--T:7--> Page content.</translate>}}
*{{ApiParam|text|<translate><!--T:7--> Page content.</translate>}}
{{ApiParam|stashedtexthash|<translate><!--T:8--> Page content hash from a prior stash to use instead.</translate>}}
*{{ApiParam|stashedtexthash|<translate><!--T:8--> Page content hash from a prior stash to use instead.</translate>}}
{{ApiParam|summary|<translate><!--T:9--> Change summary.</translate>}}
*{{ApiParam|summary|<translate><!--T:9--> Change summary.</translate>}}
{{ApiParam|contentformat|<translate><!--T:10--> Content serialization format used for the input text.</translate>|values=<code>text/x-wiki</code> (wikitext), <code>text/javascript</code> (javascript), <code>text/css</code> (css), <code>text/plain</code> (plain text), <code>application/json</code> (json)|required=1}}
*{{ApiParam|contentformat|<translate><!--T:10--> Content serialization format used for the input text.</translate>|values=<code>text/x-wiki</code> (wikitext), <code>text/javascript</code> (javascript), <code>text/css</code> (css), <code>text/plain</code> (plain text), <code>application/json</code> (json)|required=1}}
{{ApiParam|contentmodel|<translate><!--T:11--> Content model of the new content.</translate>|values=<code>wikitext</code>, <code>javascript</code>, <code>css</code>, <code>text</code> and <code>json</code>. <translate><!--T:12--> This list may include additional values registered by extensions; on Wikimedia wikis, these include:</translate> <code>JsonZeroConfig</code>, <code>Scribunto</code>, <code>JsonSchema</code>|required=1}}
*{{ApiParam|contentmodel|<translate><!--T:11--> Content model of the new content.</translate>|values=<code>wikitext</code>, <code>javascript</code>, <code>css</code>, <code>text</code> and <code>json</code>. <translate><!--T:12--> This list may include additional values registered by extensions; on Wikimedia wikis, these include:</translate> <code>JsonZeroConfig</code>, <code>Scribunto</code>, <code>JsonSchema</code>|required=1}}
{{ApiParam|baserevid|<translate><!--T:13--> Revision ID of the base revision.</translate>|required=1}}
*{{ApiParam|baserevid|<translate><!--T:13--> Revision ID of the base revision.</translate>|required=1}}
{{ApiParam|token|description=<translate><!--T:14--> A "csrf" token retrieved from <tvar|query>action=query&meta=tokens</></translate>|required=1}}
*{{ApiParam|token|description=<translate><!--T:14--> A "csrf" token retrieved from <tvar|query>action=query&meta=tokens</></translate>|required=1}}


{{TNT|Api help|stashedit}}
{{TNT|Api help|stashedit}}

Revision as of 22:37, 1 February 2017

Prepare an edit in shared cache.

Parameters

  • title: Title of the page being edited.
  • section: Section number. 0 for the top section, new for a new section.
  • sectiontitle: The title for a new section.
  • text: Page content.
  • stashedtexthash: Page content hash from a prior stash to use instead.
  • summary: Change summary.
  • contentformat: Content serialization format used for the input text. Possible values: text/x-wiki (wikitext), text/javascript (javascript), text/css (css), text/plain (plain text), application/json (json)
  • contentmodel: Content model of the new content. Possible values: wikitext, javascript, css, text and json. This list may include additional values registered by extensions; on Wikimedia wikis, these include: JsonZeroConfig, Scribunto, JsonSchema
  • baserevid: Revision ID of the base revision.
  • token: A "csrf" token retrieved from action=query&meta=tokens


action=stashedit

(main | stashedit)
  • This module is internal or unstable, and you should not use it. Its operation may change without notice.
  • This module requires read rights.
  • This module requires write rights.
  • This module only accepts POST requests.
  • Source: MediaWiki
  • License: GPL-2.0-or-later

Prepare an edit in shared cache.

This is intended to be used via AJAX from the edit form to improve the performance of the page save.

Specific parameters:
Other general parameters are available.
title

Title of the page being edited.

This parameter is required.
section

Section identifier. 0 for the top section, new for a new section.

sectiontitle

The title for a new section.

text

Page content.

stashedtexthash

Page content hash from a prior stash to use instead.

summary

Change summary.

Default: (empty)
contentmodel

Content model of the new content.

This parameter is required.
One of the following values: GadgetDefinition, Graph.JsonConfig, Json.JsonConfig, JsonSchema, MassMessageListContent, NewsletterContent, Scribunto, SecurePoll, css, flow-board, javascript, json, sanitized-css, text, translate-messagebundle, unknown, vue, wikitext, worklist
contentformat

Content serialization format used for the input text.

This parameter is required.
One of the following values: application/json, application/octet-stream, application/unknown, application/vue+xml, application/x-binary, text/css, text/javascript, text/plain, text/unknown, text/x-wiki, unknown/unknown
baserevid

Revision ID of the base revision.

This parameter is required.
Type: integer
token

A "csrf" token retrieved from action=query&meta=tokens

This parameter is required.


[[Category:MediaWiki APITemplate:Translation]]