
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...
03/06/2026
Berklee Alumni St. Vincent and Ruby Plume to Perform Together on St. Vincents 20...
02/06/2026
Tennis Channel has completed a transition from satellite-based distribution to a...
02/06/2026
Daktronics has announced the 2026 High School Video Summit, a two-day educational event for high school educators and student production teams, taking place Jun...
02/06/2026
Fandango will bring Telemundo's live Spanish-language coverage of the FIFA W...
02/06/2026
All Women's Sports Network (AWSN) has announced the live television schedule...
02/06/2026
Spalk, a cloud-based multilingual commentary and production platform, has announced three new partnerships: Ligue 1 (English and Portuguese highlights), Eurolea...
02/06/2026
NHL Network's 2026 Stanley Cup Final coverage began June 1 with NHL Tonight: Stanley Cup Final Media Day from the Carolina Hurricanes' Lenovo Center at ...
02/06/2026
Matrox Video has announced the Maevex MGX Series, a lineup of IPMX-ready video e...
02/06/2026
Marshall Electronics will exhibit at InfoComm 2026 (Booth C7521), showcasing a lineup of 4K and HD compact POV cameras for corporate, education, hospitality, wo...
02/06/2026
The Professional Audio Manufacturers Alliance (PAMA) and Shure Incorporated have...
02/06/2026
MultiDyne Video and Fiber Optic Systems will exhibit at InfoComm 2026 (Booth C50...
02/06/2026
Advanced Systems Group (ASG) has announced the promotion of Joe Marchitto to Western Regional CTO. In his new role, Marchitto will oversee system design across ...
02/06/2026
The NHL has announced that Brothers Osborne will headline a free outdoor concert...
02/06/2026
CP Communications has announced the appointment of its first two female executives in the company's 40-year history. Tabitha Coleman has been named Vice Pre...
02/06/2026
The Lighting Design Group (LDG) has announced the completion of Studio C at Yahoo's headquarters at 770 Broadway in Manhattan. The studio launched April 24 ...
02/06/2026
Zee Entertainment Enterprises Ltd. (Z) has announced a partnership with FIFA to broadcast FIFA World Cup 2026, FIFA World Cup 2030, FIFA Women's World Cup 2...
02/06/2026
Behind The Mic provides a roundup of recent news regarding on-air talent, including new deals, departures, and assignments compiled from press releases and repo...
02/06/2026
The department is broadcasting NCAA Baseball Super Regionals at Plainsman Park this weekend
Broadcast and production crews at Division I institutions are busy ...
02/06/2026
The initiative is extends beyond the league's arenas to team training rinks,...
02/06/2026
Olivia Wilde, Seth Rogen, Pen lope Cruz, and Edward Norton appear in The Invite by Olivia Wilde, an official selection of the 2026 Sundance Film Festival. (Co...
02/06/2026
Musically intelligent soft synth gets upgraded
Scaler Music will be probably be best known to many for their music theory tools, but their product range al...
02/06/2026
Powerful new vocal-production tool announced
Described as a vocal performance station , Klevgrand's latest plug-in combines pitch-correction with harmo...
02/06/2026
Launched alongside Go Green sale extension
McDSP have just released the latest addition to their APB line-up, DC-2 Dual Compressor, and have also announced ...
02/06/2026
Create custom tools for Ableton Live 12 Suite
Ableton have just introduced a new open JavaScript toolkit that allows anyone to create their own custom tools...
02/06/2026
Now features full H90 algorithm library
Eventide have announced the upcoming launch of the H9 Harmonizer Gen 2, a new and improved version of their hugely p...
02/06/2026
Plus UAD Half Yearly Sale now live
The latest arrival to the Universal Audio range delivers a new native pitch-correction plug-in that's capable of deli...
02/06/2026
Rohde & Schwarz to present comprehensive performance, conformance and spectrum-m...
02/06/2026
BTL Laboratory becomes Taiwan's first test house with a CTIA Certification c...
02/06/2026
blueCORE standalone processors headline solutions designed to simplify the trans...
02/06/2026
If you've kept up with this article series, you know by now where to start w...
02/06/2026
With new DSP configurations and flexible licensing options, Calrec is removing the barriers to virtualised audio, giving broadcasters the freedom to scale produ...
02/06/2026
The TV agency was one of the earliest adopters of Nielsen's local television...
02/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
02/06/2026
Grass Valley today announced that Australian News Channel (ANC), operator of Sky News Australia, has deployed Grass Valley AMPP to transform its newsroom produc...
02/06/2026
Studio Technologies, a leading manufacturer of high-quality audio, video, and fiber-optic solutions, announces its new Model 385 Mic/Intercom Beltpack. The Mode...
02/06/2026
The Riedel Group today announced the appointment of Gudrun Scharler as CEO of Riedel Networks. She succeeds Michael Martens, who has led Riedel Networks since 2...
02/06/2026
More signals, higher quality, and outstanding ingest and streaming flexibility deliver professional results in a small, all-in-one footprint...
02/06/2026
farmerswife will be featured on the Modena Media & Entertainment stand at this year's Mediatech Africa 2026, giving visitors an opportunity to explore the l...
02/06/2026
PTZOptics will showcase a new generation of intelligent video workflows at InfoComm 2026, June 17 19, Las Vegas. Visitors to booth N8227 will see how PTZOptics ...
02/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
02/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
02/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
02/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
02/06/2026
02 Jun 2026
VEON Closes USD 1.4 Billion Bond Offering, Refinancing 2027 Notes A...
02/06/2026
Praise for series three:
The Times - sun-dappled pleasure
The Daily Mail - The Homes Counties' Charlie's Angels
The Sun - 4* this [is an] enjoya...
02/06/2026
Wuppertal June 2, 2026
Gudrun Scharler Appointed CEO of Riedel Networks The Riedel Group today announced the appointment of Gudrun Scharler as CEO of Riedel N...
02/06/2026
Back to All News
Discover Your Next Book-to-Screen Obsession With Our New Dedicated Hub
Product
02 June 2026
Global
Link copied to clipboard
Dear most vor...