
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...
04/08/2026
Dalet, a leading technology and service provider for media-rich organizations, t...
28/07/2026
Ad Intel AI is Nielsen's first in a new generation of AI products built to t...
28/07/2026
Contribution to Europe's technological autonomy in the key industry telecommunications
aconnic AG (ISIN: DE000A0LBKW6), Munich, starts commercial shipments...
28/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/07/2026
Encompass Digital Media has been selected by Channel 4, one of the UK's public service broadcasters, to deliver managed linear playout services as part of a...
28/07/2026
Cinegy GmbH, the premier provider of software-defined television technology, has confirmed a new partnership with leading Korean systems integrator and distribu...
28/07/2026
Limecraft today announces version 2026.5 of its AI-powered production platform. Limecraft 2026.5 https://(www.limecraft.com/limecraft-2026-5-multicam-quad-view-...
28/07/2026
X Platform technology enabled a premium UHD viewing experience through a hybrid ground-to-cloud architecture developed with Chilevisi n, ClaroVTR and Pixop
App...
28/07/2026
LiveU, the pioneer in IP-video transmission and cloud-based remote production, today announced it has set historic performance records during the 2026 World Foo...
28/07/2026
dhd.audio announces that its latest generation firmware, Version 10.4, is now available to DHD customers. Version 10.4 introduces expanded configuration capabil...
28/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/07/2026
Brand's Intuitive Metering and Dialogue Tools Improve Efficiency and Maintain Clarity Across Projects Ranging from Sitcoms to Effects Heavy Fantasy Series
...
28/07/2026
TAG Video Systems, a leader in 100% software-based realtime media monitoring, multiviewing and quality control (QC), today announced the latest innovations to i...
28/07/2026
Harvard Athletics Transforms Collegiate Sports Storytelling with AJA Gear
Brie Clayton July 27, 2026
0 Comments
Between the maturation of IP and remot...
28/07/2026
New Live Action Projection Mapping Film Captured with URSA Cine 12K LF
Brie Clayton July 27, 2026
0 Comments
Large format sensor allows Texas Legacy ...
28/07/2026
NVIDIA Agent Toolkit Expands With New Omniverse Libraries, Putting AI Agents to ...
28/07/2026
AI Agents Expand Creative Tools to Millions
Brie Clayton July 27, 2026
0 Comments
Hero image courtesy of Epic Games
Leading creative applications are...
28/07/2026
How Rick Aggeler Built a Music Community for Boston Teens When he was a Berklee student, Aggeler volunteered at the Boys & Girls Clubs of Boston, where he hel...
28/07/2026
Anyone can make a robot move; NVIDIA Jetson makes it think. As a discerning AI i...
28/07/2026
RT Raidi na Gaeltachta, RT Radio 1, RT One and RT Player to showcase the best of the reels, rhymes and rambles from Comhaltas Fleadh Cheoil na h ireann 202...
28/07/2026
Through a wide range of perspectives, this documentary looks at how Ireland might navigate one of the defining political questions of the future
Wednesday, Jul...
27/07/2026
The Audio Engineering Society Educational Foundation has named its scholarship and grant recipients for the 2026/2027 academic year. The awards support students...
27/07/2026
ESPN and the Mid-Eastern Athletic Conference (MEAC) have signed a multi-year media rights agreement covering basketball championships and select football and ba...
27/07/2026
Yahoo Sports and Cameo have partnered to allow fantasy football users to book personalized celebrity videos directly within the Yahoo Fantasy app and website. T...
27/07/2026
Eutelsat has welcomed the FCC's order establishing the regulatory framework for the transition of Upper C-band spectrum in the United States. Under the orde...
27/07/2026
ESPN and the International Dance League (IDL) have signed a global rights agreement for the 2026 season. Events will air bi-weekly on ESPN2 at 7 p.m. ET beginni...
27/07/2026
NBCUniversal and YouTube have signed a multi-year global partnership that includes bundling Peacock with YouTube Premium, extending NBCUniversal's distribut...
27/07/2026
Agenda includes presentations from the Miami Heat, Inter Miami, Florida Panthers...
27/07/2026
Behind The Mic provides a roundup of recent news regarding on-air talent, including new deals, departures, and assignments compiled from press releases and repo...
27/07/2026
Ten one-minute shorts will roll out across CBS, The CW, Paramount+ during the 2026 PBR Teams season
PBR is officially moving into scripted animation. The Profe...
27/07/2026
Today the nonprofit Sundance Institute shared the names of this year's cohor...
27/07/2026
New app turns vocal percussion into polished loops
Vochlea, the company behind the voice-to-MIDI instrument Dubler 2, have just announced the launch of a ne...
27/07/2026
Latest MPE-capable instrument completes Pure Trilogy line-up
Sonora Cinematic have just released the third and final instalment in their series of acoustic ...
27/07/2026
Emulates four varieties of optical compression
The latest addition to the fedDSP line-up has just been announced, and packs four distinct optical compressor...
27/07/2026
Optical & FET compressors join 500-series line-up
At our recent GearExpo UK show, we heard from Drawmer that they would soon be launching a pair of new 500-...
27/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/07/2026
Lightware announces SNMPv3-based monitoring support for selected Taurus devices, available from firmware v1.20.0. The update enables IT administrators and AV in...
27/07/2026
Mediagenix, a global leader in smart content solutions to profitably connect the right content to the right audience, will showcase its vision for the Real-Time...
27/07/2026
All episodes available Thursday 6 August on Sky and streaming service NOWMonday ...
27/07/2026
Why Confidence MattersIn this series, we explore the technologies, architectures and operational realities shaping modern media operations. Along the way, we ex...
27/07/2026
Apple today announced AppleCare One - a new way for customers to protect multipl...
27/07/2026
Yesterday witnessed truly memorable scenes in Croke Park, bringing the curtain d...
27/07/2026
Luxembourg, July 27, 2026 - SES, a leading space solutions company, issued the following statement following the U.S. Federal Communications Commission approval...