Lodol Docs

Text

API actions for the Text integration.

Text

Edit, split, join, search, and check text.


Check end of text

Check whether text ends with specific words or characters.

Parameters

ParameterTypeRequiredDescription
textstringYes
suffixstringYes

Response

{
  "status": "success"
}

Extract from text

Pull matches out of text — an email address, web address, number, or your own pattern.

Parameters

ParameterTypeRequiredDescription
textstringYes
typestringYesWhat to pull out of the text.
patternstringNoA regular expression to search for. Used only when Extract is set to Custom pattern.
all_matchesbooleanNoReturn only the first match, or every match as a list.

Response

{
  "status": "success"
}

Format text

Change the letter case of text — make it uppercase, lowercase, capitalize the first letter, or use title case.

Parameters

ParameterTypeRequiredDescription
textstringYes
casestringYesHow the text should be cased.

Response

{
  "status": "success"
}

Join list into text

Turn a list into one piece of text.

Parameters

ParameterTypeRequiredDescription
itemsarrayYes
separatorstringYesUse empty text to join with nothing.

Response

{
  "status": "success"
}

Match keywords

Score text against your keyword lists to see how well it matches. Useful for tagging, filtering, or deciding what should happen next.

Parameters

ParameterTypeRequiredDescription
textstringYes
strong_termsarrayYesMost important words or phrases. Each match adds 3 points.
medium_termsarrayNoFairly important words or phrases. Each match adds 2 points.
weak_termsarrayNoMinor words or phrases. Each match adds 1 point.
thresholdnumberNoTotal points needed to count as a match. Defaults to 3.

Response

{
  "status": "success"
}

Replace text

Find text and replace it with something else.

Parameters

ParameterTypeRequiredDescription
textstringYes
searchstringYes
replacestringYes

Response

{
  "status": "success"
}

Split text

Split text into a list.

Parameters

ParameterTypeRequiredDescription
textstringYes
delimiterstringYesThe text to break at, such as a comma or a space.

Response

{
  "status": "success"
}

Check start of text

Check whether text starts with specific words or characters.

Parameters

ParameterTypeRequiredDescription
textstringYes
prefixstringYes

Response

{
  "status": "success"
}

Check if text includes

Check whether text includes specific words or characters.

Parameters

ParameterTypeRequiredDescription
textstringYes
substringstringYes

Response

{
  "status": "success"
}

Count characters

Count how many characters are in text.

Parameters

ParameterTypeRequiredDescription
textstringYes

Response

{
  "status": "success"
}

Trim whitespace

Remove spaces, tabs, and line breaks from the start and end of text.

Parameters

ParameterTypeRequiredDescription
textstringYes
modestringNoWhich ends to trim: both ends, only the start, or only the end. Defaults to both ends.

Response

{
  "status": "success"
}

Shorten text

Shorten text so it fits within a set number of characters. By default no ending is added; set an ending like “…” to append one when text is cut. The ending counts toward the limit, so the result never exceeds it.

Parameters

ParameterTypeRequiredDescription
textstringYes
lengthnumberYesText longer than this is shortened.
ellipsisstringNoOptional ending added when text is shortened, e.g. “…”, counted within the character limit. Leave blank (the default) to shorten without any ending.
dont_split_wordsbooleanNoKeep whole words instead of cutting one in the middle. When on, the text is shortened at a word boundary, so the result may come out a little shorter than the limit.

Response

{
  "status": "success"
}

Validate text

Check whether text is a valid email address, web address, or phone number.

Parameters

ParameterTypeRequiredDescription
textstringYes
typestringYesWhat kind of value to check for.
regionstringNoThe country the number should belong to, as a two-letter code. Used only when checking a phone number. Defaults to US.

Response

{
  "status": "success"
}

Count words

Count how many words are in text.

Parameters

ParameterTypeRequiredDescription
textstringYes

Response

{
  "status": "success"
}

On this page