watchService

A service for manipulating a user's watches on objects.
Method Description
createCommunityWatch Create a watch on a community for the specified user.
createThreadWatch Create a watch on a thread for the specified user.
createUserWatch Create a watch on a user for the specified user.
deleteWatch Delete the specified watch.
deleteWatches Deletes all watches that a user has.
getCommunityWatch Returns a watch on a particular community, or null if there isn't a watch.
getCommunityWatchCount Return the count of all community watches in a particular communityID for the given userID.
getCommunityWatches Returns an array of IDs for all the community objects a user is watching in a community.
getDeleteDays Returns the number of days that a watched object can remain inactive before watches on that object are deleted.
getThreadWatch Returns a watch on a particular thread, or null if there isn't a watch.
getTotalWatchCount Returns a count of all watches that a userID has of a particular type.
getUserWatch Returns a watch on a particular user, or null if there isn't a watch.
getWatchList Returns an array of Watch objects for a particular object type that the given user is watching.
getWatchUsers Returns all the users who are watching this objectType and objectID.
isCommunityWatched Returns true if the user is watching the specified community.
isThreadWatched Returns true if the user is watching the specified thread.
isUserWatched Returns true if the user is watching the specified user.
setDeleteDays Sets the number of days that a watched object can remain inactive before watches on that object are deleted.

createCommunityWatch

Create a watch on a community for the specified user.

POST http://domain:port/application_context/rpc/rest/watchService/communityWatches

Arguments

Name Type Description
userID xs:long The ID of the user to set the watch for.
communityID xs:long The ID of the community to watch.

Arguments Template

<createCommunityWatch> 
    <userID>xs:long</userID>
    <communityID>xs:long</communityID>
</createCommunityWatch>

Response

Type Description
Watch The newly created watch.

Response Template

<createCommunityWatchResponse> 
    <return>
        <!-- Contents of Watch -->
    <return>
</createCommunityWatchResponse>

Errors

Error When Returned
UserNotFound if the user represented by the user id doesn't exist
CommunityNotFound if the community represented by the community id doesn't exist
Unauthorized if not an admin or the user.

createThreadWatch

Create a watch on a thread for the specified user.

POST http://domain:port/application_context/rpc/rest/watchService/threadWatches

Arguments

Name Type Description
userID xs:long The ID of the user to set the watch for.
threadID xs:long The ID of thread to watch.

Arguments Template

<createThreadWatch> 
    <userID>xs:long</userID>
    <threadID>xs:long</threadID>
</createThreadWatch>

Response

Type Description
Watch The newly created watch.

Response Template

<createThreadWatchResponse> 
    <return>
        <!-- Contents of Watch -->
    <return>
</createThreadWatchResponse>

Errors

Error When Returned
UserNotFound if the user represented by the user id doesn't exist
com.jivesoftware.community.ForumThreadNotFoundException if the thread the user is trying to watch doesn't exist
Unauthorized if not an admin or the user.

createUserWatch

Create a watch on a user for the specified user.

POST http://domain:port/application_context/rpc/rest/watchService/userWatches

Arguments

Name Type Description
userID xs:long The ID of the user to set the watch for.
watchedUserID xs:long The ID of the user to watch.

Arguments Template

<createUserWatch> 
    <userID>xs:long</userID>
    <watchedUserID>xs:long</watchedUserID>
</createUserWatch>

Response

Type Description
Watch The newly created watch.

Response Template

<createUserWatchResponse> 
    <return>
        <!-- Contents of Watch -->
    <return>
</createUserWatchResponse>

Errors

Error When Returned
UserNotFound if the user represented by either userid doesn't exist
Unauthorized if not an admin or the user.

deleteWatch

Delete the specified watch.

DELETE http://domain:port/application_context/rpc/rest/watchService/watches/{userID}/{objectID}/{objectType}

Arguments

Name Type Description
watch Contents of Watch The watch to delete.

Arguments Template

<deleteWatch> 
    <watch>
        <!-- Contents of Watch -->
    <watch>
</deleteWatch>

Errors

Error When Returned
NotFound if the watch are trying to delete doesn't exist
Unauthorized if not a system admin or the user owning the watch.

deleteWatches

Deletes all watches that a user has.

DELETE http://domain:port/application_context/rpc/rest/watchService/users/{userID}

Arguments

Name Type Description
userID xs:long The ID of the user.

Arguments Template

<deleteWatches> 
    <userID>xs:long</userID>
</deleteWatches>

Errors

Error When Returned
UserNotFound if the user whose watches we are trying to delete doesn't exist
Unauthorized if not a system admin or the user owning the watch.

getCommunityWatch

Returns a watch on a particular community, or null if there isn't a watch.

GET http://domain:port/application_context/rpc/rest/watchService/communityWatches/{userID}/{communityID}

Arguments

Name Type Description
userID xs:long The ID of the user to acquire a watch for.
communityID xs:long The ID of the community to acquire the watch for.

Arguments Template

<getCommunityWatch> 
    <userID>xs:long</userID>
    <communityID>xs:long</communityID>
</getCommunityWatch>

Response

Type Description
Watch The Watch or null if the community isn't being watched by the user.

Response Template

<getCommunityWatchResponse> 
    <return>
        <!-- Contents of Watch -->
    <return>
</getCommunityWatchResponse>

Errors

Error When Returned
UserNotFound if the user represented by the user id doesn't exist
CommunityNotFound if the community represented by the community id doesn't exist
Unauthorized if not a system admin or the user.

getCommunityWatchCount

Return the count of all community watches in a particular communityID for the given userID.

GET http://domain:port/application_context/rpc/rest/watchService/communityWatches/count/{userID}/{communityID}

Arguments

Name Type Description
userID xs:long The userID to return the watch count for.
communityID xs:long The communityID to return the watch count for.

Arguments Template

<getCommunityWatchCount> 
    <userID>xs:long</userID>
    <communityID>xs:long</communityID>
</getCommunityWatchCount>

Response

Type Description
xs:int The count of community watches for a userID in a given communityID.

Response Template

<getCommunityWatchCountResponse> 
    <return>xs:int</return>
</getCommunityWatchCountResponse>

Errors

Error When Returned
UserNotFound if the user represented by the user id doesn't exist
CommunityNotFound if the community represented by the community id doesn't exist
Unauthorized if not a system admin or the user.if not a system admin or the userID.

getCommunityWatches

Returns an array of IDs for all the community objects a user is watching in a community.

GET http://domain:port/application_context/rpc/rest/watchService/allCommunityWatches/{userID}/{communityID}

Arguments

Name Type Description
userID xs:long The ID of the user.
communityID xs:long The ID of the community.

Arguments Template

<getCommunityWatches> 
    <userID>xs:long</userID>
    <communityID>xs:long</communityID>
</getCommunityWatches>

Response

Type Description
List of An array of community IDs.

Response Template

<getCommunityWatchesResponse> 
    <!-- List of ... -->
    <return>xs:long</return>
</getCommunityWatchesResponse>

Errors

Error When Returned
UserNotFound if the user represented by the user id doesn't exist
CommunityNotFound if the community represented by the community id doesn't exist
Unauthorized if not a system admin or the user.

getDeleteDays

Returns the number of days that a watched object can remain inactive before watches on that object are deleted.

GET http://domain:port/application_context/rpc/rest/watchService/deleteDays

Response

Type Description
xs:int the number of days a watched object can be inactive before watches on it are deleted.

Response Template

<getDeleteDaysResponse> 
    <return>xs:int</return>
</getDeleteDaysResponse>

getThreadWatch

Returns a watch on a particular thread, or null if there isn't a watch.

GET http://domain:port/application_context/rpc/rest/watchService/threadWatches/{userID}/{threadID}

Arguments

Name Type Description
userID xs:long The ID of the user with the watch.
threadID xs:long The ID of the thread being watched.

Arguments Template

<getThreadWatch> 
    <userID>xs:long</userID>
    <threadID>xs:long</threadID>
</getThreadWatch>

Response

Type Description
Watch The Watch or null if the thread isn't being watched by the user.

Response Template

<getThreadWatchResponse> 
    <return>
        <!-- Contents of Watch -->
    <return>
</getThreadWatchResponse>

Errors

Error When Returned
UserNotFound if the user represented by the userid doesn't exist
com.jivesoftware.community.ForumThreadNotFoundException if the thread we're trying to watch doesn't exist
Unauthorized if not a system admin or the user.

getTotalWatchCount

Returns a count of all watches that a userID has of a particular type. Valid object types are:

GET http://domain:port/application_context/rpc/rest/watchService/watches/count/{userID}/{objectType}

Arguments

Name Type Description
userID xs:long The ID of the user to get the watch count for.
objectType xs:int The object type to get a watch count for.

Arguments Template

<getTotalWatchCount> 
    <userID>xs:long</userID>
    <objectType>xs:int</objectType>
</getTotalWatchCount>

Response

Type Description
xs:int The total number of watches that a userID has of type objectType.

Response Template

<getTotalWatchCountResponse> 
    <return>xs:int</return>
</getTotalWatchCountResponse>

Errors

Error When Returned
UserNotFound if the user represented by the user id doesn't exist
Unauthorized if not a system admin or the user.

getUserWatch

Returns a watch on a particular user, or null if there isn't a watch.

GET http://domain:port/application_context/rpc/rest/watchService/userWatches/{userID}/{watchedUserID}

Arguments

Name Type Description
userID xs:long the userID with the watch.
watchedUserID xs:long the userID being watched.

Arguments Template

<getUserWatch> 
    <userID>xs:long</userID>
    <watchedUserID>xs:long</watchedUserID>
</getUserWatch>

Response

Type Description
Watch the Watch or null if the watchedUserID isn't being watched by the userID.

Response Template

<getUserWatchResponse> 
    <return>
        <!-- Contents of Watch -->
    <return>
</getUserWatchResponse>

Errors

Error When Returned
UserNotFound if the user represented by either userid doesn't exists*
Unauthorized if not a system admin or the user.

getWatchList

Returns an array of Watch objects for a particular object type that the given user is watching. Valid objectType's are:

GET http://domain:port/application_context/rpc/rest/watchService/watches/{userID}/{objectType}

Arguments

Name Type Description
userID xs:long the userID to retrieve watches for
objectType xs:int the object type.

Arguments Template

<getWatchList> 
    <userID>xs:long</userID>
    <objectType>xs:int</objectType>
</getWatchList>

Response

Type Description
List of Watch An array of the user's watches corresponding to an object type.

Response Template

<getWatchListResponse> 
    <!-- List of ... -->
    <return>
        <!-- Contents of Watch -->
    <return>
</getWatchListResponse>

Errors

Error When Returned
UserNotFound if the user represented by the userid doesn't exist
Unauthorized if not a system admin or the user.

getWatchUsers

Returns all the users who are watching this objectType and objectID.

GET http://domain:port/application_context/rpc/rest/watchService/users/{objectType}/{objectID}/{watchType}

Arguments

Name Type Description
objectType xs:int the type of object being watched.
objectID xs:long the ID of the object being watched.
watchType xs:int the type of watch (EMAIL, BATCH).

Arguments Template

<getWatchUsers> 
    <objectType>xs:int</objectType>
    <objectID>xs:long</objectID>
    <watchType>xs:int</watchType>
</getWatchUsers>

Response

Type Description
List of User the users who are watching this objectType and objectID.

Response Template

<getWatchUsersResponse> 
    <!-- List of ... -->
    <return>
        <!-- Contents of User -->
    <return>
</getWatchUsersResponse>

isCommunityWatched

Returns true if the user is watching the specified community.

GET http://domain:port/application_context/rpc/rest/watchService/isCommunityWatched/{userID}/{communityID}

Arguments

Name Type Description
userID xs:long The ID of the user.
communityID xs:long The ID of the community.

Arguments Template

<isCommunityWatched> 
    <userID>xs:long</userID>
    <communityID>xs:long</communityID>
</isCommunityWatched>

Response

Type Description
xs:boolean True if the object is being watched by the user, false otherwise.

Response Template

<isCommunityWatchedResponse> 
    <return>xs:boolean</return>
</isCommunityWatchedResponse>

Errors

Error When Returned
UserNotFound if the user represented by the user id doesn't exists
CommunityNotFound if the community represented by the community id doesn't exist
Unauthorized if not allowed to view the community

isThreadWatched

Returns true if the user is watching the specified thread.

GET http://domain:port/application_context/rpc/rest/watchService/isThreadWatched/{userID}/{threadID}

Arguments

Name Type Description
userID xs:long The ID of the user.
threadID xs:long The ID of the thread.

Arguments Template

<isThreadWatched> 
    <userID>xs:long</userID>
    <threadID>xs:long</threadID>
</isThreadWatched>

Response

Type Description
xs:boolean True if the object is being watched by the user, false otherwise.

Response Template

<isThreadWatchedResponse> 
    <return>xs:boolean</return>
</isThreadWatchedResponse>

Errors

Error When Returned
NotFound if either the user or thread doesn't exist
Unauthorized if not allowed to read the thread.

isUserWatched

Returns true if the user is watching the specified user.

GET http://domain:port/application_context/rpc/rest/watchService/isUserWatched/{userID}/{watchedUserID}

Arguments

Name Type Description
userID xs:long The ID of the user.
watchedUserID xs:long The ID of the watched user.

Arguments Template

<isUserWatched> 
    <userID>xs:long</userID>
    <watchedUserID>xs:long</watchedUserID>
</isUserWatched>

Response

Type Description
xs:boolean True if the object is being watched by the user, false otherwise.

Response Template

<isUserWatchedResponse> 
    <return>xs:boolean</return>
</isUserWatchedResponse>

Errors

Error When Returned
UserNotFound if the user represented by either userid doesn't exist

setDeleteDays

Sets the number of days that a watched object can remain inactive before watches on that object are deleted.

POST http://domain:port/application_context/rpc/rest/watchService/deleteDays

Arguments

Name Type Description
deleteDays xs:int The number days a watch can be inactive before being automatically deleted.

Arguments Template

<setDeleteDays> 
    <deleteDays>xs:int</deleteDays>
</setDeleteDays>

Errors

Error When Returned
Unauthorized if not a system admin.