
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, ...
10/12/2025
Sound-Alike Commercials Are Part of Sports' Soundtrack Johnny Cash for Coca-Cola is the latest in a long litany of sonic approximationsBy Dan Daley, Audio ...
10/12/2025
Immersive Sound Is Logical Next Step for Sports VenuesSound-systems suppliers are sanguine, but the market has its challengesBy Dan Daley, Audio Editor
Wednes...
10/12/2025
The Romans Built Arenas for Immersive Sound 2,000 Years AgoThe historic Arena of Nimes in France is still in use todayBy Dan Daley, Audio Editor
Wednesday, De...
10/12/2025
SVG Summit 2025 Preview: Audio Workshop Hits on Immersive, Virtualized, and Next...
10/12/2025
SVG Summit 2025 Technology Exhibits Preview: Audio SpotlightBy SVG Staff
Wednesday, December 10, 2025 - 8:21 am
Print This Story | Subscribe
Story Highlig...
10/12/2025
SVG Europe Audio: Listening to the sounds of powder and ice at Milano Cortina wi...
10/12/2025
Advancements in audio technology: Capturing the atmosphere of live sports By David Davies
Tuesday, November 25, 2025 - 09:27
Print This Story
Although wor...
10/12/2025
Everything smelled of popcorn: The art of bringing the complex sound of esports ...
10/12/2025
Top L-R: Ha-Chan, Shake Your Booty!, Hanging by a Wire, Broken English, Buddy
C...
10/12/2025
For the first time, Spotify is giving users the power to steer the algorithm. Gustav S derstr m, Spotify's Co-President, CPO, and CTO, shares the vision beh...
10/12/2025
L3Harris' new contract for Guided Multiple Launch Rocket System Insensitive ...
10/12/2025
L3Harris Meadowlands system has been designed with an open architecture software system that allows for more flexible and efficient software updates. This capab...
10/12/2025
During this interval, streaming comprised the majority of ad supported TV (46.4%...
10/12/2025
NEWPORT BEACH, Calif. Bitcentral, a provider of production, asset management, playout and streaming workflow solutions, has named technology veteran Rick Arnold...
10/12/2025
TV Tech is delighted to reveal the winners of the 2025 Media & Entertainment: Best in Market Awards....
10/12/2025
BOTHELL, Wash. The Alliance for IP Media Solutions (AIMS), the Video Services Forum (VSF), the Advanced Media Workflow Association (AMWA) and the European Broad...
10/12/2025
In a notable example of how pay TV operators are integrating streaming services into their lineup and using those services to retain or attract subscribers, Dir...
10/12/2025
Today, Chaos builds instant feedback into the viewport, connecting Maya and Houdini to Chaos Vantage's real-time path tracer. Artists can now assess 3D asse...
10/12/2025
Smeup, a key partner for companies engaged in digital transformation, today announced the expansion of its adoption of Cubbit, the first geo-distributed cloud s...
10/12/2025
Mediagenix, a global leader in smart content solutions to profitably connect the right content to the right audience, today announced two significant milestones...
10/12/2025
BEAVERTON, Ore. HDR10+ Technologies, LLC has announced that they will soon begin the licensing and certification of devices, content, and services that support ...
10/12/2025
SMPTE has joined forces with the European Broadcasting Union (EBU) and Entertainment Technology Center (ETC) to publish an updated report on AI and its impact o...
10/12/2025
Clear-Com is pleased to announce the appointment of Kris Koch as Director of Sales - North & South America. In this expanded leadership role, Kris will oversee...
10/12/2025
Mavis today announced the latest version of Mavis Camera (v7.4), a major update to its professional iOS camera app, headlined by the launch of Film Kit - an opt...
10/12/2025
Creamsource, renowned for its Vortex series of cinematic lighting, is laying the groundwork for its next phase of growth with the addition of Markus Zeiler as G...
10/12/2025
Digital Alert Systems, a global leader in emergency communications solutions for media providers, today announced that the DAS3-DC-PS, a new DC power supply opt...
10/12/2025
Riedel Communications today announced it has formed a strategic partnership with Racing Electronics, a premier provider of motorsport communication equipment in...
10/12/2025
#GALSNGEAR is launching two signature leadership retreats in early 2026, designed to equip women in media, entertainment, and technology with the tools to lead...
10/12/2025
Providing worldwide customers with total confidence through transparent, all-inclusive pricing
CVP, one of Europe's leading suppliers of professional video...
10/12/2025
With the Federal Communications Commission working on new rules for the deployment of NextGen TV, next year promises to be an important one for both the future ...
10/12/2025
DENVER Tom Rutledge, director emeritus and former president and CEO of Charter Communications, will be honored with the 2026 Bresnan Ethics in Business Award by...
10/12/2025
NEW YORK Novocap's Cadent has acquired VuePlanner, a YouTube video ad planning, optimization, and measurement company in a deal that will help Cadent expand...
10/12/2025
In preparation for the madness of March, here are some important reminders for scheduling back-to-back Special Playlists.
The first Special Playlist MUST end b...
10/12/2025
10 Dec 2025
VEON's Rising Capital Markets Profile Strengthened by Inclusion...
10/12/2025
10 Dec 2025
VEON Recognized for JazzCash, Kyivstar and Jazz at the World Commun...
10/12/2025
December 10th, 2025
TRIBECA FILMS TO RELEASE THE INDEPENDENT DOCUMENTARY FILM...
10/12/2025
Wednesday 10 December 2025
Sky extends partnership with the Ladies European Tour for a landmark 30th year
Sky and the Ladies European Tour (LET) have announce...
10/12/2025
Wednesday 10 December 2025
Walk-on if you love the darts: James Maddison, Luke ...
10/12/2025
Rohde & Schwarz presents world's first RF power sensor with 0.80 mm RF conne...
10/12/2025
Back to All News
2026 Starts With a Swoon: Kim Seon-ho and Go Youn-jung Lead C...
10/12/2025
Back to All News
Berlin and the Lady with an Ermine Arrives to Netflix on May 15
Entertainment
10 December 2025
GlobalSpain
Link copied to clipboard
THE N...
10/12/2025
It's out of the frying pan and into the sequins for comedian and actor Micha...
10/12/2025
Born That Way airs Thursday 18 December on RT One and RT Player
Born That ...
09/12/2025
2025 Sports Broadcasting Hall of Fame: Pam Oliver, Sideline Icon Who Redefined t...
09/12/2025
SVG Summit 2025 Technology Exhibits Preview, Part 2By Jason Dachman, Editorial Director, U.S.
Tuesday, December 9, 2025 - 7:17 am
Print This Story | Subscr...
09/12/2025
SVG Summit 2025 Preview: Cloud Production Workshop Spotlights Live and Non-Live ...
09/12/2025
Next-generation content protection: Multi-technology security is integral to com...
09/12/2025
CBS Sports Provides One-of-a-Kind Production' for UEFA Champions League Cro...
09/12/2025
Spanish Professional Basketball League Relies on NETGEAR AV, MAM Tech for Seamle...