Skip to content

Authority REST API - Association Controller

Retrieve all Associations from an Asset to an Asset Type

Section titled “Retrieve all Associations from an Asset to an Asset Type”

GET /association/from/<type>/<code>/to/<totype>

Retrieves the requested Asset, along with any direct Associations From that Asset to Assets of a specific type.

ParameterDescription
typeA single URL-encoded Asset Type code.
codeA single URL-encoded Asset code.
totypeA single URL-encoded Asset Type code. Will only return Associations to Assets of this type.
ParameterExpectedDescription
appOptionalAn Application identifier. Will only return Associations with context data for this Application.
Can be specified multiple times to include additional Applications.
CodeStatusDescription
200SuccessThe Asset was found.
Content is a single AssociationsFromAsset object.
404FailureThe Asset does not exist.
422FailureInvalid data was provided.
Content is a JSON array of one or more error codes describing the problem.

Synchronise all Associations from an Asset to an Asset Type

Section titled “Synchronise all Associations from an Asset to an Asset Type”

PATCH /association/from/<type>/<code>/to/<totype>

Performs a synchronisation of Associations to Assets of a specific type, which involves:

  • Adding or updating existing Associations.
  • Removing unlisted Associations - that is, Associations with the right Asset Type not included in this call.

Alternatively, if one or more app codes are included, removes any matching context data from unlisted Associations instead. Deletion when there’s no more context data is controlled by deleteOnEmpty.

This method will add or update Assets as necessary, for both the root and associated Assets. They do not need to be created first.

This method will not remove Assets, even if they were created by a previous Association operation.

ParameterDescription
typeA single URL-encoded Asset Type code.
codeA single URL-encoded Asset code.
totypeA single URL-encoded Asset Type code. Will only affect Associations to Assets of this type.
ParameterExpectedDescription
appOptionalAn Application identifier. Context data for this Application will be removed from unlisted Associations.
Can be specified multiple times to delete additional Applications.
deleteOnEmptyOptionalA boolean true/false. If true, and one or more app values are provided, unlisted Associations will be deleted when their context data is empty.

An AssociationsFromAsset object describing the root Asset and any direct associated Assets.

Only Assets that match totype can be supplied.