
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 ...
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...
01/05/2026
January 5 2026, 18:30 (PST) NBCUniversal's Peacock to Be First Streamer to ...
01/04/2026
January 4 2026, 18:00 (PST) DOLBY AND DOUYIN EMPOWER THE NEXT GENERATON OF CREATORS WITH DOLBY VISION
Douyin Users Can Now Create And Share Videos With Stun...
17/01/2026
Lightware, an industry leader in signal management, is helping to elevate the Google Meet experience with the introduction of an integration with Taurus UCX. Th...
17/01/2026
Clear-Com announced a strategic partnership with NETGEAR AV to offer four high-performance networking switches as original equipment manufacturer (OEM) solutio...
17/01/2026
QuickLink, a leading provider of award-winning video production and remote guest contribution solutions, today announced a new U.S. distribution partnership wit...
17/01/2026
NUGEN Audio announces the latest evolution of MasterCheck, its industry-trusted optimization plug-in for cross-platform mastering and loudness verification. Des...
17/01/2026
BHV has announced that it will highlight its new SportsBox remote vision mixer and picture processor at ISE in Booth #4H900 marking its official introduction in...
17/01/2026
Clear-Com will return to ISE 2026 to demonstrate its latest intercom solutions for broadcast, live production, and AV professionals. Exhibiting at Stand #4P700...
17/01/2026
Grass Valley, a leading provider in live production solutions, will exhibit at ISE 2026 in Barcelona from February 3 6, presenting its vision for how modern Bro...
17/01/2026
Utelogy Corporation, the global leader in connected workplace management, monitoring, control, automation and analytics closes out a record-breaking 2025. The c...
17/01/2026
FOR-A, a cutting-edge video broadcast technology company backed by more than 50 years experience, will showcase its innovative production solutions at ISE 2026 ...
17/01/2026
Techex, the UK-based expert in live video solutions over IP and cloud, today announced that Tim Jackson has joined the company as Senior Director of Sales and B...
17/01/2026
Redflag AI, an AI-powered content protection platform, and Akamai, the cybersecurity and cloud computing company that powers and protects business online, today...
17/01/2026
Encompass Digital Media has today announced the appointment of David Hunter as Chief Operating Officer (COO). As a highly respected technology and operations le...
17/01/2026
Glensound is set to showcase its audio and intercom solutions supporting broadcast, live events and professional AV environments at ISE 2026 (stand 7H800, Fira ...
17/01/2026
As Matrox Video marks its 50th year of innovation, the company will use ISE 2026 to showcase the latest advancements across its AV-over-IP ecosystem, highlighti...
17/01/2026
The Hollywood Professional Association (HPA) today announced the nominees for the 2026 HPA Awards Innovation & Technology, marking an expanded evolution of the ...
17/01/2026
Share Share by:
Copy link
Facebook
X
Whatsapp
Pinterest
Flipboard...
16/01/2026
From Berlin to London: Amazon delivers NBA Europe games for an international aud...
16/01/2026
How Vizrt, TriCaster Helped Harvard Athletics Embrace Vertical Video and More to...
16/01/2026
SVG GameDay, Ep. 1: PMY Group's Mike BonnerThe longtime industry veteran provides insight into his approach to producing live eventsBy Kristian Hern ndez, S...
16/01/2026
Attacking the Pin: Inside the PGA TOUR's Replay Remodel With Hawk-Eye Innova...
16/01/2026
Back to Unrivaled: TNT Sports Reconnects With Mediapro for the League's Soph...
16/01/2026
FloSports Orchestrates Mega Weekend Spotlighted by Chili Bowl Nationals, UCA & U...
16/01/2026
Eleven Projects to Be Developed at Annual January Screenwriters Lab; Nine Projec...
16/01/2026
The start of a new year brings fresh possibilities. Whether you're diving in with big goals or simply setting new intentions, audiobooks can bring inspirati...
16/01/2026
In 2025 we launched the Spotify Partner Program to give creators more ways to tu...
16/01/2026
Share Share by:
Copy link
Facebook
X
Whatsapp
Pinterest
Flipboard...
16/01/2026
Marshall Electronics is showcasing its VMV-402-3GSH Seamless 4X Switch at ISE 2026 (Booth 4N900). Designed for presentation systems, control rooms and remote pr...
16/01/2026
Share Share by:
Copy link
Facebook
X
Whatsapp
Pinterest
Flipboard...
16/01/2026
Graduate Spotlight: Nadia Castagna The educator, who grew up in Rochester, New York, shares how she went from Berklee to collaborating on meaningful programs ...
16/01/2026
Back to All News
Culinary Class Wars' Returns for Season 3, Raising the St...
15/01/2026
Milano Cortina 2026: OBS CEO Yiannis Exarchos Previews Production InnovationsFirst Person View drones, AI-based tech target greater fan engagement, efficiencyBy...
15/01/2026
Clever with cameras: Bringing the drama of the 2026 ISU European Figure Skating ...
15/01/2026
No stranger to ice: Host broadcaster Sunset Vine on pressure and planning for th...
15/01/2026
SVG Campus Shot Callers: Leah Gill, Associate Athletic Director, Digital Media, ...
15/01/2026
National Sports Broadcaster Perspectives: What to Expect in Production in 2026Leaders from ESPN, FOX Sports, Netflix, and Warner Bros. Discovery share their pro...
15/01/2026
From Berlin to London: Amazon delivers NBA Europe games for an international aud...
15/01/2026
LOS ANGELES, CA, January 15, 2026 - The nonprofit Sundance Institute today announced the appointment of David Linde as Chief Executive Officer. Linde will assum...
15/01/2026
The SGL Carbon site in Bonn has a long tradition of training. For many years, young talent has been successfully trained here, regularly achieving excellent exa...
15/01/2026
The JEC Composites Innovation Awards annually honor the most innovative and ambi...
15/01/2026
X-energy Reactor Company, LLC ( X-energy ) and SGL Carbon LLC ( SGL ) have signed a 10-year framework agreement to provide graphite for the deployment of X-ener...
15/01/2026
Share Share by:
Copy link
Facebook
X
Whatsapp
Pinterest
Flipboard...
15/01/2026
Share Share by:
Copy link
Facebook
X
Whatsapp
Pinterest
Flipboard...
15/01/2026
Share Share by:
Copy link
Facebook
X
Whatsapp
Pinterest
Flipboard...
15/01/2026
Share Share by:
Copy link
Facebook
X
Whatsapp
Pinterest
Flipboard...
15/01/2026
Share Share by:
Copy link
Facebook
X
Whatsapp
Pinterest
Flipboard...
15/01/2026
Share Share by:
Copy link
Facebook
X
Whatsapp
Pinterest
Flipboard...