GET /wiki/rest/api/relation/{relationName}/from/{sourceType}/{sourceKey}/to/{targetType}/{targetKey}

Find whether a particular type of relationship exists from a source entity to a target entity. Note, relationships are one way.

For example, you can use this method to find whether the current user has selected a particular page as a favorite (i.e. 'save for later'): GET /wiki/rest/api/relation/favourite/from/user/current/to/content/123

Permissions required: Permission to view both the target entity and source entity.

Servers

Path parameters

Name Type Required Description
targetKey String Yes

The identifier for the target entity:

  • If targetType is user, then specify either current (logged-in user), the user key of the user, or the account ID of the user. Note that the user key has been deprecated in favor of the account ID for this parameter. See the migration guide for details.
  • If targetType is 'content', then specify the content ID.
  • If targetType is 'space', then specify the space key.
targetType String Yes

The target entity type of the relationship. This must be 'space' or 'content', if the relationName is 'favourite'.

Possible values:

  • "space"
  • "content"
  • "user"
sourceType String Yes

The source entity type of the relationship. This must be 'user', if the relationName is 'favourite'.

Possible values:

  • "space"
  • "content"
  • "user"
sourceKey String Yes
  • The identifier for the source entity:

  • If sourceType is user, then specify either current (logged-in user), the user key of the user, or the account ID of the user. Note that the user key has been deprecated in favor of the account ID for this parameter. See the migration guide for details.

  • If sourceType is 'content', then specify the content ID.

  • If sourceType is 'space', then specify the space key.

relationName String Yes

The name of the relationship. This method supports the 'favourite' (i.e. 'save for later') relationship as well as any other relationship types created via Create relationship.

Query parameters

Name Type Required Description
targetVersion Integer No

The version of the target. This parameter is only used when the targetType is 'content' and the targetStatus is 'historical'.

targetStatus String No

The status of the target. This parameter is only used when the targetType is 'content'.

expand[] Array No

A multi-value parameter indicating which properties of the response object to expand.

  • relationData returns information about the relationship, such as who created it and when it was created.
  • source returns the source entity.
  • target returns the target entity.
sourceVersion Integer No

The version of the source. This parameter is only used when the sourceType is 'content' and the sourceStatus is 'historical'.

sourceStatus String No

The status of the source. This parameter is only used when the sourceType is 'content'.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.