Creates a new library for organizing assets.
Endpoint
POST /libraries
Request Parameters
Pass the following request body parameters:
Name | Data Type | Required | Description |
---|---|---|---|
desc | String | Yes | Defines the library's name. |
allow_copy | Boolean | No | Determines whether assets in this library can be copied. Default: False . |
is_ad | Boolean | No | Specifies if this library may only contain ad assets. Default: False . |
Example Request
{
"desc": "Marketing Library",
"allow_copy": true,
"is_ad": false
}
Response
A successful request returns the following:
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. |
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 Create_Library:
def __init__(self):
self.host = "https://services.uplynk.com"
def run(self):
self._create_library()
def _create_library(self):
url = f"{self.host}/api/v4/libraries"
payload = {
"desc": "Marketing Library",
"allow_copy": True,
"is_ad": False
}
headers = {'Content-Type': 'application/json'}
response = requests.post(
url, params=APIParams(APICredentials()).get_params({}), data=json.dumps(payload), headers=headers
)
print(response.json())
Create_Library().run()
Sample Response
{
"@id": "/api/v4/libraries/8b69f969c65e481385281331520cf1e2",
"@type": "Library",
"id": "8b69f969c65e481385281331520cf1e2",
"desc": "Marketing Library",
"owner_name": "[email protected]",
"library_type": "owner",
"is_ad": false,
"allow_copy": true
}