
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 ...
12/11/2026
Industry leaders examine how Dynamic Media Facility, Media eXchange Layer, and c...
12/11/2026
The junior Tar Heel is embracing the technical and creative challenges of live production while emerging as a leader and mentor in the control room...
12/11/2026
Gracenote, Nielsen's content intelligence business, has released its fifth a...
12/11/2026
RTL Deutschland will bring the NHL to free-to-air TV in Germany starting Nov. 30...
12/11/2026
Clear-Com supported On Air 2026, a 24-hour student-led broadcast connecting 45 u...
12/11/2026
uniqFEED has opened a Remote Operations Center (ROC) in Madrid, Spain. It is already operational, delivering virtual advertising for LaLiga matches. The ROC is ...
12/11/2026
Disney, ESPN and the NBA will present Dunk the Halls, the third real-time animated NBA game using Sony's Beyond Sports data visualization technology, on Chr...
12/11/2026
Van Wagner has launched Van Wagner RELAY, a digital platform for official athlet...
12/11/2026
Deal brings together two of the industry's most established graphics brands and significantly expands Vizrt's footprint in U.S. sports and regional broa...
12/11/2026
Euro TV Production GmbH of Austria has upgraded its outside broadcast vehicle with Lawo technology. The mc 36 Classic console in service since 2019 was replaced...
12/11/2026
Tagboard has launched Spark Resize, an AI-assisted tool now in beta that takes an existing graphic and produces a new version for a different aspect ratio or sc...
12/11/2026
Ben Winston, Glenn Weiss, and FIFA's Jenni-Lee Van Gelder headlined a day fo...
12/11/2026
Free interactive platform visualizes team tendencies, formations, and schemes, updated weekly...
12/11/2026
Sports Broadcasting Hall of Famer Charlie Jablonski's broadcasting career is...
12/11/2026
Blend between concert grand & vintage electric pianos
UVI's latest release combines a concert grand with a vintage electric piano in a single instrument...
12/11/2026
Native version of popular effects plug-in arrives
Many of the plug-ins that used to require Universal Audios Apollo interfaces or DSP accelerators have made...
12/11/2026
Four next-generation interfaces announced
Following on from the release of their new flagship Thunderbolt interfaces, Audient have refreshed the design of t...
12/11/2026
Rohde & Schwarz and Connektica showcase automated RF test systems for satellite ...
12/11/2026
Gracenote's 2026 State of Play report signals a rising retention risk: More ...
12/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
12/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
12/11/2026
Broadpeak and Magnite enable advertising on Afree TV to unlock new revenue opportunities for African content providers
Broadsmart, a technology integrator deli...
12/11/2026
PlayBox Neo is perceived in the industry as an innovator way ahead of its time, already making a profound impact in the Asia-Pacific region, where the company i...
12/11/2026
This agreement marks the next step in a multi-year digital transformation programme as distribution expands across more clients and markets, requiring reliable ...
12/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
12/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
12/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
12/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
12/11/2026
LA JOLLA, CA-Central to many immune responses are antibodies, which identify foreign substances and help remove them from the body. The immune cells that produc...
12/11/2026
Bill & Ted Rock Opera Taken to New Heights After Student Workshop Emerging artists from Berklee, Boston Conservatory, and Emerson collaborated with industry p...
12/11/2026
The Hollywood Professional Association (HPA) today announced the theme and program focus for the 2027 HPA Tech Retreat, taking place Feb. 14-18, 2027 in La Quin...
12/11/2026
An island in rural MontanaJeremiah Slovarp owns Jereco in Bozeman, Montana, and teaches music technology and recording arts at Montana State University. He star...
12/11/2026
Who am I and whats an AI GP? Im Kathryn Hodgkinson, and Ive recently qualified as an Artificial Intelligence Governance Professional (AIGP), a certification awa...
12/11/2026
RT will provide extensive coverage of the European Political Community Summit in Dublin across television, radio and online on Thursday, 12 November 2026. As p...
11/11/2026
Hornets Sports & Entertainment (HSE) and Spectrum have installed WiFi 7 as part of Spectrum's Managed WiFi solution within Charlotte's recently renovate...
11/11/2026
As 4K displays normalize in living rooms and economy flights, aging minor league...
11/11/2026
Northwestern University has deployed Grass Valley production switching and camera technology at its new Ryan Field stadium in Evanston, Illinois. The installati...
11/11/2026
Central Christian Church has transformed communication across its live productio...
11/11/2026
Monumental Sports & Entertainment developed the new Cisco Command Center for all of the building's technology
Prior to the start of the busy October schedu...
11/11/2026
The new Manhattan set is the latest addition to a network of studios, home setup...
11/11/2026
With a remodeled set, an expanded camera package, and a Steve Aoki performance, MLB Network's production team raises the bar again at The Chelsea...
11/11/2026
Third collaboration with Grammy-winning composer & conductor
Spitfire Audio have announced the release of Eternity, the third sample library to be created a...
11/11/2026
Eurorack experts launch vinyl-inspired plug-in
When praised Eurorackers Modbap revealed their first software effect recently, they stated it was the first r...
11/11/2026
New York, NY - November 10, 2026 - Neptune BidCo US Inc. (the Issuer or the C...
11/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
11/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
11/11/2026
New partnership strengthens local access to Hitomi s precision timing solutions, with MatchBox, MatchBox Glass and Spectra on show at Inter BEE 2026
Hitomi Br...
11/11/2026
Frequency, the engine behind many of the worlds leading streaming television channels, and OpenGlass, the first SSP built for advanced CTV advertising, today an...
11/11/2026
Operative today announced the appointment of Brian Beirne as Senior Vice President, Commercial Growth. Beirne returns to Operative at a pivotal moment, as its U...