
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...
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 ...
29/04/2026
Student Spotlight: Alan Catz The Argentine film and game composer talks about working on League of Legends, receiving Berklee's BMI Award, and the lifelon...
29/04/2026
Jay Jennings Builds the Worlds You Hear on Screen The supervising sound designer behind A Minecraft Movie, The Meg, Letters from Iwo Jima, and dozens of other...
29/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/04/2026
Jin-Quan Yu elected to the National Academy of Sciences Yu is recognized for his pioneering work in synthetic organic chemistry.
April 28, 2026
LA JOLLA, CA S...
28/04/2026
The audio team for the entertainment event must blend speech intelligibility with full-range music reproduction while considering the broadcast
Last week's...
28/04/2026
The Pac-12 Conference has released an updated primary mark and logo as the starting point of the new league's brand identity. The mark was soft-launched acr...
28/04/2026
The DP World Tour and Amazon Leo have signed an agreement making Amazon's lo...
28/04/2026
Pixellot and HELIOS have announced an integration that automatically converts full-game hockey video into individualized shift videos for each athlete, without ...
28/04/2026
Daktronics has partnered with the Asheville Tourists to manufacture and install a new LED video display. The installation was completed in late 2025 and is now ...
28/04/2026
Eutelsat has announced the renewal of its partnership with PCTV, a content aggregation and distribution company in Mexico and part of Megacable Holdings, for co...
28/04/2026
Daktronics has partnered with the Gary SouthShore RailCats to install a new LED video display at U.S. Steel Yard, replacing the previous Daktronics display inst...
28/04/2026
Telos Alliance and the College Radio Foundation have announced that WWSU-FM of W...
28/04/2026
Golf viewership is growing. The 2025 Ryder Cup drew five million viewers in the UK, a 45% increase over the 2023 event. The US Open was the most streamed golf e...
28/04/2026
The CW Network and WWE, part of TKO Group Holdings (NYSE: TKO), have announced t...
28/04/2026
The Alliance for IP Media Solutions (AIMS) has announced that the Internet Protocol Media Experience (IPMX) suite of standards and specifications has been named...
28/04/2026
The 2026 NAB Show is in the books and the show once again served up a cavalcade ...
28/04/2026
Gray Media and RAJ Sports have announced Rose City SportsNet (RCSN), a new netwo...
28/04/2026
Today, we announced our First Quarter 2026 earnings, starting the Year of Raising Ambition with strong momentum across the business and continued innovation acr...
28/04/2026
I dag presenterade vi v rt resultat f r det f rsta kvartalet 2026. Vi inleder ret med starkt momentum i hela verksamheten och fortsatt innovation p plattforme...
28/04/2026
New handheld promises studio performance for the stage
Mojave have just introduced a new live-focused handheld vocal mic created by award-winning designer D...
28/04/2026
Max for Live device offers AI-powered stem separation
Dynamic Split Module (DSM) is a new Max for Live device created by Ostin Solo, a developer and musican...
28/04/2026
First interface equipped with ISA preamps
Focusrite have just announced the launch of a new high-end audio interface that features a pair of their legendary...
28/04/2026
Triton Digital's Podcast Metrics Demos+ Data Integration Enables Comprehensi...
28/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/04/2026
TAG Video Systems, the leading IP-native Realtime Media Platform, today announced that Lens, its visual service health interface for broadcast operations, recei...
28/04/2026
Open AV-over-IP Standard Recognized in IT Networking/Infrastructure and Security Category
The Alliance for IP Media Solutions (AIMS) today announced that the ...
28/04/2026
VFX History: Slit Scan
Graham Quince April 28, 2026
0 Comments
How did 2001: A Space Odyssey, Star Wars, Doctor Who and Star Trek: The Next Generation...
28/04/2026
These DaVinci Resolve Effects Will Make You a More Creative Colorist
Kasia Jarco April 28, 2026
0 Comments
Creativity in color grading is not about ha...
28/04/2026
A Simple Introduction to Cavalry: Indexed Circle
Simon Ubsdell April 28, 2026
0 Comments
In this new introductory tutorial for Cavalry we're going...
28/04/2026
Rise, the award-winning advocacy group for gender diversity in the broadcast and media technology sector, is pleased to announce a new global training programme...
28/04/2026
Clear-Com has appointed Brian Grahn as Market Outreach Manager of the Americas and Ben Turnwell as Business Development Manager for EMEA live, expanding their ...
28/04/2026
LiveU is inviting MPTS visitors to step into the companys new Q Era on Stand D32, at The Grand Hall, Olympia, London (May 13-14). The company will showcase its ...
28/04/2026
IBC today announces the launch of the IBC2026 Innovation Awards, with nominations now open for projects, programmes and initiatives that exemplify breakthrough ...
28/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/04/2026
Introducing Nx 3-Strip v2 - A Physics-Based Technicolor Reconstruction for DaVin...
28/04/2026
April 28th, 2026 Press Materials Available Here
TRIBECA FESTIVAL MARKS 25 YEAR...