
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...
21/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/08/2026
When hundreds of thousands of people gather to hear a single voice, there is no room for compromise. Every word must be delivered clearly, every wireless transm...
21/08/2026
Telestream, a global leader in media workflow technologies, today announced a strategic partnership with ScorePlay, the AI-powered media infrastructure that spo...
21/08/2026
NUGEN Audio announces the launch of its new Post Plan and Producer Plan, two flexible subscription offerings designed to give audio professionals short term acc...
21/08/2026
Join the Screen Currency 2026 Ask Me Anything (AMA) Online 20 August 2026
(L-R): Adrian Coates, Grainne Brunsdon, Deirdre Brennan, Rachael Perkins
Got questio...
20/08/2026
From host-broadcaster and rightsholder support in June and July to MLS, NWSL, US...
20/08/2026
In-venue and creative video staffers at the professional and collegiate level ha...
20/08/2026
At IBC this year, Veritone (14.A56) is bringing two connected themes to the booth: architectural independence in enterprise AI, and the automation of the media ...
20/08/2026
Telestream and ScorePlay have announced a partnership combining Telestream's...
20/08/2026
The Grand Slam of Curling and Rock League have announced a three-year agreement with ESPN, bringing more than 300 hours of live curling coverage to U.S. audienc...
20/08/2026
Nielsen has announced a series of enhancements to its Big Data + Panel currency measurement methodology, taking effect August 31. The updates were developed in ...
20/08/2026
Net Insight has been selected by service provider Big Blue Marble (formerly ORS Group) to provide its Nimbra platform as the core media transport solution for a...
20/08/2026
The 2026 US Open will bring a series of free fan activations across New York City ahead of and during the tournament, which runs August 23-September 13.
We...
20/08/2026
Bridge Technologies will announce a transport stream (TS) playout feature for its VB330 and VB220 compressed monitoring probes at IBC2026 (Booth 1.A71).
The fe...
20/08/2026
ENCO will demonstrate solutions across captioning, translation, AI production tools, automation, and virtual production at IBC2026 (Stand 7.A34, Amsterdam RAI, ...
20/08/2026
MultiDyne Video and Fiber Optic Systems will demonstrate camera robotics and mot...
20/08/2026
Chyron will demonstrate news workflow solutions at IBC2026 (Stand 7.A23), marking the company's 60th anniversary. Highlights include updates to PRIME HTML, ...
20/08/2026
Spectrum SportsNet LA, the exclusive television home of the Los Angeles Dodgers, is now available to Spectrum customers in former Cox markets following the clos...
20/08/2026
swXtch.io will unveil expanded Global SRT Distribution and native multicast tran...
20/08/2026
Riedel Communications has announced that Transformation Church in the United States has deployed a communications system built around the Artist intercom ecosys...
20/08/2026
The bestselling author and longtime Apple observer explores how product launches...
20/08/2026
The Orlando Magic entered last season with a dramatically upgraded in-venue prod...
20/08/2026
Pacers Sports and Entertainment has announced a partnership with DAZN, making it the exclusive streaming home of Indiana Pacers basketball. A team-branded strea...
20/08/2026
Ratings Roundup is a rundown of recent ratings news and is derived from press re...
20/08/2026
The NHL has announced two major developments tied to its Germany growth strategy...
20/08/2026
Set up your own private remote collaboration infrastructure
SoundBridge have recently put together a tutorial video that provides users with a step-by-step ...
20/08/2026
New V-Control Pro features restore basic functionality
Neyrinck's V-Control software has long been keeping older Avid control surfaces compatible with n...
20/08/2026
TV, BritBox and Mammoth Screen have announced that filming is now underway on th...
20/08/2026
New York August 19, 2026 Nielsen today shared a number of key enhancements t...
20/08/2026
New Gracenote Data Hub analysis finds sports program titles up 31.2% and individ...
20/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
20/08/2026
At IBC, Profuz Digital will showcase at stand 8.A88 the SubtitleNEXT platform delivering innovative AI transcription integrations and stunning new features boos...
20/08/2026
Riedel Communications today announced that Transformation Church, one of the fastest-growing and most influential digital ministries in the United States, has d...
20/08/2026
QuickLink Showcases New 4K Capabilities Across StudioEdge and StudioCall at IBC ...
20/08/2026
The Boys Season Five Graded with DaVinci Resolve Studio
Brie Clayton August 20, 2026
0 Comments
Colorist Siggy Ferstl uses Depth Map to bring a three ...
20/08/2026
Adobe Firefly expands its creative AI studio: generate music, speech, and sound ...
20/08/2026
Multiview available via SaaS for streaming platforms and operators through broadpeak.io, with live demonstrations at IBC2026
Broadpeak , a leader in streaming ...
20/08/2026
Techex, a leading provider of live broadcast infrastructure solutions, has appointed Stuart Almond as Chief Revenue Officer, further strengthening its executive...
20/08/2026
Avid today announced that MediaCity Studios has upgraded its production infrastructure with an enhanced end-to-end Avid production ecosystem, including the dep...
20/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
20/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...