Skip to content

Authority REST API - Asset Controller

The asset/bytype/<type>/bycode/<code> URL manipulates individual Assets by code.

HEAD /asset/bytype/<type>/bycode/<code>

Checks if an Asset is registered.

ParameterDescription
typeA single URL-encoded Asset Type code.
codeA single URL-encoded Asset code.
CodeStatusDescription
204SuccessThe Asset exists.
404FailureThe Asset does not exist.
422FailureInvalid data was provided.
Content is a JSON array of one or more error codes describing the problem.

GET /asset/bytype/<type>/bycode/<code>

Retrieves an Asset.

ParameterDescription
typeA single URL-encoded Asset Type code.
codeA single URL-encoded Asset code.
CodeStatusDescription
200SuccessThe Asset was found.
Content is a single Asset object.
404FailureThe Asset does not exist.
422FailureInvalid data was provided.
Content is a JSON array of one or more error codes describing the problem.

POST /asset/bytype/<type>/bycode/<code>

Adds or updates a registered Asset. The Context data will be merged with any existing registration.

ParameterDescription
typeA single URL-encoded Asset Type code.
codeA single URL-encoded Asset code.

A single Asset object to add or update. The supplied Asset Type and code must match that of the URL.

CodeStatusDescription
201SuccessThe Asset was registered.
The redirect Location will point to the registered Asset Type.
422FailureInvalid data was provided.
Content is a JSON array of one or more error codes describing the problem.

PATCH /asset/bytype/<type>/bycode/<code>

Replaces a registered Asset, optionally changing its Asset Type and/or Asset code.

The supplied Context data will replace any existing Context data.

If the Asset Type and/or code are changed, all Associations to or from that Asset will change to the new Asset Type and/or code.

ParameterDescription
typeA single URL-encoded Asset Type code.
codeA single URL-encoded Asset code.

A single Asset object to replace. The supplied Asset Type and/or code can differ from the URL.

CodeStatusDescription
201SuccessThe Asset Type was replaced.
The redirect Location will point to the new registered Asset Type.
404FailureThe Asset Type does not exist.
422FailureInvalid data was provided.
Content is a JSON array of one or more error codes describing the problem.

DELETE /asset/bytype/<type>/bycode/<code>

Deletes a registered Asset. Will fail if any Associations reference this Asset.

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

ParameterDescription
typeA single URL-encoded Asset Type code.
codeA single URL-encoded Asset code.
ParameterExpectedDescription
appOptionalAn Application identifier. Context data for this Application will be removed from the Asset.
Can be repeated to delete additional Applications.
deleteOnEmptyOptionalA boolean true/false. If true, and one or more app values are provided, the Asset will be deleted when its context data is empty.
CodeStatusDescription
204SuccessThe Asset was deleted.
404FailureThe Asset does not exist.
409FailureThe operation would cause a conflict.
Content is a JSON array of one or more error codes describing the problem.
422FailureInvalid data was provided.
Content is a JSON array of one or more error codes describing the problem.