
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...
19/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
19/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
19/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
19/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
19/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
19/08/2026
Riedel Communications today announced that Edith Cowan University (ECU) in Perth, Australia, implemented a comprehensive communications infrastructure that brin...
19/08/2026
QuickLink, a leading provider of award-winning video production and remote guest contribution solutions, will spotlight a major leap forward in remote guest con...
19/08/2026
Integrated platform melds media asset management, playout automation and newsroom workflows
EMAM, PlayBox Neo and SNEWS have officially launched Nuvex, a conne...
19/08/2026
Screen Australia releases the Private Investment Toolkit to strengthen screen in...
19/08/2026
Do Aussies truly value local content? Unpacking Screen Currency 2026 with Deirdr...
18/08/2026
SportStream 2026, a free three-day virtual event, will take place September 15-17. One registration provides access to all three days of live programming and on...
18/08/2026
BeckTV will introduce BeckFlow to the European market at IBC2026, demonstrated on the Providius stand (10.F53).
BeckFlow is a web-based schematic documentation...
18/08/2026
Boland Communications will introduce a SMPTE ST 2110 input option for its 4K monitors at IBC2026, along with a new 55-inch super-narrow bezel display for video ...
18/08/2026
Dolby Laboratories and the Seattle Seahawks have announced a partnership integrating Dolby OptiView into the Seahawks' live streaming coverage, making the S...
18/08/2026
For BMG Executive Producer of Sports Production, Graham Taylor, producing live s...
18/08/2026
TMRW Sports has appointed Rufus Hack as President of Golf, a newly created role in which he will lead the company's golf businesses including TGL presented ...
18/08/2026
SMT will provide race technology for FOX Sports' coverage of the Freedom 250 Grand Prix of Washington, D.C. on August 23, when the NTT INDYCAR SERIES races ...
18/08/2026
The live, YouTube-native roundtables combine fan voices, credentialed reporters,...
18/08/2026
Behind The Mic provides a roundup of recent news regarding on-air talent, includ...
18/08/2026
The industry legend sounds off on replacing the Heat's iconic Medusa score...
18/08/2026
William F. Rasmussen, the sports fan-turned broadcaster and entrepreneur whose out-of-the-box idea of a 24-hour cable sports network, ESPN, changed forever the ...
18/08/2026
DAZN Group has completed its acquisition of ViewLift, a provider of streaming and digital solutions for sports content owners. The acquisition was first announc...
18/08/2026
The American Association of Professional Baseball (AAPB) has added SI TV, Sports Illustrated's 24/7 streaming channel, as a broadcast partner for the remain...
18/08/2026
The Esports Foundation has announced that the inaugural Esports Nations Cup (ENC), originally scheduled for November 2026 in Riyadh, will be postponed to Novemb...
18/08/2026
Diversified has announced a new Global Managed Services Practice, consolidating the company's managed services capabilities into one organization. Rob Mello...
18/08/2026
Appear has completed a proof of concept with Thoroughbred Racing Productions (TRP), demonstrating multi-camera remote live production over bonded 5G cellular an...
18/08/2026
Riedel Communications has announced that Edith Cowan University (ECU) in Perth, ...
18/08/2026
Company launch with stereo-imaging tool
Panoramic is the debut release from Panorama Labs, a new company formed by mastering engineer Nicholas Di Lorenzo. C...
18/08/2026
Control software now available for older interfaces
Focusrite have just announced the launch of an update that extends Control 2 software support their Scar...
18/08/2026
The National Film and Video Foundation (NFVF), an agency of the Department of Sp...
18/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
18/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
18/08/2026
Lightware announces an integration with SpectralBot that helps system integrators and AV operators troubleshoot faster using augmented reality (AR), AI-assisted...
18/08/2026
Command Frame for After Effects
Scott Black August 18, 2026
0 Comments
Free download, demonstrations, hands-on tests, and creator resources
Want to t...
18/08/2026
At Stand 14.A57, the data company will demonstrate GreenDot and IBM Aspera together, giving media and entertainment businesses real-time visibility of what thei...
18/08/2026
New tool provides a robust audit of operational workflows, calculating the tangible value each delivers today, and informing business decisions for tomorrow.
W...
18/08/2026
Media Utilities is integrating its activities into DigiNet and will maintain a recognisable presence in the market under the name: Media Utilities, a DigiNet br...
18/08/2026
Proof of Concept validates reliable multi-camera live production from remote racecourses without fixed network infrastructure
Appear ASA (Appear, OSE:APR), a g...
18/08/2026
Stingr, a new venture from the founders of Hornets Tech, is bringing its second-screen interaction platform to IBC2026.
The second screen has never really wor...
18/08/2026
Long-established satellite equipment manufacturer and systems integrator Hiltron Communications will promote its new HACUX-IDU2 antenna control unit touchscreen...
18/08/2026
EMAM, PlayBox Neo and SNEWS Launch Combined Nuvex System
Brie Clayton August 17, 2026
0 Comments
Integrated platform melds media asset management, pla...
18/08/2026
The United Stand Scales Live Fan Show with Blackmagic Design Workflow
Brie Clayton August 17, 2026
0 Comments
ATEM Constellation 8K and HyperDeck Stud...
18/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
18/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
18/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
18/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
18/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...