Feedback API - WCF

The Voting and Rating API provides an Agility developer the ability to easily integrate Voting, Rating, Likes, Approval and Disapproval features against any piece of content within Agility’s Content System. There are simple calls that are used to support adding and aggregating these values together.

SaveRatingFeedback(DataServiceAuthorization auth, RatingFeedback feedback)
This method will save a RatingFeedback object to the Feedback API. The result will be an integer with the current RatingFeedbackID.
using (Agility_UGC_API_WCFClient client = DataServiceUtil.GetUGCClient())
{
   DataServiceAuthorization auth =
     DataServiceUtil.GetDataServiceAuthorization(-1);
   
   RatingFeedback feeback = new RatingFeedback();
   feedback.RelatedContentID = 123;
   feedback.RatingValue = 3;
   feedback.ReferenceName = "BlogEntries";
   feedback.ContentType = FeedbackContentType.UGC;
   feedback.SubmissionType= FeedbackSubmissionType.Rating;
			
   int RatingFeedbackID = client.SaveRatingFeedback(auth, feedback)

   if (RatingFeedbackID >0) 
   {
     //Rating Successfully Saved
   }
}
                        
SaveBooleanFeedback(DataServiceAuthorization auth, BooleanFeedback feedback)
This method will save a BooleanFeedback object to the Feedback API. The result will be an integer with the current BooleanFeedbackID.
using (Agility_UGC_API_WCFClient client = DataServiceUtil.GetUGCClient())
{
   DataServiceAuthorization auth =
     DataServiceUtil.GetDataServiceAuthorization(-1);
   
   BooleanFeedback feeback = new BooleanFeedback ();
   feedback.RelatedContentID = 123;
   feedback.RatingValue = 3;
   feedback.ReferenceName = "BlogEntries";
   feedback.ContentType = FeedbackContentType.UGC;
   feedback.SubmissionType= FeedbackSubmissionType.Like;
			
   int BooleanFeedbackID = client.SaveBooleanFeedback(auth, feedback)

   if (BooleanFeedbackID >0) 
   {
     //Rating Successfully Saved
   }
}
                        
DeleteBooleanFeedback(DataServiceAuthorization auth, int booleanFeedbackID)
This method will remove a Boolean Feedback entry from the Feedback API
using (Agility_UGC_API_WCFClient client = DataServiceUtil.GetUGCClient())
{
   DataServiceAuthorization auth =
     DataServiceUtil.GetDataServiceAuthorization(-1);
   
  
			
   bool success = client.DeleteBooleanFeedback(auth, 321)

   if (success) 
   {
     //Boolean Feedback Deleted successfully
   }
}
	
                        
DeleteRatingFeedback(DataServiceAuthorization auth, int ratingFeedbackID)
This method will remove a Rating Feedback entry from the Feedback API
using (Agility_UGC_API_WCFClient client = DataServiceUtil.GetUGCClient())
{
   DataServiceAuthorization auth =
     DataServiceUtil.GetDataServiceAuthorization(-1);
   	
   bool success = client.DeleteRatingFeedback(auth, 321)

   if (success) 
   {
     //RatingFeedback Deleted successfully
   }
}

                        
GetFeedbackAggregate(DataServiceAuthorization auth, FeedbackSearchArgs searchArg)
This method is used to perform searches on the feedback API and provide back rolled up aggregates of the data.
using (Agility_UGC_API_WCFClient client = DataServiceUtil.GetUGCClient())
{
   DataServiceAuthorization auth =
     DataServiceUtil.GetDataServiceAuthorization(-1);
  
   //search the number of Likes for the Blog Entry with ID = 123 
   FeedbackSearchArgs searchArg= new FeedbackSearchArgs ();
   searchArg.ReferenceName = "BlogEntries";
   searchArg.ContentType = FeedbackContentType.UGC;
   searchArg.SubmissionType = FeedbackSubmissionType.Like;
   searchArg.RelatedContentIDs = new int[123];
   searchArg.Action = AggregateTypes.Count;
		
   List result= client.GetFeedbackAggregate(auth, searchArg)

   if (result!=null && result.Count>0) 
   {
      //successfully retrieved like count
      double totalLikes = result[0].Result;
   }
}
                        

LOGIN

Log in with your Agility username and password or
register for the site




Log In

REGISTER












Register

FORGOT PASSWORD