Vidispine
Configuring Vidispine API using CURL
Applies to
Users with limited experience in using API tools in general, evaluating or working with evaluating Vidispine API / Vidinet
Problem description
You have a solid understanding of video and metadata workflows, but you need assistance in understanding how to configure and use the Vidispine API in your Vidinet environment.
Summary
This article will explain and demonstrate a basic example configuration on how to add Azure Blob drive to the Vidispine API using CURL. You will learn how to target the Vidispine API with the information necessary to create a new resource using the HTTP method POST.
There are other popular tools to be used based using same described principles such as POST MAN, http get
Of course, common languages such as Python, Java and similar can also be used to programmatically configure Vidispine API in the same way.
Pre-requisites and system requirements
a verified Vidinet installation
understanding how to use CURL in the terminal window
Vidinet API user permissions to read and write to the Blob Drive
Table of contents
Background
As you have already noticed that the majority of the configuration and workflow customization methods of Vidispine API do not correspond to a general UI ( user interface ). Although this might be unfamiliar to some users, the reason for this architecture is actually quite simple. We do not want the Vidispine configuration of workflow capabilities to be limited by the capabilities of a UI architecture. Instead, we want to give each user the necessary building blocks and tools sets to architect the optimal solution for each particular workflow requirement.
In general, the Http methods to be used with the Vidispine API is
GET - we representation from a resource
POST - we are creating a new resource
PUT - we are updating a resource
DELETE - we are deleting a resource
Our mission
Today's challenge is to update the Vidispine API using a pre-defined XML configuration document containing the necessary authorization expected by your Azure Blob Drive as well as the destination of your Azure Blob Drive.
To do so we need to register storage in Vidispine with a method that has a URI on the form:
azure://:{accessKey}@{accountName}/{containerName}/.
Create a configuration document XML
We start out by creating an example XML document to post to vidispine: storage.xml.
<StorageDocument xmlns="http://xml.vidispine.com/schema/vidispine">
<type>LOCAL</type>
<capacity>150000000000</capacity>
<method>
<uri>azure://:{accessKey}@{accountName}/{containerName}/</uri>
<read>true</read>
<write>true</write>
<browse>true</browse>
</method>
<showImportables>true</showImportables>
</StorageDocument>
NOTE your Azure Blob Drive credentials in line 5
Use CURL to update and configure Vidispine API
Now, navigate to the same directory of your configuration XML storage.xml and continue to update and configure Vidispine API with the storage.xml example configuration.
In the below examples, we are using CURL to
authorize using -uadmin:admin
defining CURL method: -X POST
calling the Vidispine API http://demo.myvidispine.com/API/storage
defining type document and name of document: -d@storage.xml
header of content type: -Hcontent-type:application/xml
Instead of xml you can use Json:
- header of content type: -Hcontent-type:application/json
Conclusion
By understanding this basic method of configuring the Vidispine API, you can apply the same procedure for other similar configurations. After each POST action, you will get a response from Vidispine with an ID. Use this ID to update the same resource in the future using the PUT command.
Related articles