
Three Simple Methods to Invoke the Vidispine API From .NET Code by Vidispine June 15, 2016 Howto
Binagora is on fire and returns with another guest post. We know we have a bunch of developers on .NET, therefore we created a .NET SDK. This post shows how you can invoke the Vidispine API from .NET, using the SDK or using standard .NET classes. All with example code.
The following article describe three simple ways to invoke the Vidispine API from .NET code. Two of them use standard .NET classes, while the last one uses the Vidispine .NET SDK. Code snippets were written using C# but you can of course use another language, such as VB.NET, if you want to.
We'll use the simplest test case possible, and let us retrieve the id of the first available item in the Vidispine library.
First of all, let's see how it's done in Postman. As you may already know, it's just a simple http GET request to the Vidispine API to retrieve an item id.
Notice that we're using two Postman variables for a specific environment:
{{vs}}: this is the Vidispine base address (url + port)
{{credentials}}: this is the username and password in basic http format (:) encoded in base64.
Ok, that was the principle of how to query the Vidispine API for an item id. Now let's do the same thing from code.
Given the following constants:
C#
private const string address = http://xxx.xxx.xxx.xxx:8080/API; private const string userName = admin; private const string password = admin;
1
2
3
private const string address = http://xxx.xxx.xxx.xxx:8080/API;
private const string userName = admin;
private const string password = admin;
Option 1: Using WebRequest class
C#
private static string GetUsingWebRequest(string requestUri) { var request = (HttpWebRequest)WebRequest.Create(requestUri); request.Credentials = new NetworkCredential(userName, password); using(var response = (HttpWebResponse)request.GetResponse()) { var stream = response.GetResponseStream(); var reader = new StreamReader(stream); string result = reader.ReadToEnd(); return result; } }
1
2
3
4
5
6
7
8
9
10
11
12
13
14
private static string GetUsingWebRequest(string requestUri)
{
var request = (HttpWebRequest)WebRequest.Create(requestUri);
request.Credentials = new NetworkCredential(userName, password);
using(var response = (HttpWebResponse)request.GetResponse())
{
var stream = response.GetResponseStream();
var reader = new StreamReader(stream);
string result = reader.ReadToEnd();
return result;
}
}
Create a WebRequest, set the credentials and execute the request. Remember to release the request calling the Dispose() method or wrapping the instance into a using statement as we did in the sample.
Notice that in this case, we know the response contains a plain text with an item id. That's why we read the stream, and converts it into a string instead of a specific type.
Option 2: Using HttpClient class
C#
private static string GetUsingHttpClient(string requestUri) { var handler = new HttpClientHandler() { Credentials = new NetworkCredential(userName, password) }; var client = new HttpClient(handler); client.BaseAddress = new Uri(address); string message = client.GetStringAsync(requestUri).Result; return message; }
1
2
3
4
5
6
7
8
9
10
11
12
13
private static string GetUsingHttpClient(string requestUri)
{
var handler = new HttpClientHandler()
{
Credentials = new NetworkCredential(userName, password)
};
var client = new HttpClient(handler);
client.BaseAddress = new Uri(address);
string message = client.GetStringAsync(requestUri).Result;
return message;
}
Similar to previous option, it is just a matter of using another http client from the .NET framework.
In this case, credentials are specified on a client handler, then the http client is created using that handler.
The request is executed asynchronously, which is powerful and could be needed in a real situation.
In this case we're just reading the Result property immediately, but it's important to understand that the request is fired in an independent thread. Once thread is completed, you can execute your own callback.
Option 3: Using Vidispine .NET SDK
C#
private static string GetUsingVidispineSdk() { var rootResource = new VidispineResource(address).Authenticate(userName, password); var itemResource = rootResource.Item; string result = itemResource.SearchPlainGET.Number(1).CallText(); return result; }
1
2
3
4
5
6
7
8
private static string GetUsingVidispineSdk()
{
var rootResource = new VidispineResource(address).Authenticate(userName, password);
var itemResource = rootResource.Item;
string result = itemResource.SearchPlainGET.Number(1).CallText();
return result;
}
Finally the easiest way to do it, just call the SDK. Notice that in this case, the action to be executed is not part of the address. You specify the object and action based on the properties. We may say this is the strongly typed option to do it.
You can find more information about how to download and use the Vidispine .NET SDK in the post Getting Started With the Vidispine .NET SDK. If you want to try out the SDK, you can find the latest versions of the SDK here:
64-bit version of the Vidispine .NET SDK v4.5
32-bit version of the Vidispine .NET SDK v4.5
Running the app will show you the result 3 times, once for each option. In this case first item available is #525 but of course that will depend on your environment.
You can download the full console app code from the following GitHub Gist.
Hope you like it.
This blog post was written by our friends at Binagora. Check them out and see how they can help you with your next Media&Entertainment project.
Most recent headlines
05/01/2027
Worlds first 802.15.4ab-UWB chip verified by Calterah and Rohde & Schwarz to be ...
04/08/2026
Dalet, a leading technology and service provider for media-rich organizations, t...
04/07/2026
April 7 2026, 19:00 (PDT) Detective Conan: Fallen Angel of the Highway Opens in...
01/06/2026
January 6 2026, 05:30 (PST) Dolby Sets the New Standard for Premium Entertainment at CES 2026
Throughout the week, Dolby brings to life the latest innovatio...
14/05/2026
Sweetwater and Airstream have announced a custom-built Dolby Atmos mobile recording studio inside an Airstream trailer, set to tour music festivals, schools, tr...
14/05/2026
The American Association of Professional Baseball (AAPB) has announced a new par...
14/05/2026
ESPN has announced plans to transform Santa Monica Beach into a broadcast hub du...
14/05/2026
Amagi has announced a significant update to Amagi CLOUDPORT, its cloud-based broadcast playout platform. The update includes 250-plus features shipped in FY25-2...
14/05/2026
Clear-Com will exhibit at InfoComm 2026 (Booth N7005, June 17-19, Las Vegas Convention Center), introducing a new product that builds on Arcadia Central Station...
14/05/2026
Ikegami will exhibit at BroadcastAsia 2026 (Stand 5D3-1, Singapore Expo, May 20-22), introducing two new viewfinders alongside its existing camera, control, and...
14/05/2026
Grass Valley has announced that dB Broadcast has delivered new IP-based outside ...
14/05/2026
NAGRAVISION, a Kudelski Group company, has announced a partnership with the World Professional Billiards and Snooker Association (WPBSA) to launch Play Snooker,...
14/05/2026
Belden Inc. has announced a definitive agreement to acquire RUCKUS Networks from Vistance Networks for approximately $1.85 billion. The transaction has been app...
14/05/2026
NVIDIA has released the Content Localization Blueprint, a modular reference arch...
14/05/2026
Disney has announced that Disney will be the exclusive U.S. streaming home of the Banana Bowl, the Banana Ball league season championship, streaming live this ...
14/05/2026
Arkona technologies and technology partner manifold will demonstrate their production solutions on the Magna Systems and Engineering stand (Booth 5D1-1) at Broa...
14/05/2026
Haivision will host a webinar on Thursday, May 21 at 10 a.m. ET / 4 p.m. CET cov...
14/05/2026
The CW Network and ESPN have announced a sublicense broadcast agreement for The CW to televise ACC football and men's and women's college basketball gam...
14/05/2026
The agreement marks Scripps Sports' first NBA local rights deal...
14/05/2026
A new report from education-technology company Wiingy testing post-ChatGPT predictions against three years of real-world data has identified broadcasting as one...
14/05/2026
Global Citizen and FIFA have announced that Madonna, Shakira, and BTS will headl...
14/05/2026
LOS ANGELES, CA, May 14, 2026 - The nonprofit Sundance Institute announced today the cohort selected for the 2026 Episodic Lab program, taking place at Dunaway ...
14/05/2026
At Spotify, we're focused on making every listening experience feel intentio...
14/05/2026
Spotify recently welcomed songwriters, artists, executives, and music students t...
14/05/2026
New articulations, ostinatos, Motion Scoring Articulation Sets & more
Sonuscore's flagship cinematic string library has just been treated to a significa...
14/05/2026
World-class studio opens on T rkiye's Aegean coast
P r Recording & Residence have announced their official opening, introducing a new world-class reside...
14/05/2026
Now supports channel layouts up to 9.1.6
Nugen Audio have just released an update for their AI-powered dialogue intelligibility and compliance tool. Set to ...
14/05/2026
New recordings & one-key chord tool
UVI have just announced the release of Orchestral Suite 2, a ground-up redesign of their all-in-one symphonic orchestra ...
14/05/2026
Two new arrivals & expanded factory content
Rob Papen's all-encompassing plug-in and virtual instrument collection has just been treated to another upda...
14/05/2026
Embed QR codes into DAW sessions
FSK Audio's latest plug-in doesn't process audio, but serves as an organisational tool that allows QR codes to be e...
14/05/2026
SBS Board appoints Jane Palfreyman Managing Director
13 May, 2026
Media releases
The Special Broadcasting Service (SBS) Board of Directors is pleased to an...
14/05/2026
Transforming bold ideas into market-ready productions: Digital Originals returns
14 May, 2026
Media releases
SBS, NITV and Screen Australia have announced ...
14/05/2026
Australia Uncovered Returns to SBS with Bold New Season Featuring John Safran on...
14/05/2026
Rohde & Schwarz transforms spectrum complexity into situational awareness and ef...
14/05/2026
Rohde & Schwarz and Quantum Systems join forces to redefine EW and C-UAS-enabled...
14/05/2026
Rohde & Schwarz showcases STANAG aligned ARDRONIS Counter UAS capability at NATO...
14/05/2026
Code of Silence has won the BAFTA for Best Drama Series at Sunday night's ceremony at the Royal Festival Hall.
The series, starring Rose Ayling-Ellis and w...
14/05/2026
Soldiers equipped with Falcon IV radios will soon gain a sense-and-protect capa...
14/05/2026
Artists concept of the L3Harris Next Gen RTG in flight configuration, designed to provide 250 watts of reliable power for decades-long missions in deep space....
14/05/2026
Vivid Broadcast was embracing remote production long before it became the industry norm. Now, with Calrec's True Control 2.0-enabled Argo M and Type R conso...
14/05/2026
Car ad spend rises sharply in March as more auto buyers turn to electric, hybrid...
14/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
14/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
14/05/2026
CueScript's CueiT 4.0 Wins Future's Best of Show Award, Presented at 2026 NAB Show by TV Tech
CueScript, a leading international developer of professio...
14/05/2026
Expert-Led Education Sessions and Development of Online Training Program Accelerate IPMX Adoption and Deployment
The Alliance for IP Media Solutions (AIMS) to...
14/05/2026
Klvr is launching in the United States with a professional-grade rechargeable battery solution that cuts costs and improves performance across live entertainmen...
14/05/2026
Shooting into the depths of Bedlam with URSA Cine 17K 65
Brie Clayton May 14, 2026
0 Comments
Indie feature film paired digital 65mm capture with a Bl...
14/05/2026
WeMakeColor expands with Baselight, becoming hybrid color facility
Caroline Shawley May 14, 2026
0 Comments
Boutique Mexican-based studio integrates B...
14/05/2026
Berklee's Summer in the City Returns with Free Concerts Throughout Boston Ar...
14/05/2026
Chelsey Green Named to Billboard's 2026 Women in Music List The Berklee professor and chair of the Recording Academy Board of Trustees joins other high-pr...