
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 ...
09/10/2026
September 10 2026, 06:00 (PDT) Dolby Expands Dolby OptiView Platform with New Capabilities at IBC 2026
New Sports Intelligence helps providers better unders...
07/10/2026
Dalet, a leading technology and service provider for media-rich organizations, today announced the latest Long-Term Supported (LTS) release of Dalet Flex. Build...
18/09/2026
The inside scoop on attention-grabbing market assets from those in the know 17 September 2026
(L-R): Sophie Green, Todd Brown and Edwina Waddy
Find this episo...
17/09/2026
Lions vs. Bills will also be the first regular-season game at new Highmark Stadi...
17/09/2026
Teradek has announced Bolt 7, a wireless video and data system that adds an integrated 900MHz radio to the Bolt's zero-delay video pipeline. The 900MHz chan...
17/09/2026
DAZN has announced three appointments to its executive leadership team, all reporting to CEO Shay Segev effective immediately.
Patrick Delany has been appointe...
17/09/2026
Monumental Sports and Entertainment (MSE) has announced a leadership restructuring. Zach Leonsis has been named President and Vice Chairman, a newly created pos...
17/09/2026
CP Communications has been named Best of Florida for Audio-Visual Services, and its subsidiary Red House Streaming has been named Best Movie and Recording Studi...
17/09/2026
Scripps Sports and ION have announced a broadcast partnership for the Shriners Children's East-West Bowl, the nation's oldest college all-star football ...
17/09/2026
The 17th annual espnW: Women + Sports Summit, presented by Toyota, will take place October 14-16 at the Ojai Valley Inn in Ojai, California, with virtual attend...
17/09/2026
The Professional Audio Manufacturers Alliance (PAMA) and Shure Incorporated have...
17/09/2026
Lithuanian broadcaster LNK Group has completed a migration of playout and media management for its five national television networks - LNK, BTV, TV1, InfoTV, an...
17/09/2026
Net Insight has announced a pan-Asian live media network created with its regional partners, giving broadcasters, production companies, and media service provid...
17/09/2026
After a high school football injury, the Orlando native found a new path in video production, gaining experience on ESPN college football broadcasts, Tampa Bay ...
17/09/2026
Popular DAW gains free pitch-correction tool
Image-Line have teamed up with Antares to kit their popular DAW software out with a built-in pitch-correction p...
17/09/2026
Promises unprecedented realism, dynamic nuance and clarity
Gibson have teamed up with acoustic pickup experts Baggs, creating a next-generation' pickup...
17/09/2026
Two new libraries join percussion line-up
VSL (Vienna Symphonic Library) have just launched two new libraries that bring some intriguing new instruments int...
17/09/2026
Hardware & plug-in versions gain new features
Arturia have just released a free update that brings some significant new features to their MiniFreak synthesi...
17/09/2026
Respected journalist Catalina Fl rez to succeed Anton Enus as SBS World News pre...
17/09/2026
The Department of Sport, Arts and Culture (DSAC), in partnership with the Nation...
17/09/2026
Calrec brings leading audio solutions and long-term business value to IBC 2026 We're looking forward to meeting up with you all on 11-14th September in Amst...
17/09/2026
Streaming Content Ratings (SCR) Data Shifts to Daily Delivery Cadence, Mirroring...
17/09/2026
August brought further stabilization in total TV viewing time. Poles spent an average of 3 hours and 31 minutes a day watching video content on TV glass-just 2 ...
17/09/2026
Post-sports seasonal shift redistributes viewership across Poland, while streami...
17/09/2026
Television Content Analytics Pte Ltd (TVC), a Singapore-based deep-tech company specialising in sports technology, artificial intelligence and live broadcast in...
17/09/2026
Rise WIB, the global advocacy group championing gender diversity and career progression across the media technology industry, today announced the shortlist for ...
17/09/2026
RALEIGH, N.C. - Capitol Broadcasting Company (CBC) and Hurricanes Holdings annou...
17/09/2026
Lithuanian broadcaster deploys Playout X and Framelight X across five networks, combining on-premises software-defined playout with cloud-based disaster recover...
17/09/2026
Introducing Adobe Photoshop Elements & Premiere Elements 2027
Brie Clayton September 17, 2026
0 Comments
New tools make it easier than ever to enhance y...
17/09/2026
LA JOLLA, CA-While the brain orchestrates metabolic processes in the body, it al...
17/09/2026
New series of Aistear an Amhr in shares extraordinary stories behind Ireland'...
17/09/2026
The Late Late Show is back!
Liam Neeson, Siobh n McSweeney, Caitr ona Balfe a...
17/09/2026
The Neighbours Effect: Gen Z Brings Back Big Hair, Double Denim and 80s soap sty...
17/09/2026
The bold, new legal drama starring Dominic West and Sienna Miller launches on Sky and NOW on 2nd OctThursday 17 September 2026
Official trailer released for Sk...
17/09/2026
Every week we read headlines about new threats from AI. From taking over jobs to disrupting critical infrastructure, spreading misinformation or even destroying...
17/09/2026
Arqiva selected by SANZAAR to deliver global distribution of 2026 international ...
17/09/2026
CULVER CITY, CALIFORNIA This evening at the 78th Primetime Emmy Awards, Apple TV...
17/09/2026
A new creature-catching adventure is ready to stream from the cloud this week. Pawprint Studio's Aniimo arrives on GeForce NOW at launch, inviting gamers to...
17/09/2026
RT Statement:
RT is today confirming that its position regarding participation in the Eurovision Song Contest remains unchanged. RT will not participate in...
16/09/2026
Grass Valley has been recognized with a 2026 Technology & Engineering Emmy Award...
16/09/2026
Sports-media leaders explore how cloud, AI, and virtualization are transforming ...
16/09/2026
With a full crew on site in Springfield, deep access to players, and a growing d...
16/09/2026
John Wilson attends The History of Concrete premiere during the 2026 Sundance Film Festival at The Yarrow Theatre on January 22, 2026, in Park City, Utah. (Ph...
16/09/2026
Powerful soft synth receives free update
Wavea have just launched a new and improved version of their feature-packed soft synth, kitting it out with over 20...
16/09/2026
Physical-modelling experts launch pipe-based instrument
Modartt are well known for their impressive Pianoteq and Organteq offerings, and now, they've pu...
16/09/2026
Popular DAW gains free pitch-correction tool
Image-Line have teamed up with Antares to kit their popular DAW software out with a built-in pitch-correction p...
16/09/2026
Microwave Factory and Rohde & Schwarz enable automated SAR measurements with CMX...
16/09/2026
Rohde & Schwarz launches new security scanner for large events at Security Expo ...
16/09/2026
The National Film and Video Foundation (NFVF) invites eligible South African pro...