
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...
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 ...
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...
24/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
24/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
24/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
24/03/2026
Intinor introduces enhanced SRT monitoring, HDR transport and NDI Advanced suppo...
24/03/2026
Miri V410 Live 4K Encoder/Decoder to Make North American Debut at 2026 NAB Show
Brie Clayton March 23, 2026
0 Comments
Powerful new solution for strea...
23/03/2026
The Professional Fighters League (PFL) has renewed its multi-year partnership wi...
23/03/2026
The Snow League has named Google Cloud as its Official Cloud and AI Partner. The...
23/03/2026
Chyron has appointed Eric Wolff as Director of Venues Sales, North America. Wolff previously served as Director of Broadcast Operations & Media Production for T...
23/03/2026
Chicago Sports Network (CHSN) and Weigel Broadcasting's WCIU (The U, ch. 26.1) will simulcast 10 Chicago White Sox games during the 2026 season, the compani...
23/03/2026
Cosm has appointed Jon Werbeck as Vice President, Head of Sponsorships. He will report to Corey Breton, Head of Venues, and will focus on corporate sponsorship ...
23/03/2026
CP Communications has announced a partnership with Mark Roberts Motion Control (...
23/03/2026
NAB Show 2026, taking place April 18-22 (exhibits April 19-22) at the Las Vegas ...
23/03/2026
Bay FC and free streaming platform Victory have announced a partnership through...
23/03/2026
Gemini AI models will surface hidden context around pitches, matchups, rare stat...
23/03/2026
Behind The Mic provides a roundup of recent news regarding on-air talent, includ...
23/03/2026
Growing from broadcast engineer to strategic planner, this Ithaca College grad h...
23/03/2026
16 Science-Focused Nonfiction Projects Selected for Funding
LOS ANGELES, CA, March 23, 2026 - The nonprofit Sundance Institute and Sandbox Films announced toda...
23/03/2026
It's been 20 years since Miley Cyrus introduced the world to Hannah Montana,...
23/03/2026
Made entirely from real natural recordings
Aimed at sound designers and editors working in film, TV and game audio, the latest release from BOOM Library com...
23/03/2026
Transcribe sheets, tabs or MIDI from audio files
Klang.io have announced the launch of a new AI-powered software tool that's capable of detecting multip...
23/03/2026
An auxiliary target has been affixed to the Interim Cryogenic Propulsion Stage f...
23/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
23/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
23/03/2026
Pro8mm, the Super 8 experts, provided cameras, Super 8 movie film, and scanning services for Bruno Mars' Risk It All music video. The debut single from Br...
23/03/2026
Matthews, introduces their first aluminum grid clamp collection, engineered for the rigging needs of film, television and live production. Combining light weigh...
23/03/2026
Monday 23 March 2026
Hacks, the multi-Emmy -winning Sky Exclusive comedy, retur...
23/03/2026
Back to All News
Too Hot to Handle: Italy Reignites for a Second Season With th...
23/03/2026
Autonomous agents mark a new inflection point in AI. Systems are no longer limited to generating responses or reasoning through tasks. They can take action: Age...
23/03/2026
RT is sad today to learn of the death of legendary RT Sport broadcaster Michael Lyster, who died this morning aged 71 years.
Kevin Bakhurst, Director-General...
23/03/2026
RT Documentary On One has scooped its first ever dedicated music award. At the 2026 Icelandic Music Awards, composer lfur Eldj rn won Release of the Year in t...
23/03/2026
Inside Sport, Liveline, Morning Ireland and 2FM DRIVE will all be in Prague to bring fans to the heart of the action
Every Moment, Every GenerationRT | FIFA W...
22/03/2026
Free updates now available
VSL have just released some free updates that add some existing features to a selection of libraries in their expansive Synchron ...
22/03/2026
Back to All News
Live-Action Sins of Kujo' Premieres April 2: Main Trailer and Key Art Debut
Entertainment
22 March 2026
GlobalJapan
Link copied to cl...
21/03/2026
Presented to War Child UK's HELP(2) project
The MPG (Music Producers Guild) have announced the launch of the MPG Impact Award, a brand-new honour that w...
21/03/2026
Microtuning support for Arabic, Persian & Turkish scales
The latest release from Best Service brings together a selection of string, wind and percussion ins...
21/03/2026
New campaign from NAATI and SBS CulturalConnect highlights how we all deserve t...
21/03/2026
Statement regarding Rhoda Roberts AO
21 March, 2026
Media releases
SBS is deeply saddened by the passing of Widjabul Wia-bal woman from the Bundjalung Na...
21/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/03/2026
Cine Gear Connect NY, presented by Universal Production Services, is filling in the slate for a full day of panels, peers, learning the latest, and mixing it up...
21/03/2026
Studio Technologies Debuts New StudioComm System at NAB 2026
Brie Clayton March 20, 2026
0 Comments
StudioComm Model 794 Central Controller and Model ...