Opigno Enterprise API provides an endpoint to get the list of all posts related to the given community.
Posts related to the public communities can be viewed even bu the users who are not a community member.Posts related to the private communities are accessible only for the users associated with the given community (the owner or a member).
To get this data, getCommunityPosts query should be called. Results will be returned with pagination, but without possibility to change the order (the newest posts will always be returned first). Also, it is possible to change the sort key. By default, posts will be sorted by the following rule: the pinned ones first (both - pinned for community and individually pinned), then descending by the creation time. The following arguments can be used in the query:
ArgumentTypeDescriptionDefault
communityIdIDRequired. ID of the community to get the posts feed for.
afterCursorReturns results that come after the specified cursor. Should be used together with first parameter. Cannot be used if before is set.
beforeCursorReturns results that come before the specified cursor. Should be used together with last parameter. Cannot be used if after is set.
firstIntegerReturns up to the first N elements from the list. Required if after parameter is set. Cannot be used together with last.
lastIntegerReturns up to the first N elements from the list. Required if before parameter is set. Cannot be used together with first.
sortKeyPostSortKeySort the underlying list by the given key. Available options: PINNED and CREATED.PINNED
  query getCommunityPosts {
    getCommunityPosts(communityId: 1, first: 2) {
      edges {
        node {
          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
            }
          }
        }
      }
      pageInfo {
        hasNextPage
        hasPreviousPage
        endCursor
      },
      totalItems
    }
  }
The query returns the list of the Post objects. Detailed description and the full list of available properties can be found here.
To get the community posts comments, the same getPostComments query should be executed as for any other type of posts.