little Text Format

Warning

Deprecation Notice
The Marketing Version 202310 (Marketing October 2023) and earlier versions (excluding 202306 and 202307) have been sunset. Additionally, the unversioned APIs will be sunset soon. We recommend that you migrate to the versioned APIs as well as migrate to the new Content and Community Management APIs to avoid disruptions. See the Migration page for more details. If you haven’t yet migrated and have questions, submit a request on the LinkedIn Developer Support Portal.

little is a representation of user-generated text with a focus on capturing non-textual information in a concise manner.

In the Posts API, commentary text is stored as a text string along with an array of attributes. little is a simplified replacement for this model used in the Posts API.

Note

Characters reserved for little elements must be escaped to be treated as plaintext. See Text for a list of reserved characters.

Supported Elements

Element Type Purpose Params Example
TextElement Represents plain text String text Hello World
MentionElement Mention an entity URN representing the entity to be mentioned. Can be a Person or Organization URN. @[Eddy](urn:li:person:1234) @[Devtestco] (urn:li:organization:2414183)
HashtagElement Show a hashtag String text #hashtag

Supported Templates

Template Name Purpose Parameters Example
HashtagTemplate Represents a hashtag, including the hashtag sign, which should be either '#' (U+0023) or '#' (U+FF03). (String hashtagSign, String hashtagValue) {hashtag\|#\|mytag} {hashtag\|#\|mytag}

Example

The following example mentions a company called Acme Corp.

{
   "commentary": "Hello @[Acme Corp](urn:li:organization:1234)"
}

The following example includes a hashtag for #Technology using the HashtagTemplate.

{
   "commentary": "Excited to share my thoughts on the future of {hashtag|#|Technology} and how it's shaping the world we live in."
}

Note

  • All reserved characters need to be escaped with a backslash, even if those characters are not used in one of the supported elements or templates.
  • Reserved characters that need escaping are listed in the text section.

Sample

{
   "commentary": "Hello, these are some bullet points:\n\n\\* Point 1\n\\* Point 2\n\\* Point 3"
}

Language Grammar

content

content ::= LittleText+ | 'EOF' 

LittleText

LittleText ::= LittleElement+ 

LittleElement

LittleElement ::= TextElement | MentionElement | HashtagElement | HashtagTemplate 

HashtagTemplate

HashtagTemplate ::=  '{hashtag|' ( # | #) '|' Text}' 

MentionElement

MentionElement ::= '@' FallbackText? '(' 'Urn' ')' 

Hashtag Element

HashtagElement ::= '#' SINGLE_WORD 

Fallback Text

Text to be rendered and displayed (e.g. in place of MentionElement Urn)

FallbackText ::= '[' Text ']'

Text

Text ::= ( NON_RESERVED_CHAR_SEQUENCES | '"\\|" | "\\{" | "\\}" | "\\@" | "\\[" | "\\]" | "\\(" | "\\)" | "\\<" | "\\>" | "\\#" | "\\\\" | "\\*" | "\\_" | "\\~"' )+