
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 ...
29/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/10/2026
amaran, pioneer of lighting tools for creators, today announced the amaran Cam, its first webcam designed to go beyond simply capturing an image to help creator...
28/10/2026
SDI Failsafe IP Routing: Inside the UTAH-400 Series 2 Router A pure-IP routing core has no inherent fallback. When the ST 2110 network degrades, when the PTP gr...
28/10/2026
MLB Network is nearly all-day media day coverage across MLB Now, MLB Central, ML...
28/10/2026
Voyage Audio and Shure microphones are in the forefront of the sector's transition to digital
Microphones may have come late to the digital table, but they...
28/10/2026
Having long resisted the transition, broadcast audio's most fundamental element is finally entering the digital era
About 25 years ago, a microphone manufa...
28/10/2026
The Wireless Microphone Spectrum Alliance (WMSA), formed in 2025 to raise awareness with government entities about wireless microphone operations, has held meet...
28/10/2026
Telos Aliiance was at the recently held IBC in Amsterdam once again representing its brands which include Axia Audio, Omnia Audio, Telos Systems, 25-Seven Syste...
28/10/2026
SPORTEL Monaco 2026 wrapped up three days of high-level business, international ...
28/10/2026
By Ramona Flume
One of the most exciting things about the Sundance Film Festiva...
28/10/2026
By Jessica Herndon
One of the most exciting things about the Sundance Film Fest...
28/10/2026
Co-Presented by Letterboxd
BOULDER, Colorado, October 21, 2026 - The nonprofit Sundance Institute announced today the Legacy program for the 2027 Sundance Film...
28/10/2026
Two full-range, flat-response amps revealed
Moog's latest announcement may come as a bit of a surprise to many, as rather than introducing a new synth, ...
28/10/2026
Annual event returns for 12th year in Bristol, UK
Returning for its 12th year, the annual Audio Developer Conference is set to take place between 9-11 Novem...
28/10/2026
Automation updates, Dim Solo mode, multiple Marker Tracks, MIDI 2.0 support & much more
The latest version of Fender's DAW software has just arrived, de...
28/10/2026
Combines tuning & harmony generation
Klevgrand's latest release offers a simplified take on Altitude, the pitch-correction and harmony-generation plug-i...
28/10/2026
Digital Originals backs the next wave of Australian screen talent
28 October, 2026
Media releases
SBS, National Indigenous Television (NITV) and Screen Aus...
28/10/2026
Behind every jinx is a story: Comedian Ting Lim takes a light-hearted look at su...
28/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/10/2026
Sift Clips Now Searches Frame.io Footage
Brie Clayton October 28, 2026
0 Comments
Frame.io search has now been added to Sift Clips. This new feature l...
28/10/2026
Choco Film Adopts DaVinci Resolve Studio and Blackmagic Cloud for Its Editing Wo...
28/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/10/2026
Rise AV has announced the 23 women selected for its 2026 Elevate programme, bringing together professionals from 20 organisations across the UK, Ireland, German...
28/10/2026
MTV Oy, Finland's largest commercial broadcaster, has long been recognized for its ability to deliver fast, reliable and engaging content across news, curre...
28/10/2026
LA JOLLA, CA-The shifty hepatitis C virus (HCV) has a knack for outmaneuvering t...
28/10/2026
Digital Originals backs the next wave of Australian screen talent 28 October 2026
2026 Digital Originals cohort. Photo credit: Teniola Komolafe.
SBS, National...
28/10/2026
COW Jobs: Managing Video Editor - Remote
Brie Clayton October 27, 2026
0 Comments
Managing Video Editor
October 27, 2026COW Jobs: Production......
28/10/2026
COW Jobs: Production Manager
Brie Clayton October 27, 2026
0 Comments
Production Manager
October 27, 2026COW Jobs: Managing Video Editor -......
28/10/2026
Wednesday 28 October 2026
Claire Goodlass joins Sky as Commissioning Editor, Documentaries
Sky has appointed Claire Goodlass as Commissioning Editor, Document...
28/10/2026
Proximic by Comscore Expands Integration Across Magnites CTV Ecosystem First real-time contextual integration across Magnite SpringServe connects audience int...
28/10/2026
NVIDIA RTX Spark powers thin and light laptops built for everything that developers, creators and gamers do.
RTX Spark laptops are now available from ASUS, Del...
28/10/2026
RT is developing its next Statement of Strategy and wants to hear the views of people across Ireland the audience we serve. RT New Direction remains RT '...
27/10/2026
Satellite, bonded cellular, and IP- and cloud-based solutions. Those are three o...
27/10/2026
Eutelsat has renewed its partnership with Qatar Media Corporation (QMC), Qatar...
27/10/2026
PROTON Camera Innovations GmbH will show the PROTON FLEXY at SATIS 2026 (Booth A13-B12), after the camera won a Best in Market award in the ProAV category at IB...
27/10/2026
ATSC, the Broadcast Standards Association, has reported results from a laboratory validation and live demonstration in Brazil of interference cancellation and s...
27/10/2026
The PGA Tour announced Monday that Brian Gordon has joined PGA Tour Studios as executive producer and head of live content. He began with the Tour on Oct. 26 an...
27/10/2026
The NBA has announced agreements to establish a framework for NBA-related predic...
27/10/2026
Apple Music, the NFL and Roc Nation have announced that JAY-Z will perform at the Apple Music Super Bowl LXI Halftime Show at SoFi Stadium in Los Angeles on Sun...
27/10/2026
DIRECTV and DAZN have signed a multi-year distribution agreement for local telec...
27/10/2026
The NHL has announced NHL Monday Night Hockey, a new initiative that will bring 11 live NHL games to fans across Europe in local primetime windows on Monday nig...
27/10/2026
Telef nica Servicios Audiovisuales (TSA) has deployed Grass Valley AMPP for Movi...