
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
11/12/2025
Dalet, a leading provider of cloud-native, end-to-end media workflow solutions, ...
13/11/2025
NASA and L3Harris conducted a full-duration RS-25 hot fire test Nov. 12 on the Fred Haise Test Stand at Stennis Space Center near Bay St. Louis, Mississippi, ma...
13/11/2025
eds3_5_jq(document).ready(function($) { $(#eds_sliderM519).chameleonSlider_2_1({...
13/11/2025
A groundbreaking new study by the BBC and the European Broadcasting Union (EBU) has found serious problems with news summaries generated by AI assistants....
13/11/2025
Luxembourg and Long Beach, CA, 12 November 2025 - SES, a leading space solutions company, announced today an extended multi-year, multi-launch services agreemen...
13/11/2025
NASHVILLE, Tenn. Field & Stream and Outdoor America have formed a strategic partnership to launch Field & Stream TV, rebranding Outdoor America's free ad-su...
13/11/2025
PHOENIX, Ariz. Silicondust has announced it is now an ATSC 3.0 Certificate Authority for NextGen TV and said that it is offering an Online Certificate Status Pr...
13/11/2025
NEW YORK Nielsen has announced that Peter Naylor, an ad sales executive who has worked at some of the largest media companies in the world, will be its first ch...
13/11/2025
PHILADELPHIA After more than 20 years at CBS Philadelphia and an award-winning career spanning nearly four decades, Jim Donovan, anchor of CBS News Philadelphia...
13/11/2025
BOSTON Frontline, PBS's investigative documentary series produced at GBH in Boston, has announced the newest class of partners for its Local Journalism Init...
13/11/2025
A groundbreaking new study by the BBC and the European Broadcasting Union (EBU) has found serious problems with news summaries generated by AI assistants....
13/11/2025
Legendary actor and proud Irishman Gabriel Byrne will be in studio this week to ...
13/11/2025
Tonight's crucial Republic of Ireland World Cup qualifier v Portugal at the ...
13/11/2025
In the fourth episode of The 2 Johnnies Late Night Lock In the lads are joined b...
13/11/2025
Chaos has entered the chat. It's GFN Thursday, and things are getting intense with the launch of Call of Duty: Black Ops 7, streaming at launch this week on...
12/11/2025
For me, no story is too small if it speaks to the ordinary Kenyan, says Wangu Kanuri, a multimedia journalist and contributor to the Nation Media Group working...
12/11/2025
Tracy Bonareri Onchoke is an investigative journalist from Kenya who strives to tell stories that amplify voices pushed to the margins' in her reports for ...
12/11/2025
Godwin Asediba who is an investigative journalist, producer and news anchor with TV3 and 3FM in Ghana, has received death threats for his work exposing injustic...
12/11/2025
SVG TranSPORT 2025: All Sessions Now Available to Watch on SVG PLAYEvent addressed the latest in live sports video contribution and distribution technologyBy SV...
12/11/2025
L-R: Ed Harris, Gyula Gazdag
Inaugural Robert Redford Luminary Award to Honor E...
12/11/2025
By Bailey Pennick
One of the most exciting things about the Sundance Film Festi...
12/11/2025
In 2023, Morgan Wallen made history when Last Night became the first solo coun...
12/11/2025
Calrec delivers future-focused production for Whisper Cymru at Wales's first-ever dedicated remote production hub Supporting a growing roster of live sports...
12/11/2025
LONDON, England November 11, 2025 - Blue Lucy, a leading provider of media management and workflow automation solutions, is pleased to announce the renewal o...
12/11/2025
ALAMEDA, Calif. Clear-Com says its communications gear was recently deployed for the ADAC RAVENOL 24h Race at Germany's N rburgring circuit, which set a rec...
12/11/2025
BRUSSELS Mediagenix has announced that it has joined the Amazon Web Services (AWS) Independent Software Vendor (ISV) Accelerate Program (ISV). This acceptance f...
12/11/2025
HUELVA, Spain Alfalite, Europe's only LED screen manufacturer, has announced a strategic partnership with Adistec Corp, a leading distributor of infrastruct...
12/11/2025
MONTREAL Stingray Group Inc. has announced that it has entered into a definitive agreement to acquire TuneIn Holdings, Inc. ( 'TuneIn''), a pioneer ...
12/11/2025
Vubiquity, an Amdocs company and global leader in technology-led media services, today announced it has achieved the Amazon Web Services (AWS) Media & Entertain...
12/11/2025
Over 200 upgraded sites now delivering 2G and 3G mobile data services to more th...
12/11/2025
NEW YORK and WASHINGTON DirecTV Advertising has launched DirecTV Elect, a new digital platform powered by AI that is specifically designed for political adverti...
12/11/2025
WASHINGTON Federal Communications Commission Chair Brendan Carr has weighed in on the blackout of ABC, ESPN and other Disney programming on YouTube TV with a po...
12/11/2025
12 Nov 2025
VEON Wins Corporate Governance Awards for Kyivstar Listing and Tech...
12/11/2025
GROWING DATA DEMAND CONTINUES TO BE THE MAIN DRIVER OF MAGYAR TELEKOM'S RESU...
12/11/2025
Wednesday 12 November 2025
Sky unveils first of its kind clean power system for film and TV production
Sky has today unveiled a major new clean energy system ...
12/11/2025
Back to All News
The Accident 2 Welcomes B rbara de Regil to the Cast and Premi...
12/11/2025
Wednesday 12th November - Bel m, Brazil - Today, leading organizations IEC, ISO and ULSE, initiators of the Standards Pavilion at UNFCCC COP30, published a join...
12/11/2025
Arvato Systems Becomes Preferred Business Partner of the German Bundesverband E-...
12/11/2025
RT Choice Music Prize
In association with IMRO and IRMA
2 0 2 6 K E Y D A T E S
Irish Album of the Year 2025 Shortlist 19th January
Irish Song of the ...
12/11/2025
In the age of AI reasoning, training smarter, more capable models is critical to scaling intelligence. Delivering the massive performance to meet this new age r...
12/11/2025
Parents jailed for over two years after bringing their daughter to hospital for ...
12/11/2025
Large language model (LLM)-based AI assistants are powerful productivity tools, but without the right context and information, they can struggle to provide nuan...
11/11/2025
SVG Sit-Down: How Pixellot's Automated-Production-Tech Stack Is Evolving in ...
11/11/2025
Introducing SVG's New Platinum White Papers' PlatformTop technology providers detail how they are innovating in sports productionBy SVG Staff
Tuesday...
11/11/2025
SVG All-Stars: Vanessa Lindsey, Senior Director, Technical and Remote Operations...
11/11/2025
Lesson Plan: How Big Ten Network's StudentU Produces Broadcast Pros - and 2,...
11/11/2025
Peacock Performance View Feature Now Available for All NBA Games on PeacockBy Jason Dachman, Editorial Director, U.S.
Tuesday, November 11, 2025 - 2:10 pm
P...
11/11/2025
Today, Spotify and the National Music Publishers' Association (NMPA) launche...
11/11/2025
This year, SGL Carbons Willich site is celebrating a special anniversary. For 30...
11/11/2025
Rural connectivity rising fast
Traditional media still matters
Rural Filipinos...