
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
11/12/2025
Dalet, a leading provider of cloud-native, end-to-end media workflow solutions, ...
03/12/2025
ToolsOnAir Composition Builder 2025 Boilerplate
More Details: The Composition Builder 2025 application for macOS enables TV stations and Live Event broadcast...
03/12/2025
ToolsOnAr just:live pro 2025 Boilerplate
More Details: just:live pro 2025 is a Single Channel Live Production Playout solution for video and static or real-t...
03/12/2025
ToolsOnAr just:play pro 2025 Boilerplate
More Details: just:play pro 2025 is a Single Channel automated 24/7 Master Control playout solution with SD, HD and ...
03/12/2025
ToolsOnAr live:cut 2025 Boilerplate
More Details: live:cut is an option to just:in mac pro 2025 and enables multicamera production workflows for up to 16 cam...
03/12/2025
ToolsOnAir Just In Mac Lite NDI 2025 Boilerplate
More Details: The Just In Mac Lite NDI application is a streamlined media capture solution designed specific...
03/12/2025
ToolsOnAir Just In Mac Lite 2025 Boilerplate
More Details: The Just In Mac Lite application is a streamlined media capture solution designed specifically for...
03/12/2025
ToolsOnAir just:in mac pro 2025 Boilerplate
More Details: just:in mac pro is a macOS-based client-server multichannel capture solution to record SDI, HDMI, N...
03/12/2025
Tracy Bonareri Onchoke, Thomson's Young Journalist of the year 2025 is hoping the accolade will be a springboard to more cross-border collaboration between ...
03/12/2025
MLS Cup 2025 Production To Feature Four iPhone 17 Pros as Game-Coverage CamerasStay tuned to SVG on Friday for our in-depth story on this year's MLS Cup pro...
03/12/2025
SVG LIVE! 2025: All Sessions Now Available to Watch on SVG PLAYThe inaugural event placed a spotlight on the exciting world of live entertainmentBy SVG Staff
...
03/12/2025
(L-R) Peter Scriver and Seth Scriver introduce their documentary Endless Cookie for its premiere at the Egyptian Theatre in Park City. (Photo by Andrew H. Wa...
03/12/2025
For the fourth time, Bad Bunny is the most-streamed Wrapped artist on Spotify gl...
03/12/2025
The wait is over. It's time to look back at the audio that defined your year with 2025 Spotify Wrapped, our annual celebration for fans, artists, creators, ...
03/12/2025
Por cuarta vez, Bad Bunny es el Top Artista Global de Wrapped en Spotify, con 19...
03/12/2025
Spotify Wrapped is back, and as always, it's powered by the billions of streams that fans around the world delivered throughout the year. From the artists w...
03/12/2025
Spotify Wrapped is the moment when hundreds of millions of fans around the world...
03/12/2025
With more than 700 million listeners around the world turning to Spotify to soundtrack their lives, it's time to look back at the audio that defined the yea...
03/12/2025
Con m s de 700 millones de oyentes en todo el mundo usando Spotify para acompa ar su d a a d a, es momento de mirar hacia atr s y ver el audio que marc el a o....
03/12/2025
From page-turning thrillers to inspiring memoirs, audiobooks are becoming a core...
03/12/2025
Com mais de 700 milh es de ouvintes em todo o mundo recorrendo ao Spotify para embalar seu dia a dia, chega o momento de revisitar o udio que marcou o ano. Nos...
03/12/2025
Spotify Wrapped celebrates the audio that defined our year, and the annual globa...
03/12/2025
COLUMBIA, Md. Lionsgate and its TV syndicator subsidiary Debmar-Mercury have selected LTN to launch and deliver the new MovieSphereGold all-movie digital networ...
03/12/2025
VIENNA, Austria Video streaming solutions provider Bitmovin and ThinkAnalytics, a provider of AI-powered data analytics for TV, have formed a strategic partners...
03/12/2025
SAN FRANCISCO & THE COLONY, Texas Dolby Laboratories is making what it is calling a new chapter in its retail efforts as part of an agreement with NFM (Nebras...
03/12/2025
MONTREAL Grass Valley has delivered a 4K Ultra-High-Definition (UHD) outside broadcast (OB) truck to Guangdong Radio and Television (GRT), in partnership with B...
03/12/2025
Our users spoke and we listened. December's Maxon One release delivers long-awaited improvements across Cinema 4D, Redshift, ZBrush, and Red Giant.
Whether...
03/12/2025
DHD audio reports a successful 2025 with new additions to its range of broadcast-quality audio production, post-production and routing equipment.
DHD innovatio...
03/12/2025
Grass Valley recently delivered a cutting-edge 4K Ultra-High-Definition (UHD) outside broadcast (OB) truck to Guangdong Radio and Television (GRT), in partnersh...
03/12/2025
CINCINNATI GatesAir has introduced Maxiva XTK, an update to its Maxiva XTE software-defined TV exciter. XTK is a new cost-efficient model primarily developed fo...
03/12/2025
WUPPERTAL, Germany Riedel Communications is partnering with Haivision, a global provider of mission-critical, real-time video networking and visual collaboratio...
03/12/2025
WASHINGTON The Federal Communications Commission has opened a docket for comments on the proposed $6.2 billion Nexstar acquisition for Tegna and set deadlines f...
03/12/2025
MILAN, Italy Brightcove has released seven new features designed to expand global reach, improve audience engagement, enhance live-streaming quality and streaml...
03/12/2025
NEW YORK Great American Media said it plans to launch Pure Flix Familia, a dedicated Spanish-language platform, in 2026....
03/12/2025
SOUTHPORT, Conn. Main Street Sports Group has announced that the FanDuel Sports Network app is now available directly on Vizio and on smart TVs with Vizio OS. T...
03/12/2025
SAN JOSE, Calif. Harmonic has announced that Telia, the second-largest telecom operator in Norway, is modernizing its broadband network with the company's c...
03/12/2025
GREEN BAY, Wis. Sinclair said Jay Zollar, vice president and general manager of WLUK-WCWF here, will retire Dec. 31 after 26 years running the stations. Station...
03/12/2025
Wuppertal December 3, 2025
Riedel and Haivision Join Forces to Advance Wireless Video TransmissionRiedel Communications today announced a new partnership with...
03/12/2025
Back to All News
Netflix Strengthens Longstanding Commitment to Southeast Asia ...
03/12/2025
Breaking the Trend: Small Business Creation Jumps 69% as Entrepreneurs Bet Big on Growth Published on Dec 3, 2025 Categories: Data and insights
LinkedIn Co...
03/12/2025
Tell us a little bit about your job I am a Digital Marketing Executive working on Paid Social, PPC, and Organic Social. I joined the team in May 2025 and am enj...
03/12/2025
SAN JOSE, Calif. and VIENNA - Dec. 3, 2025 - Harmonic (NASDAQ: HLIT) and Normann...
03/12/2025
The top 10 most intelligent open-source models all use a mixture-of-experts arch...
03/12/2025
S an Nollaig
Celebrate 2025's top Irish sporting stars with RT Sport Awards live from RT Studios on RT One and RT Player
RT pays tribute to Ror...
02/12/2025
Case Study: How Mid-Atlantic Sports Network Moved to All-IP Distribution in 60 D...
02/12/2025
2025 Sports Broadcasting Hall of Fame: Lee Corso, Coach, Commentator, FirebrandBy Ken Kerschbaumer
Tuesday, December 2, 2025 - 7:00 am
Print This Story | S...
02/12/2025
SVG All-Stars: Dan Nabors, Senior Director, Remote Engineering, TNT SportsThe veteran tech leader is helping guide Warner Bros. Discovery's at-home' re...
02/12/2025
Epic rematch: DAZN on bringing Eubank Jr v Benn II to spectacular life with 1080...
02/12/2025
National Lacrosse League Opens Season With New Cloud-Based Official Replay-Revie...
02/12/2025
Platinum White Paper: The Cinematic Look in Live Production - Bridging Aesthetic...