public class UserWatchResource extends Object
| Constructor and Description |
|---|
UserWatchResource(WatchService watchService,
PersonService personService) |
| Modifier and Type | Method and Description |
|---|---|
ContentWatch |
addContentWatcher(com.atlassian.sal.api.user.UserKey key,
String username,
ContentId contentId)
Create a new watcher for the given user and content id.
|
SpaceWatch |
addSpaceWatch(com.atlassian.sal.api.user.UserKey key,
String username,
List<ContentType> contentTypes,
String spaceKey)
Create a new watcher for the given user and space key.
|
javax.ws.rs.core.Response |
isWatchingContent(com.atlassian.sal.api.user.UserKey key,
String username,
ContentId contentId)
Get information about whether a user is watching a specified content.
|
javax.ws.rs.core.Response |
isWatchingSpace(com.atlassian.sal.api.user.UserKey key,
String username,
ContentType contentType,
String spaceKey)
Get information about whether a user is watching a specified space.
|
javax.ws.rs.core.Response |
removeContentWatcher(com.atlassian.sal.api.user.UserKey key,
String username,
ContentId contentId)
Delete an existing watcher for the given user and content id.
|
javax.ws.rs.core.Response |
removeSpaceWatch(com.atlassian.sal.api.user.UserKey key,
String username,
List<ContentType> contentTypes,
String spaceKey)
Delete an existing watcher for the given user and space key.
|
public UserWatchResource(WatchService watchService, PersonService personService)
@PublicApi public SpaceWatch addSpaceWatch(com.atlassian.sal.api.user.UserKey key, String username, List<ContentType> contentTypes, String spaceKey) throws ServiceException
Create a new watcher for the given user and space key.
User is optional. If not specified, currently logged-in user will be used. Otherwise, it can be specified by either user key or username. When a user is specified and is different from the logged-in user, the logged-in user needs to be a Confluence administrator.
Example request URI(s):
POST http://example.com/confluence/rest/api/user/watch/space/SPACEKEYPOST http://example.com/confluence/rest/api/user/watch/space/SPACEKEY?username=jblogsPOST http://example.com/confluence/rest/api/user/watch/space/SPACEKEY?key=ff8080815a58e24c015a58e263710000POST http://example.com/confluence/rest/api/user/watch/space/SPACEKEY?contentType=blogpostkey - userKey of the user to create the new watcher forusername - userName of the user to create the new watcher forcontentTypes - the optional content type to delete the watcher forServiceException@PublicApi
public javax.ws.rs.core.Response removeSpaceWatch(com.atlassian.sal.api.user.UserKey key,
String username,
List<ContentType> contentTypes,
String spaceKey)
throws ServiceException
Delete an existing watcher for the given user and space key.
User is optional. If not specified, currently logged-in user will be used. Otherwise, it can be specified by either user key or username. When a user is specified and is different from the logged-in user, the logged-in user needs to be a Confluence administrator.
Example request URI(s):
DELETE http://example.com/confluence/rest/api/user/watch/space/SPACEKEYDELETE http://example.com/confluence/rest/api/user/watch/space/SPACEKEY?username=jblogsDELETE http://example.com/confluence/rest/api/user/watch/space/SPACEKEY?key=ff8080815a58e24c015a58e263710000DELETE http://example.com/confluence/rest/api/user/watch/space/SPACEKEY?contentType=blogpostkey - userkey of the user to delete the watcher forusername - username of the user to delete the watcher forcontentTypes - the optional content type to delete the watcher forServiceException@PublicApi
public javax.ws.rs.core.Response isWatchingSpace(com.atlassian.sal.api.user.UserKey key,
String username,
ContentType contentType,
String spaceKey)
throws ServiceException
Get information about whether a user is watching a specified space.
User is optional. If not specified, currently logged-in user will be used. Otherwise, it can be specified by either user key or username. When a user is specified and is different from the logged-in user, the logged-in user needs to be a Confluence administrator.
Example request URI(s):
http://example.com/confluence/rest/api/user/watch/space/SPACEKEYhttp://example.com/confluence/rest/api/user/watch/space/SPACEKEY?username=jblogshttp://example.com/confluence/rest/api/user/watch/space/SPACEKEY?key=ff8080815a58e24c015a58e263710000http://example.com/confluence/rest/api/user/watch/space/SPACEKEY?contentType=blostpostkey - userkey of the user to check for watching stateusername - username of the user to check for watching statecontentType - an optional content type to check for watching stateServiceException@PublicApi public ContentWatch addContentWatcher(com.atlassian.sal.api.user.UserKey key, String username, ContentId contentId) throws ServiceException
Create a new watcher for the given user and content id.
User is optional. If not specified, currently logged-in user will be used. Otherwise, it can be specified by either user key or username. When a user is specified and is different from the logged-in user, the logged-in user needs to be a Confluence administrator.
Example request URI(s):
POST http://example.com/confluence/rest/api/user/watch/content/131213POST http://example.com/confluence/rest/api/user/watch/content/131213?username=jblogsPOST http://example.com/confluence/rest/api/user/watch/content/131213?key=ff8080815a58e24c015a58e263710000key - userkey of the user to create the new watcher forusername - username of the user to create the new watcher forServiceException@PublicApi
public javax.ws.rs.core.Response removeContentWatcher(com.atlassian.sal.api.user.UserKey key,
String username,
ContentId contentId)
throws ServiceException
Delete an existing watcher for the given user and content id.
User is optional. If not specified, currently logged-in user will be used. Otherwise, it can be specified by either user key or username. When a user is specified and is different from the logged-in user, the logged-in user needs to be a Confluence administrator.
Example request URI(s):
DELETE http://example.com/confluence/rest/api/user/watch/content/131213DELETE http://example.com/confluence/rest/api/user/watch/content/131213?username=jblogsDELETE http://example.com/confluence/rest/api/user/watch/content/131213?key=ff8080815a58e24c015a58e263710000key - userkey of the user to delete the watcher forusername - username of the user to delete the watcher forServiceException@PublicApi
public javax.ws.rs.core.Response isWatchingContent(com.atlassian.sal.api.user.UserKey key,
String username,
ContentId contentId)
throws ServiceException
Get information about whether a user is watching a specified content.
User is optional. If not specified, currently logged-in user will be used. Otherwise, it can be specified by either user key or username. When a user is specified and is different from the logged-in user, the logged-in user needs to be a Confluence administrator.
Example request URI(s):
http://example.com/confluence/rest/api/user/watch/content/131213http://example.com/confluence/rest/api/user/watch/content/131213?username=jblogshttp://example.com/confluence/rest/api/user/watch/content/131213?key=ff8080815a58e24c015a58e263710000key - userkey of the user to check for watching stateusername - username of the user to check for watching stateServiceExceptionCopyright © 2003–2021 Atlassian. All rights reserved.