
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/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 ...
08/04/2026
Scripps Research scientists uncover new mechanism cancer cells use to survive DNA damage Discovery reshapes understanding of how tumor cells repair broken DNA, ...
07/04/2026
Ikegami USA will launch a refinement to the UHK-X700 and UHK-X750 3-CMOS -in. UHD cameras in the UNICAM XE series plus two new 7-in. viewfinders at NAB 2026 in...
07/04/2026
The NAB Leadership Foundation and NAB PILOT will host a career mixer for technology students at NAB Show 2026 on April 18, 5-6:30 p.m., North Hall, Room N225/22...
07/04/2026
Audinate Group Limited and Futuresource Consulting have published results from a...
07/04/2026
Eluvio has announced the commercial availability of its Content Fabric Bucharest...
07/04/2026
Eluvio has unveiled a new architecture for video AI and an updated Eluvio Video Intelligence Editor (EVIE) ahead of NAB Show 2026. Eluvio AI runs analysis and i...
07/04/2026
The Professional Fighters League (PFL) has announced a deal with Sky New Zealand...
07/04/2026
The NBA and Enjoy Basketball, the digital media company co-founded by YouTube cr...
07/04/2026
The 4,000-sq.-ft. space in Frisco, TX, has produced live and packaged programmin...
07/04/2026
What began as a referee training tool is evolving into a powerful production ass...
07/04/2026
Manifold Technologies will announce at NAB Show 2026 (Booth C.1808) that its manifold CLOUD platform will be available as a deployable application within NEP Pl...
07/04/2026
Shaquille O'Neal, Authentic Brands Group, and TNT Sports, in partnership wit...
07/04/2026
Telos Alliance will debut the Omnia XII, a new FM/HD/DAB audio processor, at NAB Show 2026 in Las Vegas.
Built on a 2RU hardware platform, Omnia XII features a...
07/04/2026
Amazon Web Services (AWS) will exhibit at NAB Show 2026 (April 18-22, Las Vegas Convention Center, Booth W1701), with demonstrations, speaking sessions, and int...
07/04/2026
Synamedia will demonstrate AI by Quortex at NAB Show 2026, a framework that applies AI capabilities to video workflows on demand rather than continuously. The s...
07/04/2026
TVNewsCheck will present its 15th annual Women in Technology Awards on Tuesday, April 21, at 5 p.m. PT at NAB Show, in the Media and Entertainment Theater (W146...
07/04/2026
Akta will demonstrate its AI video platform at NAB Show 2026, highlighting new capabilities in media processing and vertical video formatting alongside its exis...
07/04/2026
ESPN and Disney have announced the launch of ESPN on Disney in Europe and select Asia-Pacific markets, bringing the offering to 53 countries and territories a...
07/04/2026
LOS ANGELES, CA, April 7, 2026 - The nonprofit Sundance Institute announced today the fellows selected for the 2026 Native Lab, the signature initiative of the ...
07/04/2026
Starting today, Prompted Playlist is expanding beyond music to now include podca...
07/04/2026
Launched alongside piano promotion
The latest instalment in VSL's Synchron Series line-up captures the sound of a faithful copy of a Fran ois tienne Bl...
07/04/2026
Flagship sampling pad gets an update
Roland's flagship sampling pad has just received a major update that kits it out with an array of new features and ...
07/04/2026
Popular compact wireless system upgraded
Sound Devices have recently introduced a new and improved version of their compact wireless transmitter bodypacks, ...
07/04/2026
The November 2025 YEP Newsletter highlights a recent YEP Coffee Chat, offering members the chance to connect with industry professionals in an informal setting ...
07/04/2026
The December 2025 YEP Newsletter includes a Spotlight on Emily Vail, showcasing her career journey and work in the industry, alongside Mentorship Reflections by...
07/04/2026
Ground-Based Electro-Optical Deep Space Surveillance (GEODSS) telescope operated...
07/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
07/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
07/04/2026
Catgut Sound Owner and Production Sound Mixer Chris Welcker, CAS, has built a career at the intersection of music and film. A former musician and composer, Welc...
07/04/2026
SDVI Corporation today announced the next generation of its Rally media supply chain management platform, introducing a redesigned orchestration engine that rep...
07/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
07/04/2026
Frequency, the engine behind many of the world's leading streaming television channels, at NAB 2026 will be launching new Studio services to help content ow...
07/04/2026
Ikegami USA has chosen NAB 2026 in Las Vegas as the launch platform for new additions to its range of broadcast-quality television production equipment. These w...
07/04/2026
April 19, 2026, Las Vegas Kiloview, an innovative provider of AV-over-IP technologies, will showcase its latest broadcast IP solutions at NAB 2026, presenting...
07/04/2026
Bitmovin has announced support for Server-Guided Ad Insertion (SGAI) across its playback products using HLS interstitials, enabling more advanced ad-supported s...
07/04/2026
Synamedia is unveiling AI by Quortex at The NAB show, a just-in-time AI plugin framework that applies intelligence only when needed across video processing, dis...
07/04/2026
Cuez will showcase four additions to its cloud-based newsroom, rundown and automation platform at NAB Show 2026 (April 18 22, Las Vegas, Booth N1867):
Cuez ...
07/04/2026
CueScript to Showcase Innovations at NAB that Add Mobility Options, Ease Editing...
07/04/2026
Barix Extends Transport Options for Multi-Engine IP Encoder
Brie Clayton April 7, 2026
0 Comments
New for NAB, Barix adds SRT and RIST support to Mult...
07/04/2026
Elite Media Technologies Selects Interra Systems' BATON File-Based QC Soluti...
07/04/2026
Tightrope Media Systems to Debut Cablecast LiveBridge for Simultaneous Streaming...
07/04/2026
Cuez Brings Four New Innovations to NAB 2026: From Story-Centric Newsroom to Ope...
07/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
07/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
07/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...