Removes one or more assets from a specified library.
Endpoint
DELETE /libraries/{library_id}/assets
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
library_id | String | Yes | The unique identifier of the library from which assets will be removed. |
Query Parameters
Pass the following query parameter:
Name | Data Type | Required | Description |
---|---|---|---|
ids | String | Yes | A comma-separated list of asset IDs to be removed from the library. |
Example Request
DELETE /libraries/8b69f969c65e481385281331520cf1e2/assets?ids=789012,345678
Response
A successful request returns:
Name | Data Type | Description |
---|---|---|
@id | String | Relative path to retrieve this resource. |
@type | String | Returns Library . |
id | String | System-defined identifier for the library. |
desc | String | Library name. |
owner_name | String | Email associated with the library owner. |
library_type | String | Indicates owner if you created this library. |
message | String | Confirmation that the assets were removed successfully. |
Sample Code
import requests
from api_auth import APICredentials, APIParams
class Remove_Assets_From_Library:
def __init__(self, library_id, asset_ids):
self.host = "https://services.uplynk.com"
self.library_id = library_id
self.asset_ids = asset_ids
def run(self):
self._remove_assets_from_library()
def _remove_assets_from_library(self):
url = f"{self.host}/api/v4/libraries/{self.library_id}/assets"
params = {"ids": ",".join(self.asset_ids)}
headers = {'Content-Type': 'application/json'}
response = requests.delete(
url, params=params, headers=headers
)
print(response.json())
Remove_Assets_From_Library("8b69f969c65e481385281331520cf1e2", ["789012", "345678"]).run()
Sample Response
{
"@id": "/api/v4/libraries/8b69f969c65e481385281331520cf1e2",
"@type": "Library",
"id": "8b69f969c65e481385281331520cf1e2",
"desc": "Marketing Library",
"owner_name": "[email protected]",
"library_type": "owner",
"message": "Assets removed successfully."
}