
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
09/11/2025
Dalet today announced a transformative leap forward for media operations: Agentic Artificial Intelligence (AI) that unifies the Dalet ecosystem under one natura...
06/11/2025
BRISTOL, Conn., and BOSTON ESPN and DraftKings today announced an agreement naming DraftKings the sports programmer's exclusive official sportsbook and odds...
06/11/2025
MELVILLE, N.Y. Canon USA has launched the CR-N400 and CR-N350, two new Pan-Tilt-Zoom (PTZ) cameras designed to deliver high image quality, versatile connectivit...
06/11/2025
NEW YORK Fox Sports said its coverage of the Los Angeles Dodgers' win over the Toronto Blue Jays in the decisive Game 7 of the 2025 World Series delivered 2...
06/11/2025
NEW YORK DoubleVerify and Roku, Inc. are reporting that they have seen a marked reduction in fraudulent ad requests imitating Roku device traffic across the s...
06/11/2025
CAMBRIDGE, England Faced with rising inflation and worries that the economy is weakening, consumers are prioritizing their spending on popular streaming service...
06/11/2025
STAMFORD, Conn. NBC Sports is mounting mics in unconventional places to bring the sounds of NASCAR into the living rooms of sports fans....
06/11/2025
BRANSON, Mo. Link Electronics has partnered with Aberdeen Broadcast Services to provide a real-time, dual-stream translation and captioning service....
06/11/2025
RT Announces Alex Walden as General Manager of the
RTE Concert Orchestra
Alex Walden, renowned orchestra manager, most recently for the BBC Concert Orche...
06/11/2025
Actors Steve Coogan and anna Hardwicke will be on the Late Late Show this week ...
06/11/2025
In the third episode of The 2 Johnnies Late Night Lock In actor Danny O'Carr...
06/11/2025
NVIDIA founder and CEO Jensen Huang and chief scientist Bill Dally were honored ...
06/11/2025
A crisp chill's in the air - and so is the action. GeForce NOW is packing November with 23 games hitting the cloud, including the launch of the highly antic...
06/11/2025
Scripps Research team identifies sugar molecules that trigger placental formation Study reveals how sugar-protein interactions are critical for the placenta dur...
05/11/2025
College Hoops Preview 2025: ESPN Remote-Ops Team Preps for Massive Slate of Men&...
05/11/2025
University of Iowa Centralizes Video Production With Dual Control Rooms at Carve...
05/11/2025
On Monday night, Ed Sheeran and Spotify lit up The Royal Dublin Society in Dublin for a one-night-only performance. The occasion? The third installment of Billi...
05/11/2025
Cumbia has long been woven into daily life in Argentina, and its popularity on S...
05/11/2025
La cumbia forma parte del d a a d a de los argentinos desde siempre, y su popula...
05/11/2025
Earlier this year, our in-house publishing imprint, Spotify Audiobooks, put out ...
05/11/2025
SBS showcases next generation of pro cyclists in extended broadcast deal with Pr...
05/11/2025
Photo credit: CIVMEC...
05/11/2025
A Nielsen survey of 500 directors and millions of monday.com workflows reveals t...
05/11/2025
Prime Video's VoD offerings included for the first time in standardized AGF Measurement
Frankfurt, October 28, 2025. AGF Videoforschung, together with Ama...
05/11/2025
A 13-year-old company that serves as a master control/disaster recovery hub for PBS stations says it has seen little financial impact from cuts to public broadc...
05/11/2025
To no one's surprise, the NFL's most dominant franchise in recent years attracts the most TV viewers, according to new research by S&P Global Market Int...
05/11/2025
MELBOURNE, Australia Atomos today introduced Ninja TX GO, a new HDMI monitor-recorder that combines a brighter screen, advanced monitoring tools, professional c...
05/11/2025
WASHINGTON Despite the ongoing government shutdown, Federal Communications Commission Chairman Brendan Carr has announced a tentative agenda for the agency'...
05/11/2025
The College Football Playoff (CFP), ESPN and TNT Sports have announced kick times and broadcast information for the 2025 CFP First Round, which will launch the ...
05/11/2025
NEW YORK IAB Tech Lab, the global digital advertising technical standards-setting body, has announced the release of device attestation support in the industry ...
05/11/2025
SINGAPORE Appear, an Oslo-based provider of live production technology, is opening a new facility in Singapore as part of the company's expansion into the A...
05/11/2025
DALLAS Parks Associates has released new data showing just how far the dramatic shift to streaming services has gone in recent years. Currently, more than nine ...
05/11/2025
Supports existing services while powering 16 new products for government and ent...
05/11/2025
Wednesday 5 November 2025
To view this content, please enable our use of cookie...
05/11/2025
Wednesday 5 November 2025
To view this content, please enable our use of cookie...
05/11/2025
Rohde & Schwarz Mobile Test Summit 2025 on the future of wireless communications...
05/11/2025
Wuppertal November 5, 2025
Riedel RefCam and Easy5G to Make Handball Debut at the Men's EHF EURO 2026The European Handball Federation (EHF) will introduce...
05/11/2025
Back to All News
Netflix's Third Season of Ads and a Look Ahead at Whats Next
Amy Reinhard
President, Advertising
Business
05 November 2025
United Sta...
05/11/2025
Comscore and Polaris I/O Partner to Automate Audience Insights in MarketView for...
05/11/2025
New schedule will be live on-air Monday 10 November
Brand-new Today with David McCullagh from 9am
Oliver Callan in all-new extended show from 11am to 1pm
Kie...
05/11/2025
Explore the future with Science Week on RT
Dive into a week of innovative, themed programming and content across RT television, radio and online
Includes a ...
05/11/2025
Get ready for six weeks of United FC, a brand-new, feel-good teen docuseries kic...
04/11/2025
SVG Sit-Down: Why Professional Fight League CEO John Martin Believes Growth Is I...
04/11/2025
SVG All-Stars: David Koppett, Executive Producer, Live Sports and Studio, NESN a...
04/11/2025
From concept to kick-off: How TAMS could transform sports workflows By Paul Markham
Tuesday, October 28, 2025 - 09:43
Print This Story
Techex tx darwin pr...
04/11/2025
College Hoops Preview 2025: The CW Tips Off Third Season of ACC Men's/Women&...
04/11/2025
College Hoops Preview 2025: Big Ten Network Heats Up for Busy Season With 500 Me...
04/11/2025
College Hoops Preview 2025: CBS Sports Readies 300+ Game Broadcasts Across Its P...
04/11/2025
College Hoops Preview 2025: NBC Sports Slate Features 200+ Big Ten, BIG EAST, an...
04/11/2025
College Hoops Preview 2025: ESPN Remote-Ops Team Preps for Massive Slate of 7,40...