
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 ...
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...
02/05/2026
Dalet, a leading technology and service provider for media-rich organizations, t...
01/05/2026
January 5 2026, 18:30 (PST) NBCUniversal's Peacock to Be First Streamer to ...
01/04/2026
January 4 2026, 18:00 (PST) DOLBY AND DOUYIN EMPOWER THE NEXT GENERATON OF CREATORS WITH DOLBY VISION
Douyin Users Can Now Create And Share Videos With Stun...
13/03/2026
Recently named CEO Andreas Eriksson has taken the helm at Net Insight at a pivot...
13/03/2026
Scripps Sports and Ally Financial are partnering with the Professional Women's Hockey League (PWHL) to broadcast its first game on national linear televisio...
13/03/2026
Disney+ has launched Verts, a vertical video feed on its U.S. mobile app, markin...
13/03/2026
LTN, a managed IP video transport company, and Appear, a live production technol...
13/03/2026
The Professional Fighters League (PFL) has announced an agreement with Sportradar for global betting data and streaming rights. Under the deal, Sportradar becom...
13/03/2026
In-venue and creative video staffers at the professional and collegiate level ha...
13/03/2026
The streamer will be the first entertainment platform to offer AI-enabled vertical video for live games, starting with the NBA...
13/03/2026
Ease Live, an Evertz company specializing in interactive graphical overlays, has deployed its platform on Red Bull TV for Premier Padel coverage. The deployment...
13/03/2026
Monday Night Football, ESPN's premiere NFL property, has continued to be improved and upgraded from a production perspective. Alternative broadcasts are aug...
13/03/2026
At NAB Show 2026, Net Insight (booth W1653) is introducing the Nimbra 520, a high-density media processing node for live contribution and distribution across ma...
13/03/2026
Harmonic (booth W2831) has announced Spectrum X Plus, the newest generation of its Spectrum X media server, offering double the channel density of previous gene...
13/03/2026
Riedel Communications has announced the expansion of its Managed Technology Divi...
13/03/2026
Telestream (booth W1503) has announced the expansion of Telestream Cloud Services with the introduction of UP, a cloud-native solution for ingest, orchestration...
13/03/2026
From awards ceremonies and sports honors shows to festivals and fan conventions,...
13/03/2026
Overtime has announced a partnership with Metro by T-Mobile, naming Metro the Of...
13/03/2026
At NAB 2026, Calrec (booth C6907) will IP Ecosystem powered by True Control 2.0, integrating the company's IP-native Argo consoles - including the U.S. debu...
13/03/2026
Ratings Roundup is a rundown of recent ratings news derived from press releases ...
13/03/2026
Spotify has always been built around your taste. More than 80% of listeners say personalization is what they love most about us. Now we're taking that even ...
13/03/2026
The new Spotify Legends Club has opened its doors. Its members: select German-sp...
13/03/2026
Pushing drum sampler technology into new territories
The latest version of Klevgrand's software drum sampler has just arrived, boasting a newly designe...
13/03/2026
Expanded headphone support & engine improvements
IK Multimedia's recently introduced ARC On-Ear system brings the power of their monitoring-correction s...
13/03/2026
Extra sound collections, more presets & new Keys category
UVI's rhythm and pattern instrument has just received a major update that introduces four new ...
13/03/2026
Over a year ago, L3Harris delivered the first missionized Bombardier Global 6500 aircraft for U.S. Indo-Pacific Command. Two ATHENA-R platforms now average 400+...
13/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
13/03/2026
Harmonic (NASDAQ: HLIT) today announced Spectrum X Plus, the newest generation of its Spectrum X media server, offering double the channel density of previous ...
13/03/2026
When Ewing Covenant Church made the decision to return to its original, historic building, affectionately called 1867 Sanctuary for weekly worship, the congre...
13/03/2026
Marshall Electronics introduces its first all-IP 4K POV camera, the CV574-WP, at NAB 2026 (Booth C8339). The CV574-WP supports NDI |HX, providing ultra-efficien...
13/03/2026
At NAB Show 2026, Net Insight introduces Nimbra 520, a high-density media processing node designed to simplify live contribution and distribution across both ma...
13/03/2026
Abandon Editorial Signs With Micha l Dimitri for West Coast Representation
Brie Clayton March 12, 2026
0 Comments
Abandon Editorial is excited to part...
13/03/2026
Documentary The Bulldogs Shot and Edited with Blackmagic Design
Brie Clayton March 12, 2026
0 Comments
Editorial tools helped shape film in real time,...
13/03/2026
AE Captions as Fast as CapCut - No Plugins
Graham Quince March 12, 2026
0 Comments
Stop wasting hours clicking through nested compositions and manuall...
13/03/2026
New Music USA and Berklee Institute of Jazz and Gender Justice Announce 2026 Nex...
13/03/2026
13 Mar 2026
VEON Delivers Record Digital Growth: 4Q25 Digital Revenues Grow 84%...
13/03/2026
Friday 13 March 2026
Sky Adds Blood on Snow to Original Film Slate in Acquisiti...
13/03/2026
RT has announced today that Rick O'Shea is the new presenter of Arena RT Radio 1's flagship weeknight arts and culture programme. Rick has been pres...
13/03/2026
Lights! Camera! Action! The 98th Oscars set to air live as RT backs the Irish n...
12/03/2026
Staines-upon-Thames, UK, 11th March, 2026 - Yospace, the trusted leader in Dyna...
12/03/2026
Utah Scientific Expands Technology Partner Program With Integrations From Audina...
12/03/2026
Techex, a global expert in live video solutions over IP and cloud, announces the appointment of Matt McKee as Senior Director, Sales, Americas, further strength...
12/03/2026
KOKUSAI DENKI Electric America has appointed Mondae Hott as Regional Sales Manag...
12/03/2026
At the 2026 NAB Show, Interra Systems will showcase its latest advancements in a...
12/03/2026
The 15th National Games of China concluded after a two-week celebration of athletic excellence and regional collaboration. Held from Nov. 9-21 across Guangdong,...
12/03/2026
Live-production academic program Butler Sports Live produced a total of 40 fall-...
12/03/2026
The University of Nebraska's HuskerVision has completed the second phase of ...
12/03/2026
Grass Valley and integration partner Tab M Solutions have completed Phase 1 of a...