You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Current »


Introduction

FlockML is an XML based markup language used to show rich text messages and attachments in Flock.

FlockML Example
<flockml>Hello <strong>foobar</strong>, Welcome to <a href="https://flock.co/">Flock!</a></flockml>

Its salient features are:

  • Renders natively on both desktop and mobile
  • Inspired by HTML, so you will be familiar with many FlockML's elements already
  • Elements for actions specific to Flock, like linking to a user or triggering actions like opening a widget

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.
  • If the Flock client knows the user's name, it will ignore any text content inside. Otherwise, it will display the text content if present.
  • If the Flock client doesn't know the user's name, and no text content is provided, it will display "Unknown User".

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 sendToAppService, no other attribute needs to be provided.