Given a ConnectApi.MarkupBeginSegmentInput with a markupType of ConnectApi.MarkupType.HYPERLINK, the url attribute is required as stated in the documentation: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_connectapi_input_markup_begin_segment.htm.

When working with it, I've realized that the url doesn't seem to matter. The value of the LinkSegmentInput or TextSegmentInput is what is rendered and used as the link.

It seems like a pretty new feature, Spring '19 I think, so I'm trying to figure out if this is the actual desired behavior or if I'm doing something hacky. Any help, information, or links around this issue would be helpful.

Here's the debug log of the segments, notice the different urls: Debug Log

And here is the rendered chatter message, you'll have to take my word for it that when you click on it that it goes to google: Rendered message

1 Answer 1


Through some trial and error, I have discovered that the url property is used when the inner segment is not a URL. Meaning when you select a piece of text to link somewhere.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .