
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 ...
07/10/2026
Dalet, a leading technology and service provider for media-rich organizations, today announced the latest Long-Term Supported (LTS) release of Dalet Flex. Build...
06/09/2026
June 9 2026, 23:00 (PDT) Dolby and MagentaTV Bring Fans Closer to the FIFA Worl...
02/09/2026
IBC2026 will put sport firmly at the centre of the global media and entertainment technology conversation with the strongest sports showing in the event's h...
02/09/2026
PTZOptics will bring a hands-on showcase of intelligent video production to IBC2026 (11-14 September, RAI Amsterdam), with demonstrations spanning new camera te...
02/09/2026
OOONA, a global provider of professional management and production tools for the media localization industry, today announced the launch of OOONA Go, a ready-to...
02/09/2026
EON Media will make its European debut at IBC2026 (September 11-14, RAI Amsterdam) in the show's Future Tech Zone (Hall 14.FT5). The company is launching it...
02/09/2026
Frequency, the engine behind many of the worlds leading streaming television channels, will demonstrate at IBC2026 how integrating intelligence throughout chann...
02/09/2026
On-device AI platform gives broadcasters and content creators purpose-built tools for real-time vertical video production and AI-enhanced sports coverage...
02/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
02/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
02/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
02/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
02/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
02/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
02/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
02/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
02/09/2026
Next-Generation Freeform Control Surfaces Lay the Foundation for AI-Enabled Media Operations
At IBC2026 (Sept. 11 14, RAI Amsterdam, Stand #1.B73), Imagine Com...
02/09/2026
Friedrichstadt-Palast in Berlin, the world's largest theater stage, has modernized its backstage production infrastructure with a comprehensive Riedel solut...
02/09/2026
Women in Media announces that it will host the two-day Reel/Forward in-person conference devoted to navigating today's production scene. Guests can enjoy pa...
02/09/2026
The expanded partnership brings Teradek's Live Production solutions to New Media AV's European dealer and integrator network, opening new opportunities ...
02/09/2026
QuickLink, a leading provider of award-winning video production and remote guest contribution solutions, announces a major expansion to its award winning Studio...
02/09/2026
BCNEXXT, the developers of the advanced playout platform Vipe, today announced that premium entertainment brand Foxtel has selected Vipe to underpin playout for...
02/09/2026
SubtitleNEXT helps HOT Telecom's subtitling team keep a cool head with reliable QC capabilities
Profuz Digital, global developer of digital media and local...
02/09/2026
Case Study: Mission Digital Strengthens Battery Safety with Safe-ion
As productions become increasingly dependent on battery-powered equipment, the safe storag...
02/09/2026
LA JOLLA, CA-Influenza viruses constantly shapeshift to evade recognition by the immune system. This shapeshifting occurs in critical proteins like hemagglutini...
02/09/2026
LA JOLLA, CA-Clinicians often use a medical test called a 12-lead electrocardiogram (ECG) to diagnose heart problems, which uses electrodes placed on the chest ...
02/09/2026
LA JOLLA, CA-Proteins may look like rigid molecular structures, but inside our c...
02/09/2026
RT has today announced a major media partnership with Lidl around Katie Taylor's historic Croke Park clash with Flora Pili on Saturday, September 5th.
The...
01/09/2026
Bridge Technologies will announce at IBC2026 (Booth 1.A71) that its VB440 produc...
01/09/2026
DAZN has announced an agreement to acquire EverPass Media, a commercial sports distribution platform serving bars, restaurants, hotels, and other venues in the ...
01/09/2026
The USTA and Kalshi have announced a multi-year partnership making Kalshi the Official Prediction Market Partner of the US Open, beginning with the 2026 US Open...
01/09/2026
MASV will exhibit at IBC2026 (Booth 5.B40, RAI Amsterdam, September 11-14). CTO Majed Alhajry will appear on a panel session, A Tale of Two Feeds: Automation o...
01/09/2026
FingerWorks Telestrators has announced a partnership with Broadcast Rental to ex...
01/09/2026
FOR-A has announced the expansion of viztrick AiDi into two dedicated products: Go Vertical! AiDi and AiDi Sports Hub. Developed by Nippon TV and delivered glob...
01/09/2026
Sony Pictures Television has launched Live TV on PS5, a free ad-supported streaming experience available to PS5 players in the United States. The service is acc...
01/09/2026
Friedrichstadt-Palast in Berlin has installed a Riedel production infrastructure spanning video, intercom, control, and I/O across the venue, implemented in col...
01/09/2026
Arkona technologies GmbH has announced an OEM partnership with BFE Studio und Medien Systeme GmbH to offer arkona-branded control panels for its SDI-IP routing ...
01/09/2026
Cricket Australia has launched Cricket TV, a direct-to-consumer streaming service built on Eluvio's Content Fabric platform. The service is currently in ear...
01/09/2026
Eluvio has announced it was selected to power Pasifika , a new direct-to-consume...
01/09/2026
Layercake, the company behind the intelligent media workflow platform Streamcake, has appointed Jon Marquard as Director and Chairperson. The appointment marks ...
01/09/2026
Gravity Media has announced a multi-year renewal of its agreement with Stawell Gift Event Management to produce the complete broadcast of the Powercor Stawell G...
01/09/2026
Beam Dynamics will exhibit at IBC2026 for the first time (Stand 14.FT29, Hall 14), introducing License Intelligence, a new module for managing software licenses...
01/09/2026
Interra Systems has announced that ZOO Digital has selected BATON for file-based quality control across its media workflows. ZOO Digital delivers localized ente...
01/09/2026
Bridge Technologies has announced the deployment of its VB330 monitoring probe at Sunrise, supporting the Swiss telecommunications provider's IP-based telev...
01/09/2026
Riedel Communications has announced the continued expansion of its managed coach communications partnership with Scottish Rugby Union, now entering its third se...
01/09/2026
Behind The Mic provides a roundup of recent news regarding on-air talent, includ...
01/09/2026
SMPTE today detailed the centerpiece of its IBC2026 program: the SMPTE Roadshow: Future of Media Infrastructure, a full-day workshop on Monday, 14 September, th...
01/09/2026
Inside the Music and Sound of Michael
Sound Particles have announced an upcoming webinar with John Warhurst, the Academy Award- and BAFTA-winning supervisin...
01/09/2026
Piano offers tutorials, lessons & feedback via app
Roland have just launched a new digital piano that integrates with a mobile app in an effort to encourage...