Function

$().SPServices

Web Service

SocialDataService

Supported Operations

Operation Options MSDN Documentation Introduced
AddComment url, comment, [isHighPriority], title SocialDataService.AddComment Method 0.5.8
AddTag url, termID, title, [isPrivate] SocialDataService.AddTag Method 0.5.8
AddTagByKeyword url, keyword, title, [isPrivate] SocialDataService.AddTagByKeyword Method 0.5.8
CountCommentsOfUser userAccountName SocialDataService.CountCommentsOfUser Method 0.5.8
CountCommentsOfUserOnUrl userAccountName, url SocialDataService.CountCommentsOfUserOnUrl Method 0.5.8
CountCommentsOnUrl url SocialDataService.CountCommentsOnUrl Method 0.5.8
CountRatingsOnUrl url SocialDataService.CountRatingsOnUrl Method 0.5.8
CountTagsOfUser userAccountName SocialDataService.CountTagsOfUser Method 0.5.8
DeleteComment url, lastModifiedTime SocialDataService.DeleteComment Method 0.5.8
DeleteRating url SocialDataService.DeleteRating Method 0.5.8
DeleteTag url, termID SocialDataService.DeleteTag Method 0.5.8
DeleteTagByKeyword url, keyword SocialDataService.DeleteTagByKeyword Method 0.5.8
DeleteTags url SocialDataService.DeleteTags Method 0.5.8
GetAllTagTerms [maximumItemsToReturn] SocialDataService.GetAllTagTerms Method 0.5.8
GetAllTagTermsForUrlFolder urlFolder, maximumItemsToReturn SocialDataService.GetAllTagTermsForUrlFolder Method 0.5.8
GetAllTagUrls termID SocialDataService.GetAllTagUrls Method 0.5.8
GetAllTagUrlsByKeyword keyword SocialDataService.GetAllTagUrlsByKeywords Method 0.5.8
GetCommentsOfUser userAccountName, [maximumItemsToReturn], [startIndex] SocialDataService.GetCommentsOfUser Method 0.5.8
GetCommentsOfUserOnUrl userAccountName, url SocialDataService.GetCommentsOfUserOnUrl Method 0.5.8
GetCommentsOnUrl url, [maximumItemsToReturn], [startIndex], [excludeItemsTime] SocialDataService.GetCommentsOnUrl Method 0.5.8
GetRatingAverageOnUrl url SocialDataService.GetRatingAverageOnUrl Method 0.5.8
GetRatingOfUserOnUrl userAccountName, url SocialDataService.GetRatingOfUserOnUrl Method 0.5.8
GetRatingOnUrl url SocialDataService.GetRatingOnUrl Method 0.5.8
GetRatingsOfUser userAccountName SocialDataService.GetRatingsOfUser Method 0.5.8
GetRatingsOnUrl url SocialDataService.GetRatingsOnUrl Method 0.5.8
GetSocialDataForFullReplication userAccountName SocialDataService.GetSocialDataForFullReplication Method 0.5.8
GetTags url SocialDataService.GetTags Method 0.5.8
GetTagsOfUser userAccountName, [maximumItemsToReturn], [startIndex] SocialDataService.GetTagsOfUser Method 0.5.8
GetTagTerms [maximumItemsToReturn] SocialDataService.GetTagTerms Method 0.5.8
GetTagTermsOfUser userAccountName, [maximumItemsToReturn] SocialDataService.GetTagTermsOfUser Method 0.5.8
GetTagTermsOnUrl url, [maximumItemsToReturn] SocialDataService.GetTagTermsOnUrl Method 0.5.8
GetTagUrls termID SocialDataService.GetTagUrls Method 0.5.8
GetTagUrlsByKeyword keyword SocialDataService.GetTagUrlsByKeyword Method 0.5.8
GetTagUrlsOfUser termID, userAccountName SocialDataService.GetTagUrlsOfUser Method 0.5.8
GetTagUrlsOfUserByKeyword keyword, userAccountName SocialDataService.GetTagUrlsOfUserByKeyword Method 0.5.8
SetRating url, rating, title, analysisDataEntry* SocialDataService.SetRating Method 0.5.8
UpdateComment url, lastModifiedTime, comment, isHighPriority SocialDataService.UpdateComment Method 0.5.8
* The documentation claims that analysisDataEntry is required, but in my testing it is not. There also don’t seem to be any user settable values in the XML structure.

Last edited Nov 16, 2012 at 2:51 PM by sympmarc, version 13

Comments

PeterKalmstrom Jun 25, 2012 at 9:24 AM 
The above code works for me :-) Hope someone will find it useful!

PeterKalmstrom Jun 25, 2012 at 9:22 AM 
function OkClick() {
$().SPServices({
operation: "AddTagByKeyword",
url: "http://intranet.contoso.com/Shared Documents/Changes.docx",
keyword: "Hello World",
title:"Changes.docx - Shared docs on intranet.contoso.com",
completefunc: function (xData, Status) {
window.alert(xData.statusText);
}
});
}