Skip to main content
You can retrieve an information about any post the current user has access to by calling getPost query. It will return the Post object that represents both - post and comment:
ParameterTypeDescription
idIDRequired. The post entity ID.
textStringRequired. The post text. Will be returned as a markup with all included available tags (<a>, <p>, <br>).
authorUserContextUserContextContains the post author user context data.
createdIntRequired. Timestamp when the post was created.
parentPostPostContain the parent post for a comment. Will be empty if a post is returned.
cta[Cta]Contains the list of Call To Action objects available for the given post.
commentsNumberIntContains the number of related comments for the post. Will return NULL for a comment.
isLikedBooleanRequired. Represents the like flag. If true, the post is liked by the current API user.
isPinnedBooleanRequired. Represents the pin flag. If true, the post is pinned by the current API user. Only posts can be pinned, not comments.
likesNumberIntRequired. Contains the number of “like” reactions for the given post.
sharedContentPostSharedContentRepresents the data of the content that was shared in the post (learning path or certificate). Available only for posts and empty for a comment.
images[MediaImage]Images shared in the post. It is possible to share up to 10 images in one post, max image size is 20 Mb. Allowed extensions: png, jpg, jpeg, gif.
files[MediaFile]Files shared in the post. It is possible to share up to 10 files in one post, max file size is 20 Mb. Allowed extensions: txt, pdf, doc, docx, xls, xlsx, ppt, pptx, svg.
communityCommunityRepresents the community the post relates to. Optional, will remain empty for the regular social posts.

PostSharedContent object

ParameterTypeDescription
idIDRequired. ID of the shared content (a learning path or a certificate).
typePostSharedContentTypeRequired. Available options: LEARNING_PATH or CERTIFICATE.
titleStringRequired. The content title.
descriptionStringThe content description (available only for a learning path).
imageMediaImageRepresents an image associated with the shared content.
earnedOnIntA timestamp of the date when the award was earned (available only for the certificates).

Post CTA

Action IDDescriptionCorresponding mutation/query
COMMENT_POSTAllows to add a comment to the given post.createPostComment
PIN_POSTAllows to mark the given post as pinned for the current API user.pinPost
UNPIN_POSTUnpins the previously pinned post.unpinPost
PIN_POST_FOR_COMMUNITYAvailable only for community posts and can be executed by the community owner. Marks the post as pinned for all community members.pinPostForCommunity
UNPIN_POST_FOR_COMMUNITYAvailable only for community posts and can be executed by the community owner. Unpins the previously pinned post for all community members.unpinPostForCommunity
EDIT_POSTAllows to update the post/comment text and available only for the author.editPost
DELETE_POSTAllows to delete the post. Available for the author or the user associated with a context with ADMINISTRATOR scope.deletePost
HIDE_POSTHides the post for the current API user.hidePost
TOGGLE_LIKEAllows to add/remove “like” reaction on the post.toggleLike
REMOVE_CONNECTIONRemoves the post author from the current user network.removeUserConnection
  query getPost {
    getPost(postId: 175) {
      id
      text
      created
      commentsNumber
      isLiked
      likesNumber
      authorUserContext {
        id
        uuid
      }
      sharedContent {
      id
      type
      title
      description
      earnedOn
        image {
          alt
          title
          url
        }
      }
      cta {
        actionId
        title
        arguments {
          key
          value
        }
      }
    }
  }
I