
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...
02/05/2026
Dalet, a leading technology and service provider for media-rich organizations, t...
01/05/2026
January 5 2026, 18:30 (PST) NBCUniversal's Peacock to Be First Streamer to ...
16/04/2026
Appear ASA (OSE: APR) will announce three additions to its X Platform at NAB Sho...
16/04/2026
Harmonic has announced that CentralCast, a centralized master control facility for U.S. public media, has deployed Harmonic's XOS Advanced Media Processor t...
16/04/2026
Interra Systems has announced that Encompass Digital Media has integrated its BA...
16/04/2026
Grass Valley will demonstrate its Media Infrastructure capabilities at NAB Show 2026 (Booth C2408, Central Hall), bringing routing, signal processing, and orche...
16/04/2026
As preparations ramp up for the FIFA World Cup 2026, Verizon has outlined a sweeping connectivity and infrastructure initiative that will underpin broadcast ope...
16/04/2026
Advanced Image Robotics (AIR) has announced its selection for the 2026 MLS Innovation Lab. AIR will work with MLS clubs, players, and executives on automated vi...
16/04/2026
JWX has announced the acquisition of True Anthem, an AI-powered social publishin...
16/04/2026
Jomboy Media and FuboTV Inc. have launched the Jomboy Media Channel, a 24/7 channel available to FuboTV base plan subscribers. The channel, timed to the start o...
16/04/2026
Wave Central, a Domo Broadcast Company (Booth C2820), and EVS Broadcast Equipmen...
16/04/2026
Tata Communications and Formula 1 have released Race Before the Race, the firs...
16/04/2026
DPA Microphones has released a firmware update for its N-Series Digital Wireless...
16/04/2026
Sony's Live Stage at NAB Show 2026 is the place to hear directly from the content creators, end users, and technology experts who are pushing boundaries in ...
16/04/2026
Perfect Game and Youth Prospects have announced a partnership covering broadcast...
16/04/2026
National Collegiate Rugby (NCR) has announced a media rights partnership with Al...
16/04/2026
Audio-Technica has announced two new mid-side (MS) stereo broadcast microphones:...
16/04/2026
PSSI Global Services has announced the acquisition of Beagle Networks, a provider of IT infrastructure and onsite technical support for media and enterprise cus...
16/04/2026
Blackmagic Design has released Blackmagic Camera for iOS 3.3, a free update available now from the Apple App Store. The update will be demonstrated at NAB Show ...
16/04/2026
As live sports production continues to expand across linear, digital, and in-ven...
16/04/2026
Part of an infrastructure upgrade, the recently constructed spaces accommodate n...
16/04/2026
NBC has added NEP's Supershooter 11, which only just came online in time for...
16/04/2026
At Spotify, we want your experience to feel intuitive and personal across every moment of the day. Whether you're streaming your favorite playlist while you...
16/04/2026
Vintage broadcast experts release second plug-in
Telsie T is the second plug-in to be released by SonicWorld, a German audio company who specialise in servi...
16/04/2026
Compact unit offers hands-on plug-in control
Softube have just announced the launch of their latest hardware unit, the Flow Studio. Housed in a compact desk...
16/04/2026
Use any VST3 plug-in on immersive audio
Fiedler Audio have just released a powerful new plug-in wrapper that brings full VST3 processing to Dolby Atmos and ...
16/04/2026
Analysis plug-in gains enhanced frequency readouts
Nugen Audio's real-time analysis plug-in has just received a significant update that introduces some ...
16/04/2026
Recording & Music Technology Show
Sound On Sound are pleased to announce a new recording and music technology exhibition taking place in London on Saturday ...
16/04/2026
SBS reveals all-star alumni team to celebrate 70 years of the Eurovision Song Co...
16/04/2026
For decades, understanding the physical world from space has required a trade-of...
16/04/2026
The integration accelerates demographic audience delivery across local markets a...
16/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
16/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
16/04/2026
Telestream Cloud Services, including Vantage Cloud, UP, and SENTRY monitoring tools, are now optimized for OCI, powering flexible multi-cloud media orchestratio...
16/04/2026
Fox Corporation (Nasdaq: FOXA, FOX; FOX or the Company ) today announced a strategic collaboration with Amazon Web Services (AWS), naming AWS as its preferre...
16/04/2026
Triveni Digital, a trusted leader in ATSC 1.0 and 3.0 service delivery, data broadcasting, and quality assurance solutions, today announced an ISDB-Tb capabilit...
16/04/2026
Synamedia and SoFast announce strategic go-to-market partnership to accelerate FAST, pay-TV, and VOD
At the NAB Show 2026, Synamedia and SoFast are announcing ...
16/04/2026
Showcases New, Open-Standard IP Solutions Across Its Portfolio, From Production to Playout
Imagine Communications is marking a decade of leadership in ST 2110 ...
16/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
16/04/2026
Sportway Media Group, a world leading AI-automated sports production company and Broadcast Solutions, a leading system integrator and provider of innovative sol...
16/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
16/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
16/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
16/04/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
16/04/2026
AJA Enters into Agreement to Acquire Video Encoding Software Company Comprimato
Brie Clayton April 15, 2026
0 Comments
Deal will expand AJA's video ...
16/04/2026
Deity Announces PR-4 Compact Field Recorder with Pre-Orders Launching April 14
Brie Clayton April 15, 2026
0 Comments
Deity Microphones today announce...