Replace/Clear Collection
PUT/api/v1/assetcollection/:collection_id
Replace assets
Replace existing assets in a Collection with a new list of assets.
REQUEST PARAMETERS
| Parameter | Type | Description |
|---|---|---|
assets | JSON | List of Collection id to be updated |
REQUEST JSON
{
"assets": ["b3ad7854e1ad4ce8a8c83272447f980b"]
}
Clear assets
Clear all Assets from a Collection by putting an empty list of assets.
REQUEST JSON
{
"assets": []
}
Refusing stale writes
Send expected_revision with the revision you read from Get Collection. If the collection changed since, nothing is written and the response is 409 with "error": "stale_revision" and the collection's current_revision. Without expected_revision the write is applied as before.
{
"assets": ["b3ad7854e1ad4ce8a8c83272447f980b"],
"expected_revision": 7
}
HTTP RESPONSE
| Parameter | Type | Description |
|---|---|---|
status | string | OK or ERROR |
data | JSON | The updated Collection in Asset Collection JSON format, with its new revision |
Request
Responses
- 200
- 400
- 401
- 403
- 409
- 500
Successful operation. data is the updated collection, including its new revision.
Bad request - Invalid inputs, including an expected_revision that is not a non-negative whole number
Unauthorized - Invalid or missing authentication
Forbidden - Insufficient permissions
expected_revision does not match: the collection changed since you read it. Nothing was written.
Internal server error