little Text Format

Warning

Deprecation Notice
The Marketing version 202302 (Marketing February 2023) and below has been sunset and the unversioned APIs are going to 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."
}

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 | '"\\|" | "\\{" | "\\}" | "\\@" | "\\[" | "\\]" | "\\(" | "\\)" | "\\<" | "\\>" | "\\#" | "\\\\" | "\\*" | "\\_" | "\\~"' )+