
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...
01/06/2026
January 6 2026, 05:30 (PST) Dolby Sets the New Standard for Premium Entertainment at CES 2026
Throughout the week, Dolby brings to life the latest innovatio...
12/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
12/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
12/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
12/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
12/05/2026
NUGEN Audio will debut Version 1.1 of DialogCheck, its intelligent dialog intelligibility and compliance tool, at the 2026 Media Production & Technology Show (S...
12/05/2026
The reactive visuals can adapt to any stage or screen setup and comprise 50 layers of Notch content
Today, Disguise announced that its high performance GX 3 m...
12/05/2026
Snapgrid , Snapbag & Airglow Expand Creative Control for the ARRI Modular LED BarFollowing the launch of the ARRI Omnibar, DoPchoice introduces a dedicated li...
12/05/2026
From finance and procurement to supply chain and manufacturing, specialized AI agents are moving into the enterprise systems where business decisions are made, ...
11/05/2026
New production unit features not only wealth of Ross gear but also Sony cameras, Canon lenses, and a Calrec Argo S audio board...
11/05/2026
Solid State Logic (SSL) has announced TCA Tour, a portable fly-away audio production system built from System T components for broadcast, touring, and live prod...
11/05/2026
Riedel Communications has announced it will serve as Official Connectivity Integ...
11/05/2026
Guntermann and Drunck (G&D) and NETGEAR AV have announced a plugin that automates network configuration for G&D KVM-over-IP deployments on NETGEAR AV Line infra...
11/05/2026
The Famous Group (TFG) and Elite Edge, a production studio specializing in live-action production, show opens, set design, and fabrication for sports and live e...
11/05/2026
The native of S o Paulo, Brazil, will play a crucial role in the broadcaster'...
11/05/2026
Cobalt Digital will exhibit its IPMX/ST 2110 product lineup at BroadcastAsia 2026 (Stand 5D2-4), anchored by the COBALT blueCORE family of standalone signal pro...
11/05/2026
Interra Systems will exhibit at BroadcastAsia 2026 (Stand 5C1-10), demonstrating...
11/05/2026
T-Mobile is serving as a technology partner for the 2026 PGA Championship at Aronimink Golf Club in Newtown Square, Pennsylvania, deploying 5G connectivity and ...
11/05/2026
Vizrt has announced it has been named an Official Technical Supplier of the Eurovision Song Contest 2026, in partnership with host broadcaster ORF. The 70th edi...
11/05/2026
The WNBA and Amazon Web Services (AWS) have announced a multi-year partnership making AWS the Official Cloud and Cloud AI Partner of the WNBA. AWS is also joini...
11/05/2026
Austrian private broadcaster kronehit publicly awarded SLG Broadcast AG and Lawo...
11/05/2026
Behind The Mic provides a roundup of recent news regarding on-air talent, includ...
11/05/2026
As Eurovision fans gear up to celebrate the 70th anniversary of the iconic song ...
11/05/2026
Pela primeira vez na hist ria, o Brasil figura entre os oito maiores mercados de...
11/05/2026
New desktop instrument focused on tactile performance
Bastl Instruments have announced the Kalimba, a new desktop instrument that combines physical modellin...
11/05/2026
Compact sampling workstation gains new features
1010music have announced the blackbox 2, a new version of their compact standalone sampler designed for DAWl...
11/05/2026
Performance-focused sequencer with microtonal control
Berlin-based KOMA Elektronik have announced Monoplex, a new 42HP Eurorack sequencer designed for hands...
11/05/2026
Boasts wireless control from mobile devices
The latest iteration of IK Multimedia's compact amp and effects modelling pedal expands on the capabilities ...
11/05/2026
Spans traditional orchestral and experimental sounds
Sonora Cinematic have recently released the third instalment in their Transfigured Orchestra series, de...
11/05/2026
Our exhibition coverage
Watch all our SUPERBOOTH 2026 video coverage in one place. Check back to this page regularly as we will be updating with more video ...
11/05/2026
You're not meant to look at an Eclipse, but you won't be able to take yo...
11/05/2026
L3Harris has completed more than 50% of a nationwide effort to rebuild the invisible backbone of America's airspace....
11/05/2026
aconnic AG (ISIN: DE000A0LBKW6), Munich, is participating in the Equity Forum Ge...
11/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
11/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
11/05/2026
As Asia Pacific's streaming market continues to evolve, operators across the region are rebalancing their strategies and shifting their focus from subscribe...
11/05/2026
LONDON, MAY 11, 2026 QuickLink, a leading provider of award-winning video production and remote guest contribution solutions, will showcase its latest innovat...
11/05/2026
Cobalt Digital's BroadcastAsia Line-up Highlights Flexible End-to-End IPMX/ST 2110 Ecosystem
Award-winning blueCORE standalone signal processors at the he...
11/05/2026
Encompass Digital Media, in partnership with VideoMagic International, announced at NAB 2026 the launch of Altitude Intelligence, an AI-powered platform designe...
11/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
11/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
11/05/2026
Alfalite, the only European manufacturer of LED screens, has completed a major new corporate installation in Spain with the upgrade of the auditorium at Torre I...
11/05/2026
11 May 2026
VEON Shareholders Re-elect Board and Chairman, Reaffirming Confiden...
11/05/2026
Fox Corporation Reports Third Quarter Fiscal 2026 Financial Results NEW YORK, NY, May 11, 2026 - Fox Corporation (Nasdaq: FOXA, FOX; FOX or the Company ) t...
11/05/2026
Arvato Systems Becomes a Member of InsurLab Germany
Collaboration in the insurance industrys leading innovation network
G tersloh - Arvato Systems has joine...
11/05/2026
Pirate Predator uncovers new information from victims and survivors of abuse on ...
10/05/2026
Berklee Honors Jacob Collier, Jill Scott, and Vinnie Colaiuta at 2026 Commenceme...