
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 ...
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 -......
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...
27/10/2026
SES and CANAL have extended their partnership through 2040 with a multi-year agreement covering satellite capacity across Europe, Africa and the Caribbean.
Un...
27/10/2026
Gravity Media deployed a flypack production system and RF cameras for Red Bull R...
27/10/2026
Appear has announced that NSC TV, a TV Globo affiliate in Brazil, has selected t...
27/10/2026
MLB's Ryan Zander discusses the league's work to integrate the ABS Chall...
27/10/2026
Pictured: Filmmaker Vero Kompalic (Photo by Gia Rigoli)
By Vero Kompalic
This is the last picture I ever took in Venezuela.
I had seen the girl in the row ah...
27/10/2026
Olivia Wilde, Seth Rogen, Pen lope Cruz, and Edward Norton appear in The Invite...
27/10/2026
Popular compressor plug-in upgraded
Soundevice Digital have just released a new plug-in that builds on the success of their much-loved Royal Compressor. Ava...
27/10/2026
First closed-back headphone design unveiled
ADAM Audio's second pair of headphones have just been announced, introducing a flagship open-back design tha...
27/10/2026
Popular soft synth overhauled
Native Instruments have just announced the launch of Massive XL, the latest version of their hugely popular flagship soft synt...
27/10/2026
SBS celebrates the colour, culture and joy of the Festivals of Lights with all A...
27/10/2026
Rohde & Schwarz at electronica 2026: From everyday bench work to extraordinary t...
27/10/2026
This note is to provide clarification to a previous distributed press release from NBC.
Game 1 of the WNBA Finals between Atlanta and Golden State delivered 1....
27/10/2026
aconnic AG (ISIN: DE000A0LBKW6), Munich, is prolongin an existing debt financing...
27/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/10/2026
First 20 channels move to software-defined playout as TSA considers the requirements of almost 40 additional Movistar Plus linear services.
Telef nica Servici...
27/10/2026
Bitcentral, a news production and media workflow technology company, today announced Fusion MediaShare, a cloud-native service that helps station groups discove...
27/10/2026
Amagi, the media industry cloud company, today announced that KT Studio Genie (KTSG), the content subsidiary of KT Corporation, has completed a zero-downtime mi...
27/10/2026
Philippe Mercier, CAS, Captures Explosive Drama and Fast-Paced Action for Qu b c...
27/10/2026
Sfoor Labs releases 37 audio plugins for Windows, including five free effects
Brie Clayton October 27, 2026
0 Comments
Sfoor Labs has released Windows...
27/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/10/2026
Pebble, the leading automation, content management and integrated channel specialist, is building on a successful CABSAT 2026, with major customer projects, new...
27/10/2026
Limecraft today announces version 2026.7 of its cloud-based media production and delivery platform, introducing a Workflow Library, expanded AI-assisted transcr...
27/10/2026
X5 and X20 platforms connect six locations across Santa Catarina, enabling resilient IP distribution and centralised broadcasting operations
Appear ASA (Appear...
27/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/10/2026
Set in the 72 hours leading up to D Day, Pressure is a tense historical drama starring Brendan Fraser as Supreme Allied Commander Dwight Eisenhower and Andrew...
27/10/2026
Tuesday 27 October 2026
Sky announces new stand-up comedy showcase series John ...