Missions Class

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

Namespace

ConnectApi

Missions Methods

The following are methods for Missions. All methods are static.

exportUserMissionsActivities(communityId, userId)

Export mission activity for a user.

API Version

45.0

Requires Chatter

No

Signature

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

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
userId
Type: String
ID of the user.

Usage

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.

getUserMissionsProgress(communityId, userId)

Get mission activity progress for a user.

API Version

46.0

Requires Chatter

No

Signature

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

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
userId
Type: String
ID of the user.

purgeUserMissionsActivities(communityId, userId)

Start a job to purge mission activity for a user.

API Version

45.0

Requires Chatter

No

Signature

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

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.
userId
Type: String
ID of the user.

Usage

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.

purgeUserMissionsActivities(communityId)

Start a job to purge mission activity for all users.

API Version

49.0

Requires Chatter

No

Signature

public static ConnectApi.UserMissionActivitiesJob purgeUserMissionsActivities(String communityId)

Parameters

communityId
Type: String
Use either the ID for a community, internal, or null.

Usage

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.

updateUserMissionActivityCount(activityType, activityCount, communityId, userId)

Update the mission activity count for a user.

API Version

45.0

Requires Chatter

No

Signature

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

Parameters

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
Use either the ID for a community, internal, or null.
userId
Type: String
ID of the user.