
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...
09/09/2026
Sony Electronics has announced the SEL814G, the company's first fisheye zoom G Lens for full-frame Alpha E-mount cameras. The lens will be available in Octo...
09/09/2026
Telestream has announced an expansion of its Practical AI capabilities across th...
09/09/2026
Haivision and Chyron have announced a technology partnership integrating Haivisi...
09/09/2026
Omaha Productions has released ManningCast: Heist, a short film featuring Peyton and Eli Manning attempting to break into NFL Commissioner Roger Goodell's o...
09/09/2026
Imagine Communications will demonstrate the next evolution of XVR at IBC2026 (Stand 1.B73, RAI Amsterdam, September 11-14).
XVR is Imagine's channel-in-a-b...
09/09/2026
swXtch.io has announced abbe, an AI-based orchestration layer for live media workflows, making its world premiere at IBC2026 (Meeting Room 5.MR13, Hall 5, Septe...
09/09/2026
NFL Films has announced the second season of Inside the NFL on X as an X Original, premiering Wednesday, September 9. The series marks Inside the NFL's 50th...
09/09/2026
LiveU has announced an expanded partnership with The Associated Press, deploying the largest fleet of LU900Q intelligent production units in the industry as par...
09/09/2026
Diversified has announced plans to consolidate its four existing New Jersey locations into a new facility in Newark, expected to be fully operational by the end...
09/09/2026
Wisycom will exhibit new RF products at IBC2026 (Stand 8.D60, September 11-14), including the MATF Wideband Antenna Matrix, PFL Portable RF over Fiber Box, and ...
09/09/2026
Guntermann & Drunck (G&D) and VuWall, both Panoptec companies, will introduce vsNEO at IBC2026 (Stand 8.B63, September 11, RAI Amsterdam). Pre-orders open in ea...
09/09/2026
Mo-Sys has completed a business restructuring and relocated to a new facility in Canada Water, London. As part of the reorganization, Selin Kemal has been promo...
09/09/2026
Aicox has integrated TAG Video Systems' Core monitoring platform into Telef nica's TSAmediaHUB audiovisual contribution and distribution infrastructure....
09/09/2026
Blackmagic Design has released DaVinci Resolve 21.1, a free update available now through the Blackmagic Design website. The release adds new AI tools, workflow ...
09/09/2026
ESPN and Apple Music have announced a collaboration on music curation for Monday...
09/09/2026
Sacramento Production Services has completed a wireless audio overhaul at Sutter Health Park, home of the Athletics during their three-year residency in Sacrame...
09/09/2026
NDI and NVIDIA have announced a collaboration to develop AI-powered workflows enabling broadcasters to create and distribute multilingual content from a single ...
09/09/2026
Christopher Chip Adams, Troy Aikman, Jim Dove, Jim Eady, Bucky Gunts, Robert A. Iger, Charlie Jablonski, Robert Kraft, Tom Rinaldi, and Dick Stockton to be ho...
09/09/2026
ND2 returns as the primary unit, While FNIA gets SSQC and new flexible Rover...
09/09/2026
New parts aimed at hip-hop and pop productions
The latest update to Celemony's innovative virtual session musician expands the collection of built-in in...
09/09/2026
Save up to 40% until 21 September 2026
Sonarworks are currently running their Autumn Sale, with discounts of up to 40% currently available across their rang...
09/09/2026
Upcoming title officially launches in September 2026
Bjooks' celebrations for this year's 909 Day will be welcome news amongst drum machine lovers, ...
09/09/2026
NITV to bring First Nations netball to audiences nationwide
9 September, 2026
Media releases
Every match of the 2026 First Nations Tournament will be live ...
09/09/2026
The National Film and Video Foundation (NFVF) invites eligible Tier 1 and 2 South African production companies to submit proposals to serve as the Facilitating ...
09/09/2026
Italy launch follows UK and Germany as Nielsen expands product across EMEA
Milan, Italy, September 9, 2026 - Nielsen, a global leader in audience measurement, ...
09/09/2026
Planned solutions tackle accuracy, cost and latency barriers to deploying AI at ...
09/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
09/09/2026
Studio Technologies, a leading manufacturer of high-quality audio, video, and fiber-optic solutions, introduces its new Model 791 Control Console at IBC 2026 (N...
09/09/2026
Maxon, maker of powerful, approachable software solutions for creators working in 2D and 3D design, motion graphics, visual effects and visualization, is headin...
09/09/2026
NUGEN Audio unveils DialogCheck v1.2, the latest evolution of its intelligent dialog intelligibility and compliance tool, at IBC 2026 (Pod P27). With a sharpene...
09/09/2026
Trusted Partner Network Launches Fix It or Risk It to Help the Entertainment Industry Tackle Everyday Security Risks
Industry-Wide Campaign Launches at IBC2...
09/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
09/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
09/09/2026
AI has moved firmly beyond experimentation in UK advertising, with more than eight in ten marketers (83%) now actively using or piloting AI in production, accor...
09/09/2026
IBC2026 - Stand 7.D22
At IBC2026, Pixitmedia by DataCore will showcase its latest capabilities designed to simplify distributed production, accelerate workflow...
09/09/2026
Stockholm, Sweden September 9th, 2026 At IBC2026, on booth 1.B47, Net Insight will showcase Open Live Media, its architecture for delivering resilient live ...
09/09/2026
Net Insight today announced that DMC Production Norway is continuing the use of its Open Live Media technology for premium European football, deploying Nimbra 5...
09/09/2026
Amagi, the media industry cloud platform for unified broadcast, streaming, and monetization, will showcase four new AI-native capabilities at IBC2026, Hall 5, S...
09/09/2026
Limecraft today announces version 2026.6 of its AI-powered production platform, extending capabilities for connected media operations. An AI-assisted approach t...
09/09/2026
Telestream, a global leader in media workflow technologies, today announced the next evolution of its Practical AI strategy, evolving its comprehensive portfoli...
09/09/2026
Dalet, a leading technology and service provider for media-rich organizations, today announced the appointment of Brian Doheny as Chief Executive Officer (CEO)....
09/09/2026
LiveU is now a Clarus Integrated Reseller, bringing Starlink's fast, reliable broadband directly into LiveU's cellular bonding EcoSystem through a singl...
09/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
09/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
09/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
09/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
09/09/2026
Wisycom is showcasing the latest additions to its ecosystem of professional RF technologies at IBC 2026 (Stand 8.D60). This includes its new MATF Wideband Anten...
09/09/2026
AMSTERDAM, IBC2026 VisualOn, Inc. and Cires21 today released an updated joint whitepaper at IBC 2026 demonstrating measurable, high-impact improvements in visu...