
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
13/12/2025
Powering Client Growth: Horizon Deepens Nielsen Partnership, Enabling More Effic...
13/12/2025
In a move that will help it offer more flexible and less costly programming options, YouTube TV has announced that it will be launching YouTube TV Plans with mo...
13/12/2025
SINGAPORE Magna Systems has designed, built and completed what is believed to be the first full UHD and IP-based OB truck in Southeast Asia for a Singapore medi...
12/12/2025
SVG Summit 2025 Preview: Everything You Need to Know for Next Week's Big Sho...
12/12/2025
Hailey Gates at the Atropia premiere (photo by George Pimentel / Shutterstock for Sundance Film Festival)...
12/12/2025
Last month, Spotify announced a new collaboration with the ATP Tour, the global governing body of men's professional tennis, aimed at bringing the next gene...
12/12/2025
CONWAY, Ark. In a notable example of how the elimination of Federal federal funding is forcing public stations to make massive cuts and changes in the way they...
12/12/2025
Wisycom and DPA Microphones announce the appointment of Ren Moerch as Group Product Director, Wireless, a strategic leadership role that will guide the combine...
12/12/2025
SMPTE , the home of media professionals, technologists, and engineers, in conjuncture with the European Broadcasting Union (EBU) and the Entertainment Technolog...
12/12/2025
Keepit, the vendor-independent, cloud-native data protection provider, today announced a strategic go-to-market relationship in Poland with Ingram Micro, a lead...
12/12/2025
Atomos announced the immediate availability of a new firmware update for its Ninja TX GO and Ninja TX monitor-recorders, unlocking Open Gate 48P RAW recording w...
12/12/2025
Professional Wireless Systems (PWS) once again played a critical role in delivering flawless wireless coordination and support at the 2025 Latin Grammy Awards a...
12/12/2025
The Alliance for IP Media Solutions (AIMS), together with the Video Services Forum (VSF), the Advanced Media Workflow Association (AMWA) and the European Broadc...
12/12/2025
DHD audio will demonstrate the latest additions to its range of digital audio production solutions on Booth 321 in Hall B6 at Hamburg Open 2026. The show will b...
12/12/2025
Chaos today announces the release of V-Ray for Blender, update 2, bringing its award-winning rendering technology to even more Blender users by adding support f...
12/12/2025
Lighting specialist UltraLEDs has launched Precision LED Tape, a high-CRI lighting solution designed specifically for professional film, TV, and studio use.
P...
12/12/2025
Zixi, the Emmy Award-winning leader in live broadcast-quality video over IP, today announced that Roi Sasson has joined the company as Vice President, Engineer...
12/12/2025
BitFire (bitfire.tv), the leader in software-defined live production and IP transmission, today announced a strategic partnership with Appear, a leader in high-...
12/12/2025
LOS ANGELES The Hollywood Professional Association (HPA) today said futurist Robert Tercek, creative technologist Jessie Hughes from Leonardo.AI and Emmy-winnin...
12/12/2025
HUDSON, Mass. BitFire and Appear have struck a strategic partnership aimed at offering broadcasters, sports leagues and streaming platforms a faster, more flexi...
12/12/2025
The broadcast industry is evolving faster than ever. #IPWorkflows #remoteproduction, and next-gen audio systems are reshaping how teams design, deliver, and sca...
12/12/2025
LOS ANGELES The payroll and production accounting platform Wrapbook has announced the acquisition of Cinapse, a modern scheduling platform for film and televisi...
12/12/2025
DEHLI Ross Video has announced that it is expanding and restructuring its commercial and technical teams in the South Asian Association for Regional Cooperation...
12/12/2025
LONDON Following the success of its UK launch in January 2025, Rise AV, the global not-for-profit initiative dedicated to supporting and advancing women in the ...
12/12/2025
SAN FRANCISCO Ad-supported streaming service Tubi next week will launch Matter Casting, a new casting standard that will enable seamless mobile-to-TV viewing di...
12/12/2025
LOS ANGELES The Hollywood Professional Association (HPA) today said futurist Robert Tercek, creative technologist Jessie Hughes from Leonardo.AI and Emmy-winnin...
12/12/2025
Friday 12 December 2025
Ted is back! Seth MacFarlane's live-action comedic ...
12/12/2025
In Las Vegas's T-Mobile Arena, fans of the Golden Knights are getting more than just hockey - they're getting a taste of the future. ADAM, a robot devel...
12/12/2025
Uachtar n na h ireann, Catherine Connolly visited RT Raidi na Gaeltachta's...
12/12/2025
Ireland AM host Eric Roberts has been revealed as the sixth contestant taking to...
12/12/2025
Scripps Research team pioneers an efficient way to stereoselectively add fluorine to drug-like molecules A new method uses a novel catalyst and inexpensive fluo...
11/12/2025
Thomson and the Center for News, Technology and Innovation (CNTI) convened a two-day workshop in Sarajevo bringing together more than 35 journalists, editors, p...
11/12/2025
ESPN's Aims for Spectacular With Heisman Trophy ShowEvent firsts include 1080p HDR production airing on both national broadcast and cableBy Dan Daley, Audio...
11/12/2025
SVG Students To Watch: Frankie Patton, University of ColoradoThe 2025 grad is hitting the ground running as a PA on national broadcastsBy Brandon Costa, Directo...
11/12/2025
SVG Summit 2025 Technology Exhibits Preview, Part 3By SVG Staff
Thursday, December 11, 2025 - 7:24 am
Print This Story | Subscribe
Story Highlights
The 2...
11/12/2025
SVG Sit-Down: What Makes Gen Z, X, and Y Fans Tick? Dave Gavant of WSC Sports Go...
11/12/2025
SVG Summit 2025 Preview: 5G, MXL, Spectrum Loss, and Outerspace on Tap for Tues...
11/12/2025
2025 Sports Broadcasting Hall of Fame: David Levy, Turner Titan and Master of Al...
11/12/2025
SVG Launches Follow the Money' Podcast: Go Inside the Sports Media Biz with...
11/12/2025
A Deep Dive Inside Game Creek Video's Bird and Magic Mobile Units, Home to A...
11/12/2025
How Sound Effects for Monsters Funday Football' Emulated the Sonic Soul of ...
11/12/2025
SVG New Sponsor Spotlight: CSP Mobile Productions' Len Chase on Upgrading Tr...
11/12/2025
Having the right song soundtrack your moves can make all the difference when gam...
11/12/2025
It's been a big year for Taylor Swift. Her highly anticipated album The Life...
11/12/2025
New satellites for the SDA Tranche 1 Tracking program in production at L3Harris&...
11/12/2025
The Meadowlands system, a compact and mobile version of the CCS, uses ground-based radio frequency units to disrupt satellite communications....
11/12/2025
The L3Harris demonstration united tactical communications devices, counter-UAS c...
11/12/2025
Throughout 2025, L3Harris delivered innovative solutions to U.S. and allied warfighters across every domain.
With an unrelenting commitment to excellence, our...
11/12/2025
A Majority of the World's Population (51%) Identify As Soccer Fans
The 2025 MLB postseason notched 58.2 billion viewing minutes, up +24% from the prior y...
11/12/2025
WALTHAM, Mass. Video-over-IP software provider Zixi said Roi Sasson has joined the company as vice president, engineering....