
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/08/2026
Dalet, a leading technology and service provider for media-rich organizations, t...
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...
19/05/2026
The winner of Thomson Foundation's Young Journalist of the Year 2025, Tracy Bonareri Onchoke, and runner up Wangu Kanuri enjoyed a three-day trip to London ...
19/05/2026
Cisco and the USGA have announced a multiyear extension of their partnership, which began in 2018. Cisco serves as the Official Technology Partner of the USGA, ...
19/05/2026
Urban Edge Network (UEN), a streaming platform for NAIA sports, has announced a partnership with Spiideo to provide streaming and production tools to UEN's ...
19/05/2026
Warner Bros. Discovery (WBD) will provide live coverage of all 900 Roland-Garros matches across its platforms beginning with qualifiers on May 18. In Europe, 21...
19/05/2026
Tubi, Fox Corporation's free streaming service, has announced the launch of the FIFA World Cup 2026 FOX Hub, a dedicated destination for World Cup programmi...
19/05/2026
Telef nica, in collaboration with Sony, has conducted a 5G connectivity trial at the Movistar Arena in Spain using the 26 GHz millimetre wave (mmWave) band. The...
19/05/2026
Ross Production Services (RPS) has installed a Calrec Argo M console into its new Hypermax-1 remote production truck, replacing one of three Argo S consoles pre...
19/05/2026
Panasonic Projector and Display Corporation has announced the acquisition of 100% of the shares of UK-based media technology company Hive Media Control Ltd. (HI...
19/05/2026
Globecast has announced the completion of a nine-month renovation of its Singapore facility, converting it from a traditional linear broadcast operation into a ...
19/05/2026
Grass Valley has announced a three-year enterprise agreement with Phoenix Broadc...
19/05/2026
Bitmovin has announced that Watch Brasil, a streaming platform operating across Brazil and Europe since 2018, has replaced its legacy systems with Bitmovin'...
19/05/2026
Ateme has announced the migration of Dish Home Nepal's Nepal Premier League (NPL) streaming infrastructure to Ateme's TITAN Live solution deployed on Ak...
19/05/2026
CMSI provided workflow, media management, and HDR support for ESPN during coverage of the NCAA Gymnastics Semifinals and Championships. The company supported fi...
19/05/2026
In advance of this year's Sports Emmy Awards, SVG is taking a deep dive into the six production-technologies nominated for this year's George Wensel Tec...
19/05/2026
In advance of this year's Sports Emmy Awards, SVG is taking a deep dive into the six production-technologies nominated for this year's George Wensel Tec...
19/05/2026
Featuring a fully IP infrastructure, Supershooter 11 is intended for large-scale events. Enabling remote and distributed workflows, Supershooter 65 joins the RE...
19/05/2026
By Jessica Herndon
The line wrapped around the building outside Denver's La...
19/05/2026
Podcasting continues to evolve, and so does Spotify. As we build what comes next, one thing remains constant: This is a medium built on connection. It lives in ...
19/05/2026
Popular design joins Inherit cartridge line-up
When GC Audio introduced their modular Inherit system, it was available with a selection of the company's...
19/05/2026
Resonance-suppression plug-in gets ground-up rebuild
Following on from its 10-year anniversary, oeksound's flagship plug-in has just reached its third m...
19/05/2026
Dedicated FL Studio controller keyboard range refreshed
Novation's dedicated FL Studio controller family has just been upgraded, with four new models ex...
19/05/2026
Rohde & schwarz strengthens its in-vehicle networks test portfolio with the laun...
19/05/2026
Lawful Intelligence: Rohde & Schwarz stellt neues Portfolio f r moderne Polizeia...
19/05/2026
Press Release
18 May 2026, Johannesburg South Africa has been selected as the...
19/05/2026
When all companies in the market are allowed to compete under the same set of ru...
19/05/2026
Battle-proven technology withstands electronic warfare threats across air, maritime surface and subsea domains....
19/05/2026
WESCAM MX-Series EO/IR systems provide high-precision targeting across domains, including counter-UAS applications...
19/05/2026
Champaign, IL - March 16, 2026 Cobalt Digital, the leading designer and manufa...
19/05/2026
CHAMPAIGN, Ill. April 16, 2026 - Cobalt Digital today announced a partnership ...
19/05/2026
Las Vegas - April 18, 2026 Cobalt Digital, the leading designer and manufactur...
19/05/2026
LAS VEGAS April 18, 2026 - Advanced HDR by Technicolor and Cobalt Digital are ...
19/05/2026
LAS VEGAS - May 4, 2026 - Cobalt Digital, the leading designer and manufacturer of signal processing products, and a founding partner in the openGear initiativ...
19/05/2026
London - 11 May 2026 Cobalt Digital, the leading designer and manufacturer of award-winning signal processing products, and a founding partner in the openGear...
19/05/2026
eds3_5_jq(document).ready(function($) { $(#eds_sliderM519).chameleonSlider_2_1({ content_source:......
19/05/2026
Celebrating its ability to quickly adapt to changing requirements, Ross Production Services (RPS) has put its flexible infrastructure to good use, switching one...
19/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
19/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
19/05/2026
Grass Valley has entered into a three-year enterprise agreement with Phoenix Broadcast Solutions as the Singapore-based company expands its live production oper...
19/05/2026
Clear-Com supported Musikal Perahu Kertas, a large-scale musical theater production in Indonesia adapted from the acclaimed novel by Dee Lestari, through the d...
19/05/2026
Actus Digital, a LiveU company, and a leading provider of intelligent media monitoring and broadcast compliance platforms, announced today that METEO CONSULT ha...
19/05/2026
Globecast, a leading provider of managed services for the broadcast and media industry, today announced the completion of a major renovation of its Singapore fa...
19/05/2026
Following a major upgrade to its Connecticut remote production centre with the installation of three 60-fader Argo S consoles in 2023, RPS has switched one of t...
19/05/2026
PlayBox Technology today announced the launch of Celebro Play, a browser-based media orchestration platform designed specifically for broadcast facilities and p...
19/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
19/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
19/05/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...