Authority REST API - Asset Controller
The asset/bytype/<type>/bycode
URL provides bulk management of Assets by code.
Retrieve Assets by code
Section titled “Retrieve Assets by code”GET /asset/bytype/<type>/bycode
Retrieves the listed Assets of the given type.
URL Parameters
Section titled “URL Parameters”Parameter | Description |
---|---|
type | A single URL-encoded Asset Type code. |
Query Parameters
Section titled “Query Parameters”Parameter | Expected | Description |
---|---|---|
code | Optional | An Asset code. Can be specified multiple times to retrieve additional Assets. |
app | Optional | An Application identifier. Will only return Assets with context data for this Application. Can be specified multiple times to include additional Applications. |
Response
Section titled “Response”Code | Status | Description |
---|---|---|
200 | Success | Content is an array of Asset objects. |
422 | Failure | Invalid data was provided. Content is a JSON array of one or more error codes describing the problem. |
Retrieve Assets by code (bulk)
Section titled “Retrieve Assets by code (bulk)”POST /asset/bytype/<type>/bycode
Retrieves the listed Assets of the given type.
This is an alternative endpoint for providing more codes than the maximum URL length permits.
URL Parameters
Section titled “URL Parameters”Parameter | Description |
---|---|
type | A single URL-encoded Asset Type code. |
Query Parameters
Section titled “Query Parameters”Parameter | Expected | Description |
---|---|---|
app | Optional | An Application identifier. Will only return Assets with context data for this Application. Can be specified multiple times to include additional Applications. |
POST Body
Section titled “POST Body”A JSON string array, listing the Asset codes to retrieve.
Response
Section titled “Response”Code | Status | Description |
---|---|---|
200 | Success | Content is an array of Asset objects. |
422 | Failure | Invalid data was provided. Content is a JSON array of one or more error codes describing the problem. |
Delete Assets by code
Section titled “Delete Assets by code”DELETE /asset/bytype/<type>/bycode
Deletes the listed Assets of the given type.
Alternatively, if one or more app
codes are included, removes any matching context data instead. Deletion of Assets with no more context data is controlled by deleteOnEmpty
.
URL Parameters
Section titled “URL Parameters”Parameter | Description |
---|---|
type | A single URL-encoded Asset Type code. |
Query Parameters
Section titled “Query Parameters”Parameter | Expected | Description |
---|---|---|
app | Optional | An Application identifier. Context data for this Application will be removed from the listed Assets. Can be specified multiple times to delete additional Applications. |
deleteOnEmpty | Optional | A boolean true/false. If true, and one or more app values are provided, Assets will be deleted when their context data is empty. |
POST Body
Section titled “POST Body”A JSON string array, listing the Asset codes to delete.
Response
Section titled “Response”Code | Status | Description |
---|---|---|
204 | Success | Completed successfully. Asset codes that do not match a registered Asset will be ignored. |
409 | Failure | The operation would cause a conflict. Content is a JSON array of one or more error codes describing the problem. |
422 | Failure | Invalid data was provided. Content is a JSON array of one or more error codes describing the problem. |