Updates the details of an existing library.
Endpoint
PATCH /libraries/{library_id}
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
library_id | String | Yes | The unique identifier of the library to update. |
Request Parameters
Pass the following request body parameters:
Name | Data Type | Required | Description |
---|---|---|---|
desc | String | No | Updates the library's name. |
allow_copy | Boolean | No | Determines whether assets in this library can be copied. |
is_ad | Boolean | No | Specifies whether this library may only contain ad assets. |
Example Request
{
"desc": "Updated Library Name",
"allow_copy": false,
"is_ad": true
}
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 | Updated library name. |
owner_name | String | Email associated with the library owner. |
library_type | String | Indicates owner if you created this library. |
is_ad | Boolean | Indicates if this library contains only ad assets. |
allow_copy | Boolean | Indicates if assets can be copied. |
Sample Code
import json
import requests
from api_auth import APICredentials, APIParams
class Update_Library:
def __init__(self, library_id):
self.host = "https://services.uplynk.com"
self.library_id = library_id
def run(self):
self._update_library()
def _update_library(self):
url = f"{self.host}/api/v4/libraries/{self.library_id}"
payload = {
"desc": "Updated Library Name",
"allow_copy": False,
"is_ad": True
}
headers = {'Content-Type': 'application/json'}
response = requests.patch(
url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers
)
print(response.json())
Update_Library("8b69f969c65e481385281331520cf1e2").run()
Sample Response
{
"@id": "/api/v4/libraries/8b69f969c65e481385281331520cf1e2",
"@type": "Library",
"id": "8b69f969c65e481385281331520cf1e2",
"desc": "Updated Library Name",
"owner_name": "[email protected]",
"library_type": "owner",
"is_ad": true,
"allow_copy": false
}