Introduction

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:

Elements

flockml

The root element for FlockML. Any FlockML document that doesn't have <flockml> as its root is considered invalid.

Example
<flockml>Hello World</flockml>

a

The anchor element <a> defines a hyperlink. Clicking on this opens a URL in the browser.

ExampleRendered
<a href="">Hello World</a>
Hello World

Attributes

NameRequiredDescription
hrefYesThe URL to link to

em

The emphasis element <em> is used to emphasise text and is typically italicized.

ExampleRendered
<em>Hello World</em>
 Hello World

i

The italics element <i> is used to italicize text.

ExampleRendered
<i>Hello World</i>
 Hello World

strong

The strong element <strong> gives text strong importance, and is typically displayed in bold.

ExampleRendered
<strong>Hello World</strong>
 Hello World

b

The bold element <b> is used to display text in bold.

ExampleRendered
<b>Hello World</b>
 Hello World

u

The underline element <u> renders text with an underline.

ExampleRendered
<u>Hello World</u>
 Hello World

br

The line break element <br> produces a line break in text (carriage-return).

ExampleRendered
Hello<br/>World

Hello

World

user

This element can be used to link to a Flock user.

ExampleRendered
<user userId="u:guid">FirstName LastName</user>
 FirstName LastName

Attributes

NameRequiredDescription
userIdYesShould be a user identifier.

action

The action element allows an app to trigger a client actionThe associated event is client.flockmlAction.

Example
click <action id="act1" type="openWidget" url="<url>" desktopType="sidebar" mobileType="modal">here</action> to launch a widget.

Attributes

NameRequiredDescription
typeYes

The type of action to trigger. Should be one of:

  • openWidget
  • openBrowser
  • sendEvent
idNoAn 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:

NameRequiredDescription
urlYesThe widget URL
desktopTypeYesThe type of widget in desktop. Should be either modal or sidebar. Defaults to modal.
mobileTypeYesThe type of widget in mobile. If provided, it should be set to modal.

If type is openBrowser, the following attributes should be provided:

NameRequiredDescription
urlYesThe URL to open
sendContextNoWhether 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.