
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 ...
02/12/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
02/12/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
02/12/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , er...
02/12/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
02/12/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
02/12/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
02/12/2026
Miris, a 3D streaming infrastructure provider, and Evercast, a leading provider of real-time media review tools, today announced the beta of an Evercast Present...
02/12/2026
QuickLink, the leading provider of multi-camera video productions and remote contribution solutions, announces the launch of StudioPro Ascent and StudioPro Ap...
01/12/2026
William Kamau, a journalist with the investigative media house Africa Uncensored in Nairobi, has been named Thomson Foundation Young Journalist of the Year 2026...
01/12/2026
Gravity Media has acquired MOOV, a UK broadcast graphics and virtual production ...
01/12/2026
Ateme and CAASTV have announced that PanMetro (Pan Metro Convergence) and Allian...
01/12/2026
CP Communications provided broadcast engineering and production support for Live With Kelly & Mark in Clearwater Beach, FL, Nov. 16-17.
A 10-person crew led by...
01/12/2026
Riedel Communications supported the Klangwolke festival in Linz with a DIVA+ infrastructure. On behalf of Linzer Veranstaltungsgesellschaft (LIVA), Riedel Manag...
01/12/2026
TF1, France's private broadcaster, has chosen Ateme as its technology partner for TF1 . Ateme supports the service on TF1's own apps, connected TVs, ope...
01/12/2026
The Alliance for IP Media Solutions (AIMS), together with the Video Services Forum (VSF) and the European Broadcasting Union (EBU), has announced the next IPMX ...
01/12/2026
Clark Wire & Cable supplied broadcast infrastructure cable, panels and SMPTE com...
01/12/2026
Over the past three decades, no sports entity has set a higher bar for storytell...
01/12/2026
Sports media has become one of the few reliable growth areas in an otherwise slu...
01/12/2026
Studio 61 will feature four production sets, more than 30 cameras, aerial systems, AR, and nearly 100 hours of live programming during Super Bowl week...
01/12/2026
On-site activation will use touchscreen inputs and Anamorph technology to assemb...
01/12/2026
ESPN Deportes has announced its commentary team for Super Bowl LXI: Rebeca Landa...
01/12/2026
With Super Bowl LXI 75 days away, ESPN and The Walt Disney Company have announce...
01/12/2026
ESPN and ABC will punctuate ESPN's Year of the Super Bowl with 10 hours of live programming from Disneyland Resort in Anaheim, CA, on Monday, Feb. 15, mere ...
01/12/2026
Five-hour Super Bowl LXI Countdown, multiple studio locations, Disney+ simulcast...
01/12/2026
As ESPN prepares for its historic first Super Bowl presentation, the network wil...
01/12/2026
Disney+, Hulu, and ESPN App will carry Live From Super Bowl LXI Red Carpet from the NFL VIP Tailgate at SoFi Stadium...
01/12/2026
To help determine where the industry stands, SVG AI Innovation Lab analyzed and ...
01/12/2026
Peyton Manning and Rich Eisen will host the hour-long ESPN Original, produced with NFL Films and The Montag Group...
01/12/2026
By Jason Dachman and Ken Kerschbaumer
ESPN today took some additional wraps off of its Super Bowl LXI plans, including more details about ESPN Beach will prese...
01/12/2026
Audio inputs, backing playback, PDF support & more
In the April 2026 issue, we ran a review on StageBox, a handy macOS and Windows application designed to h...
01/12/2026
Three new high-gain amps added
Universal Audio's all-in-one amp and effects modelling software has just been treated to a major update that introduces t...
01/12/2026
Innovative instrument gains virtual counterpart
Telepathic Instruments have just released a new plug-in that recreates their innovative Orchid instrument, a...
01/12/2026
Vintage-inspired effects suite revealed
Waves latest release brings together a set of creative effects plug-ins that promise to capture the sound and charac...
01/12/2026
Rohde & Schwarz and Zurich Instruments back the London Quantum Cluster to suppor...
01/12/2026
Nielsen has released its Top 25 Live Sports Events Telecasts ranker for the week of November 16 - November 22. The list highlights a dynamic week in sports broa...
01/12/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
01/12/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
01/12/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
01/12/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
01/12/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
01/12/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
01/12/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
01/12/2026
Framecastics encoding, decoding and IP streaming solutions now available through Hornets Tech, with specialist engineering support...
01/12/2026
Brussels, Belgium December 1, 2026 Mediagenix, a global leader in smart content solutions to profitably connect the right content to the right audience, tod...
01/12/2026
Hollywood Editor Develops Free VFX Screen Tracking App
Christopher W. Hill December 1, 2026
0 Comments
I've been working in Hollywood as an editor...
01/12/2026
Clear Life Media Creates Youth Sports Streaming with Blackmagic Design
Brie Clayton December 1, 2026
0 Comments
Company creates profitable live multic...
01/12/2026
Unreal Engine & Blender Inside After Effects? Shot Link Plugin Review
Graham Quince December 1, 2026
0 Comments
I found a plugin which lets you bring ...
01/12/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
01/12/2026
Partnership delivers personalized viewing experiences and premium advertising experiences across Latin America
Broadpeak , a leader in streaming and monetizati...