Missions Class

Export and purge mission activity for users. Get a user’s mission progress. Update mission activity counts for users.

ConnectApi

These methods are for Missions. All methods are static.

All methods in this class require Chatter and are subject to the per user, per namespace, per hour rate limit.

Export mission activity for a user.

45.0

Yes

public static ConnectApi.UserMissionActivitiesJob exportUserMissionsActivities(String communityId, String userId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID of the user.

Type: ConnectApi.UserMissionActivitiesJob

You can export these activities with this method.

  • FeedItemAnswerAQuestion—User answered a question.
  • FeedItemLikeSomething—User liked a post or comment.
  • FeedItemMarkAnswerAsBest—User marked an answer as the best answer.
  • FeedItemPostQuestion—User posted a question.
  • FeedItemReceiveAComment—User received a comment on a post.
  • FeedItemReceiveALike—User received a like on a post or comment.
  • FeedItemReceiveAnAnswer—User received an answer to a question.
  • FeedItemWriteAComment—User commented on a post.
  • FeedItemWriteAPost—User made a post.
  • FeedItemYourAnswerMarkedBest—​User’s answer was marked as the best answer.

Get mission activity progress for a user.

46.0

Yes

public static ConnectApi.UserMissionActivityCollection getUserMissionsProgress(String communityId, String userId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID of the user.

Type: ConnectApi.UserMissionActivityCollection

Start a job to purge mission activity for a user.

45.0

Yes

public static ConnectApi.UserMissionActivitiesJob purgeUserMissionsActivities(String communityId, String userId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID of the user.

Type: ConnectApi.UserMissionActivitiesJob

This method purges these activities.

  • FeedItemAnswerAQuestion—User answered a question.
  • FeedItemLikeSomething—User liked a post or comment.
  • FeedItemMarkAnswerAsBest—User marked an answer as the best answer.
  • FeedItemPostQuestion—User posted a question.
  • FeedItemReceiveAComment—User received a comment on a post.
  • FeedItemReceiveALike—User received a like on a post or comment.
  • FeedItemReceiveAnAnswer—User received an answer to a question.
  • FeedItemWriteAComment—User commented on a post.
  • FeedItemWriteAPost—User made a post.
  • FeedItemYourAnswerMarkedBest—​User’s answer was marked as the best answer.

Start a job to purge mission activity for all users.

49.0

Yes

public static ConnectApi.UserMissionActivitiesJob purgeUserMissionsActivities(String communityId)

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

Type: ConnectApi.UserMissionActivitiesJob

This method purges these activities.

  • FeedItemAnswerAQuestion—User answered a question.
  • FeedItemLikeSomething—User liked a post or comment.
  • FeedItemMarkAnswerAsBest—User marked an answer as the best answer.
  • FeedItemPostQuestion—User posted a question.
  • FeedItemReceiveAComment—User received a comment on a post.
  • FeedItemReceiveALike—User received a like on a post or comment.
  • FeedItemReceiveAnAnswer—User received an answer to a question.
  • FeedItemWriteAComment—User commented on a post.
  • FeedItemWriteAPost—User made a post.
  • FeedItemYourAnswerMarkedBest—​User’s answer was marked as the best answer.

Update the mission activity count for a user.

45.0

Yes

public static ConnectApi.UserMissionActivityStatus updateUserMissionActivityCount(ConnectApi.UserMissionActivityType activityType, Integer activityCount, String communityId, String userId)

activityType

Type: ConnectApi.UserMissionActivityType

Type of mission activity for a user. Values are:

  • FeedItemAnswerAQuestion—User answered a question.
  • FeedItemLikeSomething—User liked a post or comment.
  • FeedItemMarkAnswerAsBest—User marked an answer as the best answer.
  • FeedItemPostQuestion—User posted a question.
  • FeedItemReceiveAComment—User received a comment on a post.
  • FeedItemReceiveALike—User received a like on a post or comment.
  • FeedItemReceiveAnAnswer—User received an answer to a question.
  • FeedItemWriteAComment—User commented on a post.
  • FeedItemWriteAPost—User made a post.
  • FeedItemYourAnswerMarkedBest—​User’s answer was marked as the best answer.

activityCount

Type: Integer

Number of mission activities of the specified type for the user.

communityId

Type: String

ID for an Experience Cloud site, internal, or null.

userId

Type: String

ID of the user.

Type: ConnectApi.UserMissionActivityStatus