
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...
08/09/2026
Comcast Technology Solutions (CTS) has announced a multi-year agreement with A E...
08/09/2026
Spectra Logic today announced the availability of Media Insight, a new capabilit...
08/09/2026
Rogers Communications and Quebecor have announced a 12-year sublicensing agreement for French-language national NHL games beginning with the 2026-27 season. TVA...
08/09/2026
Skyline Communications and Bridge Technologies will demonstrate two integrations...
08/09/2026
Boland Communications will make the European debut of its 4K55HDR7SNB 55-inch super-narrow-bezel monitor at IBC2026 (Stand 12.C57, RAI Amsterdam, September 11-1...
08/09/2026
Ateme and Comcast Technology Solutions (CTS) have announced a collaboration comb...
08/09/2026
Haivision has joined the IBC Accelerator Media Innovation Programme as part of t...
08/09/2026
Blackmagic Design has announced price reductions on its PYXIS 6K and Cinema Camera 6K models, effective immediately through Blackmagic Design resellers worldwid...
08/09/2026
AI-Media will demonstrate its LEXI Suite at IBC2026 (Booth 5.C34, September 11-1...
08/09/2026
Bitmovin and Ad Insertion Platform (AIP) have announced the first live deploymen...
08/09/2026
Grass Valley will demonstrate story-centric media workflows at IBC2026 (Booth 9.A01, RAI Amsterdam, September 11-14), connecting newsroom production, content ma...
08/09/2026
M2A Media and Ateme have announced a partnership integrating Ateme's video processing solutions into M2A Media's MediaToAnywhere platform for live sport...
08/09/2026
Ikegami will exhibit at IBC2026 (Stand 12.A31, RAI Amsterdam, September 11-14), including a Day 1 introduction of new cameras in the UNICAM XE series. Additiona...
08/09/2026
Broadcast industry analysts will be gathering plenty of insights at the 2026 IBC Show this weekend in Amsterdam, but Caretta Research has offered up some though...
08/09/2026
SENSHI and DAZN have announced a global broadcast partnership that will bring SENSHI's live events free to viewers in more than 200 markets. The partnership...
08/09/2026
New architecture built with Evertz will bring 4K HDR to Monday Night Football, N...
08/09/2026
Built for rap producers, by rap producers
Sauceware Audio, the independent plug-in company founded by Grammy-nominated producer Jacob (Travis Scott, 21 Sava...
08/09/2026
Classic Sound Techniques design revived
Warm Audio's latest release delivers a meticulous recreation of the preamp circuitry employed by the Sound Techn...
08/09/2026
Latest soft synth inspired by the Memorymoog
XILS Lab have just launched a software instrument that draws its inspiration from Moog's iconic Memorymoog,...
08/09/2026
The Airport Chaplain takes off as SBS's biggest launch of 2026
8 September, 2026
Media releases
1.67 million viewers on National Total TV to date
Best...
08/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
08/09/2026
Mo-Sys, the world-leading developer of virtual production, camera robotics and image tracking technology, has completed a business restructuring, which has incl...
08/09/2026
New York, September 8, 2026 The TSAmediaHUB audiovisual contribution and distribution infrastructure developed by Telef nica's Audiovisual Services area re...
08/09/2026
Expanded Riyadh operation brings Asharq and Thmanyah services together on a resilient on-premises Pebble platform.
Pebble, the leading automation, content mana...
08/09/2026
Techex, a pioneering leader in live video workflows, will showcase its broadest software feature set to date at IBC 2026 (Stand 2.B45), extending its lead in so...
08/09/2026
Visitors to Grass Valley's booth at IBC2026 will be introduced to new Framelight X capabilities that connect content acquisition, management, editing and pu...
08/09/2026
BCNEXXT will showcase the latest evolution of Vipe at IBC2026 (Stand 2.B09), introducing a series of innovations designed to deliver higher-quality audience exp...
08/09/2026
Bitmovin, a provider of video streaming solutions, has partnered with Ad Insertion Platform (AIP), a leading innovator in advanced ad insertion technologies, to...
08/09/2026
Brainstorm, a leading manufacturer of real-time graphics and augmented and virtual production, is announcing a major package of enhancements to its Suite 7 soft...
08/09/2026
Big Blue Marble is supporting TDF, French infrastructure and network operator, broadcasting Digital Terrestrial Television (DTT) and radio services, as a techno...
08/09/2026
Agents work inside a single production environment, from incoming wire copy to a live studio show...
08/09/2026
Building on their strategic partnership, Ceeblue and Layercake make the unthinkable possible: scalable sub-second streaming over standard DRM, SSAI, and CDN wor...
08/09/2026
Brainstorm, a leading manufacturer of real-time graphics, augmented and virtual production, is completing the environment for fast-paced broadcast production wi...
08/09/2026
A SaaS portfolio built to work together, helping operators grow audiences, monetise smarter and run leaner, on their own terms
At IBC 2026 (stand 1.B49) Synam...
08/09/2026
Accedo, global provider of video streaming software and services, has been selected by PlayOn Sports, a national leader in high school sports technology, to exp...
08/09/2026
LiveU, the leader in live IP-video solutions, is enabling The Associated Press to take global newsgathering to the next stage with intelligent connectivity and ...
08/09/2026
Mediagenix, a global leader in smart content solutions to profitably connect the right content to the right audience, today announced the latest evolution of it...
08/09/2026
Compact, power-efficient X Platform performance brings broadcast-grade reliability and ultra-low latency to space-constrained remote production (REMI) workflows...
08/09/2026
Zixi, the leader in live video delivery and workflow orchestration, and Kiloview, a leading provider of professional IP video encoding and decoding solutions, t...
08/09/2026
Collaboration gives content owners scalable CDN capacity and broadcasters enhanced flexibility, including for C-band transition planning
Quortex today announce...
08/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
08/09/2026
Telos Alliance and Pluxbox Announce Dynamic Media Facility Integration Partnersh...
08/09/2026
J nger Audio Showcases Industry-First S-ADM Cloud Workflow at IBC 2026
Search
Dolby, MainConcept, Techex and J nger Audio will showcase the industry's ...
08/09/2026
Tuesday 8 September 2026
Sky Go gets a major upgrade for Sky Glass and Sky Stream customers
Today, Sky launches a new version of the Sky Go app for Sky Glass ...
08/09/2026
Documentary thriller simulating a Russian attack on UK soil will culminate in a live final episode reuniting the playersTuesday 8 September 2026
Trailer releas...
08/09/2026
Tuesday 8 September 2026
Jamie Demetriou and Amelia Dimoldenberg to host next t...
08/09/2026
Wuppertal September 8, 2026
Riedel Introduces New OnAir Headset PlatformRiedel Communications today announced the launch of its new OnAir headset platform, a...