One or more HashTags can be put in a message. A HashTag allows the identification of a message or a photo. Finding content by HashTag is possible and very effective.


Example: Here how to post simple text message with a HashTag

String message = "This is a #hashtag message";

FeedPost feedPost = new FeedPost.Builder()

Feed createdFeed = session.getNewsFeed().blockingCreate(feedPost);
List<HashTag> hashTags = createdFeed.getBodyMessageTagEntities().getHashTags();

for (HashTag hashTag : hashTags) {
let message = "This is a #hashtag message"

let feedPost = try FeedPost.Builder()

let createdFeed = try session.newsFeed.blockingCreate(feedPost)
let hashTags = createdFeed?.bodyMessageTagEntities?.hashTags

hashTags?.forEach {
let post = (new FeedPost())
    .setMessage("This is a #hashtag message")
let feed = await session.newsFeed.create(post);
let post = (new FeedPost())
    .setMessage("This is a #hashtag message")
session.newsFeed.create(post).then((feed) => {


hash_tag JSON object looks like this

  "id": 2213798990793426400,
  "created_date": "2018-07-30T12:24:29Z",
  "hash_tag_text": "#hashtag",
  "start_index": 10,
  "end_index": 18,
  "access_control": "PUBLIC",
  "text": "#hashtag",
  "entity_type": "HASH_TAG",
  "displayed_name": "#hashtag",
  "id_str": "2213798990793426528",
  "type": "HashTag"