No edit summary |
|||
| Line 1: | Line 1: | ||
===Name=== | |||
API | |||
===Type=== | |||
email | |||
===Synopsis=== | |||
Send an email using the API. | |||
===Description=== | |||
Trigger a FlexForm action. Currently only the email trigger is available. | |||
===Parameters=== | |||
trigger - What function needs to be triggered within FlexForm. This parameter is required. | |||
data - Extra data needed for the Trigger function. Depends on the trigger action. Please read the manual for more information. | |||
title - Title needed for the Trigger function. Depends on the trigger action. Please read the manual for more information. | |||
token - A "csrf" token retrieved from action=query&meta=tokens. This parameter is required. | |||
====Trigger email==== | |||
With this trigger you can send an email, based on the email-template. | |||
The email trigger also needs a title of a page. That page needs to be setup as a full email template. Read the docs "email" on how to setup such a template. | |||
===Example=== | |||
Make a call using the csrf token to the MediaWiki API | |||
<syntaxhighlight lang="api"> | |||
To = api.php | |||
action = FlexFormBot | |||
trigger = email | |||
title = Email template page | |||
</syntaxhighlight> | |||
===Return format=== | |||
The API result will be in a JSON format. When an error occurs, you will have an error field present where you can read its message. | |||
Example of an error | |||
<syntaxhighlight lang="json"> | |||
{ | |||
"FlexFormBot": { | |||
"error": { | |||
"message": "The page you specified doesn't exist." | |||
} | |||
} | |||
} | |||
</syntaxhighlight> | |||
Example of success | |||
<syntaxhighlight lang="json"> | |||
{ | |||
"FlexFormBot": { | |||
"result": { | |||
"success" | |||
} | |||
} | |||
} | |||
</syntaxhighlight> | |||
===Note=== | |||
You need to add the csrf token with every request to FlexFormBot | |||
===Links=== | |||
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select | |||
Revision as of 13:12, 4 April 2022
Name
API
Type
Synopsis
Send an email using the API.
Description
Trigger a FlexForm action. Currently only the email trigger is available.
Parameters
trigger - What function needs to be triggered within FlexForm. This parameter is required. data - Extra data needed for the Trigger function. Depends on the trigger action. Please read the manual for more information. title - Title needed for the Trigger function. Depends on the trigger action. Please read the manual for more information. token - A "csrf" token retrieved from action=query&meta=tokens. This parameter is required.
Trigger email
With this trigger you can send an email, based on the email-template. The email trigger also needs a title of a page. That page needs to be setup as a full email template. Read the docs "email" on how to setup such a template.
Example
Make a call using the csrf token to the MediaWiki API
To = api.php
action = FlexFormBot
trigger = email
title = Email template pageReturn format
The API result will be in a JSON format. When an error occurs, you will have an error field present where you can read its message.
Example of an error
{
"FlexFormBot": {
"error": {
"message": "The page you specified doesn't exist."
}
}
}
Example of success
{
"FlexFormBot": {
"result": {
"success"
}
}
}
Note
You need to add the csrf token with every request to FlexFormBot
Links
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select