Overview

VIDIZMO provides default attributes associated with media on the platform, empowering users to enhance search visibility and metadata. The platform features a customizable 'Add Attribute' popup window, enabling users to incorporate diverse custom fields. This article guides you through two crucial processes: creating custom attributes using the Create Custom-Attribute API and subsequently updating the created mashup with essential information and custom attributes. The mashup we are using in this article is the one we created Upload Content article. Furthermore, These APIs have been tested using Postman.  


Before You Start

  • Authorize yourself in the portal by using the following endpoint: /api/v1/user/authenticate/. To learn how to achieve authorization, refer to the  User Authentication.  
  • You must have an existing mashup that you intend to update. If you haven't created a mashup yet, ensure you do so before attempting to apply any updates. 
  • Prepare a reliable testing platform, such as Postman, to test the APIs effectively.  


Creating Custom Attributes

To update a mashup with custom attributes, The first step involves creating a new custom attribute tailored to your requirements. To do that:  


1. Make a Post request to the following endpoint: 

{{Your-Domain}} /api/v1/custom-attributes 

Refer to the Create Custom-Attribute Documentation  for detailed information about the request payload structure and required parameters.  


2. Request Details 

Add the following Request Headers: 

  • Content-Type: Application/json 
  • Authorization: Bearer {{token}} (Token received during authentication) 


3. Request Body 

In the request body, include the payload required for the create custom-attribute API. The minimum parameters necessary for this API call are as follows: 


Example - Request Body (JSON)

[ 
  { 
    "fieldName": "{{customAttributeName}}", //Input the name you wish for your custom attribute here 
    "fieldTypeId": "Text", //Input the custom-attribute field type 
    "isMandatory": "false", //sets the IsMandatory 
    "displayable": "true", // sets the Displayable 
    "searchable": "true", //whether custom attribute should be used to index/search content 
    "facetable": "true", //whether custom attribute should be used in facet filters 
//Gets or sets the list of Mashup Format.  
  "mashupFormats": [  
        "Audio", 
        "Collection", 
        "Document", 
        "Image", 
        "Live", 
        "Playlist", 
        "Quiz", 
        "Survey", 
        "Video" 
    ] 
  } 
] 

Upon successful creation of custom-attributes in your portal your status code will be 200 OK and you will get the following response-body:  


Example – Response Body (JSON) 

[
  {
    "id": "Genre", //the name of the custom attribute we created 
    "status": "Success", //the status upon the creation of the custom attribute 
    "systemId": "171773" //the custom attribute id. 
  }
]


Next Steps 

With the custom attribute successfully created, the next step is to integrate it into the mashup. In the following section, we will guide you through the process of updating the mashup to incorporate this new attribute.


Updating Mashup with the Custom Attribute

Now that you have created a custom attribute, you can update a mashup with it, we will update the mashup created in Upload Content article: 


1. Make a PUT request to the following endpoint: 

{{Your-Domain}}/api/v1/mashup/{{mashupUUID}} 

For more information regarding this API, refer to the Update Mashup Documentation.


2. Request Details 
Add the following Query Parameters: 

  • MashupParts = BasicInfo 
  • MashupParts = CustomAttributes 

The endpoint now will become:

{{Domain}}/api/v1/mashup/{{mashupUUID}}?mashupParts=BasicInfo&mashupParts=CustomAttributes 

Add the following Request Headers: 

  • Content-Type: application/json 
  • Authorization: Bearer token, Token received during authentication. 


Example - Request Body (JSON)

{
  "id": "{{mashupId}}", // ID of the mashup you want to update. 
  "addedBy": {
    "id": "{{addedById}}",
    "isPasswordSet": false
  },
  "tenant": {
    "id": "{{tenantId}}" // Id of the tenant associated with the mashup. 
  },
  "estimatedDuration": 3997,
  "title": "Free_Test_Data_100KB_MP3",
  "uuid": "{{mashupUUID}}",
  "mashupCustomAttributes": [
    {
      "customAttributeId": "{{customAttributeId}}", //Id received upon the creation of the custom attribute. 
      "isMandatory": false,
      "customAttributeName": "{{customAttributeName}}", //Name of the custom attribute created. 
      "facetable": true,
      "displayable": true,
      "customAttributeFieldTypeId": "Text",
      "customAttributeValue": "This is Value"
    }
  ]
}


Note: In the CustomAttributeId and CustomAttributeName fields we added the id and name we received as a response upon the creation of the custom attribute. Furthermore, Remember to replace the placeholders ({{Your-Domain}}, {{Token}}, {{customAttributeName}}, {{customAttributeId}}, {{mashupUUID}}, {{mashupId}}, {{tenantId}}) with your specific values when making the API request. 


Response Details

Upon successful update, expect a response with status code 201 Created and the response body will contain: 


Example - Response Body (JSON)

{
  "status": "Published",
  "contentAccessToken": {
    "token": "sv=2021-10-04&se=2023-10-02T08%3A09%3A45Z&sr=c&sp=r&sig=C4xaJizJOOVCc%2FH%2B6WDy3tbqO0Io%2BU52KqEk7Vm69wQ%3D",
    "expiresAfter": 15
  },
  "id": "273591",
  "systemId": 0,
  "uuid": "41fe8a6c-6472-4d9c-bdfb-6b9dfc585a10"
}

Read Next

Using REST API - Content Processing