FlockML is an XML based markup language used to show rich text messages and attachments in Flock.
<flockml>Hello <strong>foobar</strong>, Welcome to <a href="https://flock.co/">Flock!</a></flockml> |
Its salient features are:
The root element for FlockML. Any FlockML document that doesn't have <flockml> as its root is considered invalid.
Example |
---|
<flockml>Hello World</flockml> |
The anchor element <a>
defines a hyperlink. Clicking on this opens a URL in the browser.
Example | Rendered |
---|---|
<a href="">Hello World</a> | Hello World |
Name | Required | Description |
---|---|---|
href | Yes | The URL to link to |
The emphasis element <em> is used to emphasise text and is typically italicized.
Example | Rendered |
---|---|
<em>Hello World</em> | Hello World |
The italics element <i> is used to italicize text.
Example | Rendered |
---|---|
<i>Hello World</i> | Hello World |
The strong element <strong>
gives text strong importance, and is typically displayed in bold.
Example | Rendered |
---|---|
<strong>Hello World</strong> | Hello World |
The bold element <b> is used to display text in bold.
Example | Rendered |
---|---|
<b>Hello World</b> | Hello World |
The underline element <u>
renders text with an underline.
Example | Rendered |
---|---|
<u>Hello World</u> | Hello World |
The line break element <br>
produces a line break in text (carriage-return).
Example | Rendered |
---|---|
Hello<br/>World | Hello World |
This element can be used to link to a Flock user.
Example | Rendered |
---|---|
<user userId="u:guid">FirstName LastName</user> | FirstName LastName |
Name | Required | Description |
---|---|---|
userId | Yes | Should be a user identifier. |
The action
element allows an app to trigger a client action. The associated event is client.flockmlAction.
Example |
---|
click <action id="act1" type="openWidget" url="<url>" desktopType="sidebar" mobileType="modal">here</action> to launch a widget. |
Name | Required | Description |
---|---|---|
type | Yes | The type of action to trigger. Should be one of:
|
id | No | An identifier for the action. It is included in the payload for client.flockmlAction as the actionId attribute. |
If type
is openWidget
, the following attributes should also be provided:
Name | Required | Description |
---|---|---|
url | Yes | The widget URL |
desktopType | Yes | The type of widget in desktop. Should be either modal or sidebar . Defaults to modal . |
mobileType | Yes | The type of widget in mobile. If provided, it should be set to modal . |
If type is openBrowser
, the following attributes should be provided:
Name | Required | Description |
---|---|---|
url | Yes | The URL to open |
sendContext | No | Whether to send context to the URL or not. Should be either true or false . Default value is false . |
If type is sendEvent
, no other attribute needs to be provided.