
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 ...
07/10/2026
Dalet, a leading technology and service provider for media-rich organizations, today announced the latest Long-Term Supported (LTS) release of Dalet Flex. Build...
06/09/2026
June 9 2026, 23:00 (PDT) Dolby and MagentaTV Bring Fans Closer to the FIFA Worl...
04/08/2026
Dalet, a leading technology and service provider for media-rich organizations, t...
29/07/2026
eds3_5_jq(document).ready(function($) { $(#eds_sliderM519).chameleonSlider_2_1({...
29/07/2026
Streaming Hits 48.6% of Total TV Usage in May
YouTube Leads in Media Distributo...
29/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/07/2026
Industry veteran joins Amagi to drive growth in Europe's leading broadcast market and advance cloud-native broadcast, FAST, and AI-driven operations.
LONDO...
29/07/2026
Work is ongoing to specify how to run RIST over WebTransport. This will deliver secure, stable, broadcast quality video playback and origination to any platform...
29/07/2026
Offline Files Makes the Drive Shelf Searchable on Mac
Brie Clayton July 29, 2026
0 Comments
A local Mac app for finding files, photos, and footage acr...
29/07/2026
Blackmagic Design Announces New UltraStudio Mini 12G
Brie Clayton July 29, 2026
0 Comments
New extremely portable Thunderbolt 4 capture and playback ...
29/07/2026
Brightline Lighting, a premier manufacturer of energy-efficient lighting systems for broadcast, videoconferencing, government, education and corporate applicati...
29/07/2026
Applications open for IFFI/WAVES Film Bazaar in Goa - Producer Delegation 28 July 2026
Image credit: Four Years Later
Screen Australia has opened applications...
29/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/07/2026
Foundry today announced that Academy Award-winning creative studio DNEG has implemented Hiero to support its editorial workflows. Part of the Nuke product famil...
29/07/2026
The Latest Addition to the Brand's StudioPro Ecosystem Combines Simple Deployment, Cloud Control and Professional Grade Wireless Reliability
QuickLink, a l...
29/07/2026
The Secret Master Adjustment Layer Hack in After Effects
Graham Quince July 28, 2026
0 Comments
Trish Meyer (who literally beta-tested the original Af...
29/07/2026
Post Completed with Blackmagic Cloud for Shane Kosugi's Feature Film SEEK
Brie Clayton July 28, 2026
0 Comments
Cannes Indie International Film Fe...
29/07/2026
Isabeau Miller Named Chair of Berklee Songwriting Department The Berklee alumna, who previously served on the Songwriting faculty, will begin her new role on ...
29/07/2026
RT launches Unsolved, a true crime podcast, presented by crime journalist Barry Cummins and presenter Katja Mia.
Unsolved is a weekly podcast exploring unsol...
28/07/2026
LiveU, the pioneer in IP-video transmission and cloud-based remote production, today detailed its historic performance records set during the 2026 FIFA World Cu...
28/07/2026
The NFL franchise rebuilt their off-site content operation for an era when teams...
28/07/2026
Longtime partners expand viewer choice, data-driven analysis, access, immersive ...
28/07/2026
There is a unique moment before every major production. The audience never sees it.
The cameras are ready. The talent is preparing. Directors review the final...
28/07/2026
The CW Network and ESPN have announced their highly anticipated streaming agreement to bring CW Sports' live events to the ESPN App will officially launch o...
28/07/2026
As more than tens of thousands of spectators filled Paris' Champ de Mars and...
28/07/2026
Appear's X Platform played a central role in Chile's first large-scale c...
28/07/2026
Responding to the broadcast industry's shift to embrace more flexible production platforms, Solid State Logic (SSL) is evolving its comprehensive System T p...
28/07/2026
Production leverages innovative camera technologies, AI, and data to capture the action in four-week inaugural competition
The first-ever professional dunking ...
28/07/2026
Prime Video to exclusively broadcast Wednesday night national NHL regular-season games in Canada...
28/07/2026
Every match will stream live on Paramount+ beginning in February,...
28/07/2026
Baxandall-inspired hardware EQ overhauled
TK Audio's Baxandall-inspired hardware EQ unit has just made a return, bringing the popular unit back into the...
28/07/2026
D700 system gains new live-focused rackmount surface
Asparion have just announced an expansion of their D700 control surface range, introducing a new model ...
28/07/2026
27 July 2026, Johannesburg - The National Film and Video Foundation (NFVF), an a...
28/07/2026
Ad Intel AI is Nielsen's first in a new generation of AI products built to t...
28/07/2026
Contribution to Europe's technological autonomy in the key industry telecommunications
aconnic AG (ISIN: DE000A0LBKW6), Munich, starts commercial shipments...
28/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/07/2026
Encompass Digital Media has been selected by Channel 4, one of the UK's public service broadcasters, to deliver managed linear playout services as part of a...
28/07/2026
Cinegy GmbH, the premier provider of software-defined television technology, has confirmed a new partnership with leading Korean systems integrator and distribu...
28/07/2026
Limecraft today announces version 2026.5 of its AI-powered production platform. Limecraft 2026.5 https://(www.limecraft.com/limecraft-2026-5-multicam-quad-view-...
28/07/2026
X Platform technology enabled a premium UHD viewing experience through a hybrid ground-to-cloud architecture developed with Chilevisi n, ClaroVTR and Pixop
App...
28/07/2026
LiveU, the pioneer in IP-video transmission and cloud-based remote production, today announced it has set historic performance records during the 2026 World Foo...
28/07/2026
dhd.audio announces that its latest generation firmware, Version 10.4, is now available to DHD customers. Version 10.4 introduces expanded configuration capabil...
28/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
28/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...