Developers Program

How to get the total (number) of positive feedbacks in Java SDK

Published: July 07 2006, 7:44:00 PM·Updated: July 24 2022, 4:47:01 PM

Products

Answer

You can get a user’s UniquePositiveFeedbackCount by calling getFeedbackSummary() method through either GetUserCall or GetFeedbackCall.
The code snippet below shows how to retrieve the UniquePositiveFeedbackCount using GetFeedbackCall.

GetFeedbackCall api = new GetFeedbackCall(apiContext);
// Executes the API.
FeedbackDetailType[] feedbacks = api.getFeedback();

// retrieve the feedback summary for the user.
FeedbackSummaryType feedbackSummary= api.getFeedbackSummary();

// Get the user’s positive feedback
Integer pFeedBack = feedbackSummary.getUniquePositiveFeedbackCount();
int positivefeedbackCount = pFeedBack.intValue();
How well did this answer your question?