Add Clipping Profile Metadata

Adds Clipping Profile Metadata

Request

Request syntax:

POST /clipping-profiles/Clipping Profile ID/metadata

Request URL variable:

Define the following variable when submitting the above request:

VariableA variable represents a value that must be replaced. A variable consists of either a URL segment (e.g., "0001" in /0001/) or a query string value (e.g., "3" in mediaTypes=3).Description
Clipping Profile ID RequiredIdentifies a clipping profile by its system-defined or external ID. Use the Get Multiple Clipping Profiles endpoint to retrieve a list of clipping profiles and their IDs.

Request body parameters:

Pass the following request body parameters (pass only the fields you want to update):

NameData TypeDescription
default_valueRequiredStringThis is the default value if the input_text is set to “text”.  If the input_type is set to “dropdown” and “include_freeform” is enabled, this will set the free form text to this value, but can still be modified in the clipping tool by the end user.
valuesList of ListsKey/Value string pairs as lists: Syntax [[‘key1’, ‘value 1’],[‘key2’, ‘value 2’]]
input_typeRequiredStringSpecifies the type of meta this will be.  Valid values are ‘text’ or ‘dropdown’
include_free_formRequiredBooleanAllows you to include a free form option if the input_type is ‘dropdown’
include_nullRequiredBooleanAllows you to include “No Value” option if the input_type is set to “dropdown”
keyRequiredStringName of the metadata

Response

A successful request returns a 200 OK response that contains the following properties:

NameData TypeDescription
@idStringIndicates the relative path to an endpoint that returns this clipping profile configuration.
@typeStringReturns ClippingProfileMetadata.
createdStringIdentifies the date and time (UTC) this integration was create. Syntax: {YYYY-MM-DDThh:mm:ss.ssssss}Z Example: 2024-04-04T16:35:46.054Z
lastmodBooleanIdentifies the date and time (UTC) this integration was create. Syntax: {YYYY-MM-DDThh:mm:ss.ssssss}Z Example: 2024-04-04T16:35:46.054Z
default_valueStringThis is the default value fi the input_text is set to “text”.  If the input_type is set to “dropdown” and “include_freeform” is enabled, this will set the free form text to this value, but can still be modified in the clipping tool by the end user.
idStringIdentifies a clipping profile integration by its system-defined ID
include_free_formStringIndicates if free form is enabled
include_nullStringIndicates if “No Value” option is enabled
input_typeStringIndicates the type that is being used for the metadata
keyStringThe description of this metadata
ownerStringIndicates the system-defined ID for the user that own this clipping profile integration.
profileStringIndicates the system-defined ID representing the clipping profile
valuesList of ListsKey/Value string pair as lists

Sample Request/Response

Call the clipping_profiles_metadata_get_create module (Python 3) to add clipping profile metadata. This module imports names from the api_auth module.

Request:

			import json
			from pprint import PrettyPrinter
			import requests
			from api_auth import APICredentials, APIParams

			pp = PrettyPrinter().pprint

			class ClippingProfiles:
			"""Class Description"""
			def __init__(self, source_list):
			"""dummy"""
			self.profile_id = None

			for key, value in source_list.items():
			setattr(self, key, value)

			self.host = "https://services.uplynk.com"
			self.headers = {"Content-Type": "application/json"}

			def run(self):
			"""dummy"""
			self._get_youtube_login_url()

			def _get_youtube_login_url(self):
			"""dummy"""
			url = f"{self.host}/api/v4/clipping-profiles/{self.profile_id}/metadata"

			payload = {
			"default_value":"",
			"include_free_form": False,
			"include_null": False,
			"input_type": "dropdown",
			"key": "blue_colors",
			"values": [
			["blue_dark","Dark Blue"],
			["blue_light","Light Blue"],
			["blue_navy","Navy Blue"],
			]
			}

			response = requests.post(
			url,
			params=APIParams(APICredentials()).get_params({}),
			data=json.dumps(payload),
			headers=self.headers,
			timeout=15
			)

			pp(response.json())

			class_variables = {"profile_id": "be1af15490e24399bb6c4f2a36384d66"}
			ClippingProfiles(class_variables).run()

Response:

			{
			"@id": "/api/v4/clipping-profiles/be1af15490e24399bb6c4f2a36384d66/metadata/704d17c332624569b3a6414a3422fdd1",
			"@type": "ClippingProfileMetadata",
			"created": "2024-05-07T15:27:41.767Z",
			"default_value": "",
			"id": "704d17c332624569b3a6414a3422fdd1",
			"include_free_form": False,
			"include_null": False,
			"input_type": "dropdown",
			"key": "blue_colors",
			"lastmod": "2024-05-07T15:27:41.767Z",
			"owner": "53b2162d19394227b56d5cdca5c3dc9f",
			"profile": "be1af15490e24399bb6c4f2a36384d66",
			"values": [
			["blue_dark", "Dark Blue"],
			["blue_light", "Light Blue"],
			["blue_navy", "Navy Blue"],
			],
		}