
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 ...
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
Editor's note: This post is part of Into the Omniverse, a series focused on how developers, 3D practitioners, and enterprises can transform their workflows ...
28/04/2026
AI agent systems today juggle separate models for vision, speech and language - ...
28/04/2026
RT News is pleased to announce the appointment of Sean Whelan as its new London Correspondent.
Sean has held the role of Washington Correspondent for the last...
28/04/2026
Joseph O'Connor, Eileen Walsh, Louise Duffy, Mick Lynch, Gormfhlaith N Thuairisg and Dermot Bannon take a personal look at life 100yrs ago in new TV docume...
27/04/2026
CES Power, a provider of infrastructure for live events, has announced the acquisition of three Ireland-based businesses: GH Energy Rental Ltd, Event Power, and...
27/04/2026
FuboTV Inc. has announced it is developing its Multiview feature for the Fubo streaming service on select LG TVs, including 2024, 2025, and newer 4K and 8K mode...
27/04/2026
Shade, a file management platform for creative teams, has announced a $14 million funding round led by Khosla Ventures, Construct Capital, and Bling Capital, br...
27/04/2026
The Audio Engineering Society (AES) will present the Immersive Audio Academy 12th Edition - Immersive Audio in All Flavors - on April 30, 2026, at 12:00 p.m. ...
27/04/2026
DAZN has announced DAZN48, a creator program for the FIFA World Cup 2026 that will recruit 48 creators - one representing each of the 48 qualified nations - to ...
27/04/2026
FloSports has announced exclusive streaming rights to four CrossFit competitions: Legends Del Mar: CrossFit Semi-Finals, Magic City Games, NorCal Classic, and t...
27/04/2026
Telestream has announced that Pulse, its software-defined test and measurement p...
27/04/2026
Shade has announced it is a Cloud Computing and Storage winner in the 2026 NAB Show Product of the Year Awards. Winners were selected by a panel of industry exp...
27/04/2026
Leading the NBA's video-ads platform, this Penn State grad is at the forefro...
27/04/2026
DAZN has expanded its international broadcast rights for the T100 Triathlon World Tour to include Africa. All races from the T100 calendar will be available for...
27/04/2026
NAB Show has announced the recipients of its 2026 Project of the Year and Product of the Year Awards at a ceremony at the Las Vegas Convention Center.
Each wi...
27/04/2026
DIRECTV has launched on Meta Quest headsets, becoming the first MVPD to offer live TV through the platform. The timing coincides with the stretch run of the MLB...
27/04/2026
TBL Team Boxing League has announced a broadcast agreement with MSG Networks to air all remaining Season 4 fights live across MSG's television and digital p...
27/04/2026
IP integration, interoperability, growth of intercommunications were key concerns for vendors and visitors alike
Attendees at the recently concluded 2026 NAB S...
27/04/2026
Behind The Mic provides a roundup of recent news regarding on-air talent, includ...
27/04/2026
A pro-audio emphasis, spectrum changes, and on-field audio mark the new products and enhancements to existing offerings
Microphones remain the primary point of...
27/04/2026
The Sports Video Group team was all over the NAB Show floor out in Las Vegas las...
27/04/2026
N r Spotify grundades f r 20 r sedan dominerades musikmarknaden av illegal nedladdning. Sedan dess har streaming bidragit till att teruppr tta betalningsvilja...
27/04/2026
Time on Spotify should feel meaningful and intentional, not something that slips...
27/04/2026
New modular multi-effects plug-in revealed
The latest plug-in from Brainworx delivers a modular set of effects designed to offer a convenient alternative to...
27/04/2026
Kit includes supercardioid & shotgun capsules
High-end mic manufacturer Schoeps have recently introduced another member of their Desert Island Set family. O...