
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 ...
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...
01/05/2026
January 5 2026, 18:30 (PST) NBCUniversal's Peacock to Be First Streamer to ...
01/04/2026
January 4 2026, 18:00 (PST) DOLBY AND DOUYIN EMPOWER THE NEXT GENERATON OF CREATORS WITH DOLBY VISION
Douyin Users Can Now Create And Share Videos With Stun...
04/02/2026
The National Film and Video Foundation (NFVF) invites final-year animation students to participate in an exclusive creative showcase at the Annecy International...
04/02/2026
Viper Shield's robust phase of flight-testing production representative hard...
04/02/2026
Pilot To Launch with Super Bowl LX on February 8 and Continue with High Profile Live Events, Entertainment and Sports
Nielsen to Use State of the Art Wearable...
04/02/2026
New control solution applies broadcast robotics workflows to PTZ cameras with third-party integration and upgrade paths
Vinten, a global leader in robotic cam...
04/02/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
04/02/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
04/02/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
04/02/2026
Katie Vitolins Announced as Vice President of Alumni Products and Services An alumna and former trustee, Vitolins will lead the relaunch of Berklee's alum...
04/02/2026
Rohde & Schwarz powers next generation television in Brazil with DTV technology...
04/02/2026
Back to All News
Netflix Shares Teaser of the Third and Final Season of Knokke Off
Entertainment
04 February 2026
GlobalNetherlands
Link copied to clipboar...
04/02/2026
Back to All News
Netflix Premieres The TikTok Killer on March 6
Entertainment
04 February 2026
GlobalSpain
Link copied to clipboard
Download the pictures
...
04/02/2026
Back to All News
Music Is Having a Golden Moment on Netflix as New and Nostal...
04/02/2026
Fox Corporation Reports Second Quarter Fiscal 2026 Financial Results NEW YORK, NY, February 4, 2026 - Fox Corporation (Nasdaq: FOXA, FOX; FOX or the Compan...
04/02/2026
Lucas P. Arag n Joins FOX Advertising as Senior Vice President, Creative New York, NY - February 4, 2026 - Accomplished Creative Executive Lucas P. Arag n has...
04/02/2026
Following the passing of our friend and colleague Hugh Wallace, and with the full support of his family, RT will proceed with the broadcast of the new series o...
04/02/2026
Editor's note: This post is part of the Nemotron Labs blog series, which exp...
03/02/2026
Tagboard, a modern, interactive graphics system for news, sports, and entertainm...
03/02/2026
Studio Network Solutions (SNS) announces the launch of Trio, a new S3-compatible cloud storage service fully integrated with EVO for media backup, archival, and...
03/02/2026
50 Production Trucks at center of 160 U.S.-based productions...
03/02/2026
Nielsen, which specializes in audience measurement, data, and media intelligence, announces that it is piloting a new methodology enhancement to more accurately...
03/02/2026
Appear's X Platform will be used by NBC Sports to deliver video compression, satellite modulation and transport stream aggregation for its production of the...
03/02/2026
Behind The Mic provides a roundup of recent news regarding on-air talent, includ...
03/02/2026
NHL Network announces its comprehensive programming schedule for the upcoming Winter Olympic Games, underscoring the highly anticipated return of NHL players to...
03/02/2026
NBC Sports has chosen Canon to deliver 115 Canon UHD broadcast lenses for its production of the 2026 Winter Olympics and Paralympics. Canon will also send suppo...
03/02/2026
Audio-Technica equipment will be used by NBC Sports to deliver much of its audio capture requirements across all sporting venues for its production of the 2026 ...
03/02/2026
NBC Sports will use Cisco to deliver AI networking technology for its all-IP production of the 2026 Winter Olympics and Paralympics, including the deployment of...
03/02/2026
NBC Sports will utilize Chyron PRIME CG to produce live broadcast graphics to display names, athlete information, scores, statistics, leaderboards, headshots an...
03/02/2026
NBC Sports will utilize Grass Valley to deliver advanced signal conversion, rout...
03/02/2026
NBC Sports will utilize Planar to deliver leading-edge fine pixel pitch LED video wall technology for its production of the 2026 Winter Olympics and Paralympics...
03/02/2026
Taking place in two venues, the 2026 production celebrates the 150th Anniversary of the Super Bowl of Dogs'
When the Westminster Kennel Club Dog Show conc...
03/02/2026
For the indoor production, NEP Specialty Capture has mounted a 100-ft. overhead ...
03/02/2026
MTVG Edge, the production-services supplier's software-based production solu...
03/02/2026
In the league's second year, new partnerships enhance broadcast quality for ...
03/02/2026
Rocket Surgery will showcase the combined creative strength of Ross Video, with ...
03/02/2026
NBC Sports will utilize Sony Electronics to deliver imaging, monitoring, and tec...
03/02/2026
SMT will provide TVI (broadcast television interface) support services for figur...
03/02/2026
Spotify's annual Best New Artist celebration returned to Los Angeles last ni...
03/02/2026
The smash-hit series The Hospital: In the Deep End returns to shine a spotlight ...
03/02/2026
FoMa Antares: Redefining Camera Stabilization for Modern ProductionsIn high-end broadcast and cinematic environments, precision, reliability, and flexibility ar...
03/02/2026
Viper Shield's robust phase of flight-testing production representative hard...
03/02/2026
Countries throughout the Indo-Pacific have made the ability to defend their people and sovereign borders a top priority, but no single nation can monitor every ...
03/02/2026
U.S. Marine loads a round in an 81 mm mortar system during an exercise. (Credit: U.S. Marines)...
03/02/2026
9905MPx Card features unprecedented level of density with four independent signa...
03/02/2026
Champaign, IL - November 15, 2021 - Cobalt Digital, announced today that three of its products have received 2021 NAB Show Product of the Year Awards. Cobalt, ...
03/02/2026
Cobalt is pleased to confirm that Log4j vulnerability does NOT affect ANY Cobalt products including the HPF-9000 frame.
Given the recent concerns regarding wi...
03/02/2026
Software-based embedding and de-embedding solution will be highlighted at NAB 20...