java.lang.Object
com.atlassian.confluence.plugins.restapi.experimental.resources.RelationResource

@ExperimentalApi @Consumes("application/json") @Produces("application/json") @Path("/relation/{sourceType}/{sourceKey}/{relationName}/to{targetType}/{targetKey}") public class RelationResource extends Object
A REST resource for manipulating relationships between users, spaces and content.
Favourite relationships between users and space, page or blog post are supported. More relationship types will become available as development progresses.
Since:
5.9
  • Constructor Details

  • Method Details

    • isRelated

      @GET public javax.ws.rs.core.Response isRelated(@PathParam("sourceType") String sourceType, @PathParam("sourceKey") String sourceKey, @PathParam("relationName") String relationName, @PathParam("targetType") String targetType, @PathParam("targetKey") String targetKey, @QueryParam("sourceStatus") ContentStatus sourceStatus, @QueryParam("targetStatus") ContentStatus targetStatus, @QueryParam("sourceVersion") Integer sourceVersion, @QueryParam("targetVersion") Integer targetVersion) throws NotFoundException, PermissionException

      Determines whether a relationship exists between two user, space or content entities.

      Example request URI(s):

      • GET http://localhost:8080/confluence/rest/experimental/relation/user/current/favourite/toSpace/SPC
      • GET http://localhost:8080/confluence/rest/experimental/relation/user/current/favourite/toContent/1234
      Parameters:
      sourceType - the source type of the relationship - possible values are user, space or content for favourites, only 'user' is permitted
      sourceKey - the identifier of the source of the relationship - possible values are a user key, 'current' (logged in user), space key or content identifier
      for favourites, only a user key or 'current' is permitted
      relationName - the name of the relationship type (must be 'favourite')
      targetType - the target type of the relationship - possible values are user, space or content
      for favourites, only 'space' or 'content' is permitted
      targetKey - the identifier of the target of the relationship - possible values are a user key, 'current' (logged in user), space key or content identifier
      for favourites, only a space key or content identifier is permitted
      sourceStatus - The status of the source - this parameter is only used when the source has a type of content
      targetStatus - The status of the target - this parameter is only used when the target has a type of content
      sourceVersion - The version of the source - this parameter is only used when the source has a type of content and status of historical
      targetVersion - The version of the target - this parameter is only used when the target has a type of content and status of historical
      Throws:
      NotFoundException
      PermissionException
    • create

      @PUT public javax.ws.rs.core.Response create(@PathParam("sourceType") String sourceType, @PathParam("sourceKey") String sourceKey, @PathParam("relationName") String relationName, @PathParam("targetType") String targetType, @PathParam("targetKey") String targetKey, @QueryParam("sourceStatus") ContentStatus sourceStatus, @QueryParam("targetStatus") ContentStatus targetStatus, @QueryParam("sourceVersion") Integer sourceVersion, @QueryParam("targetVersion") Integer targetVersion) throws NotFoundException, PermissionException

      Add a relationship between two user, space, or content entities.

      Favourite relationships between users and space, page or blog posts are supported. More relationship types will become available as development progresses.

      For favourites, the current user can create a favourite relationship between themselves and a space, page or blog post. A space administrator can add a favourite relationship for any user.

      Example request URI(s):

      • PUT http://localhost:8080/confluence/rest/experimental/relation/user/current/favourite/toSpace/SPC
      • PUT http://localhost:8080/confluence/rest/experimental/relation/user/current/favourite/toContent/1234
      Parameters:
      sourceType - the source type of the relationship - possible values are user, space or content for favourites, only 'user' is permitted
      sourceKey - the identifier of the source of the relationship - possible values are a user key, 'current' (logged in user), space key or content identifier
      for favourites, only a user key or 'current' is permitted
      relationName - the name of the relationship type (must be 'favourite')
      targetType - the target type of the relationship - possible values are user, space or content
      for favourites, only 'space' or 'content' is permitted
      targetKey - the identifier of the target of the relationship - possible values are a user key, 'current' (logged in user), space key or content identifier
      for favourites, only a space key or content identifier is permitted
      sourceStatus - The status of the source - this parameter is only used when the source has a type of content
      targetStatus - The status of the target - this parameter is only used when the target has a type of content
      sourceVersion - The version of the source - this parameter is only used when the source has a type of content and status of historical
      targetVersion - The version of the target - this parameter is only used when the target has a type of content and status of historical
      Throws:
      NotFoundException
      PermissionException
    • delete

      @DELETE public javax.ws.rs.core.Response delete(@PathParam("sourceType") String sourceType, @PathParam("sourceKey") String sourceKey, @PathParam("relationName") String relationName, @PathParam("targetType") String targetType, @PathParam("targetKey") String targetKey, @QueryParam("sourceStatus") ContentStatus sourceStatus, @QueryParam("targetStatus") ContentStatus targetStatus, @QueryParam("sourceVersion") Integer sourceVersion, @QueryParam("targetVersion") Integer targetVersion) throws NotFoundException, PermissionException

      Remove a relationship between two user, space, or content entities.

      For favourites, the current user can delete their own favourite relationships. A space administrator can delete a favourite relationship for any user.

      Example request URI(s):

      • DELETE http://localhost:8080/confluence/rest/experimental/relation/user/current/favourite/toSpace/SPC
      • DELETE http://localhost:8080/confluence/rest/experimental/relation/user/current/favourite/toContent/1234
      Parameters:
      sourceType - the source type of the relationship - possible values are user, space or content for favourites, only 'user' is permitted
      sourceKey - the identifier of the source of the relationship - possible values are a user key, 'current' (logged in user), space key or content identifier
      for favourites, only a user key or 'current' is permitted
      relationName - the name of the relationship type (must be 'favourite')
      targetType - the target type of the relationship - possible values are user, space or content
      for favourites, only 'space' or 'content' is permitted
      targetKey - the identifier of the target of the relationship - possible values are a user key, 'current' (logged in user), space key or content identifier
      for favourites, only a space key or content identifier is permitted
      sourceStatus - The status of the source - this parameter is only used when the source has a type of content
      targetStatus - The status of the target - this parameter is only used when the target has a type of content
      sourceVersion - The version of the source - this parameter is only used when the source has a type of content and status of historical
      targetVersion - The version of the target - this parameter is only used when the target has a type of content and status of historical
      Throws:
      NotFoundException
      PermissionException