
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 ...
27/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/10/2026
Set in the 72 hours leading up to D Day, Pressure is a tense historical drama starring Brendan Fraser as Supreme Allied Commander Dwight Eisenhower and Andrew...
26/10/2026
In-venue and creative video staffers at the professional and collegiate level ha...
26/10/2026
The company helps content owners take advantage of the burgeoning FAST business to give viewers more choices
Amagi EVP, Global Sales, SaaS, Dan Marshall has se...
26/10/2026
Behind The Mic provides a roundup of recent news regarding on-air talent, includ...
26/10/2026
Diversified has launched Google Beam demo centers in Los Angeles, Chicago, Nashville and Newark. The centers let businesses try HP Dimension with Google Beam, a...
26/10/2026
Indian news broadcaster NDTV has adopted Amagi's AdFlow Orchestrator to improve channel performance on FAST (Free Ad-supported Streaming TV) and Connected T...
26/10/2026
TEGNA and the Houston Comets have announced a multi-year partnership making KHOU...
26/10/2026
The San Antonio Spurs have named Sinclair Broadcast Group their new over-the-air media partner, bringing Spurs basketball to local fans beginning with the 2026-...
26/10/2026
FOX Sports will mark Veterans Day weekend with two days of NFL and college footb...
26/10/2026
DIRECTV has signed a multi-year distribution agreement with the NHL for four tea...
26/10/2026
How does NBC Sports manage transmission operations for the Super Bowl, Winter Ol...
26/10/2026
University of Texas Athletics and the Business of Sports Institute (BOSI) in the...
26/10/2026
Classmates at Ithaca College and in the Game Creek Video Apprenticeship Program,...
26/10/2026
NAB Show New York and the SMPTE Summit will co-locate at the Javits Center in 2027, bringing together two leading events serving the media and entertainment ind...
26/10/2026
A 10-person team at American Family Field is supporting live game and studio pro...
26/10/2026
Combining four plug-ins aimed at vocal and dialogue work
NoiseWorks Audio have announced the Complete Bundle, a collection which brings together VoiceAssist...
26/10/2026
Boasts improved A-D & D-A specs
RME's flagship converter and headphone amp has just been treated to an upgrade that introduces redesigned converter circ...
26/10/2026
The company has partnered with the telecom provider lcom to launch Play , its n...
26/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
26/10/2026
NASHVILLE, OCTOBER 26, 2026 NUGEN Audio has launched VisLM 3, the newest generation of its award-winning loudness metering solution, ahead of AES Show 2026: N...
26/10/2026
CaptionX Launches Clips: Turns Long Videos Into Shorts, Working Entirely From th...
26/10/2026
Horror Film Killer Rental Shot with Blackmagic Design Cameras
Brie Clayton October 26, 2026
0 Comments
Genre mixing film shot with eight URSA Mini Pro...
26/10/2026
PlottoFilm puts script breakdown, storyboards and AI shot generation in one brow...
26/10/2026
NUGEN Audio VisLM 3 Delivers an Array of Tools to Help Professionals Adapt to Ev...
26/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
26/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
26/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
26/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
26/10/2026
YouView joins ChangeTheFace to help advance inclusion in technologyOct 26, 2026
Building a more inclusive technology industry takes shared action. That's w...
26/10/2026
YouView celebrates double CSI Awards win with EE TVOct 26, 2026
We're delighted to celebrate EE TV's success at the 2026 CSI Awards, picking up two pre...
26/10/2026
The multi-award-winning comedy from acclaimed director Michael Winterbottom retu...
26/10/2026
As the EU-Mercosur agreement moves closer to implementation, creating one of the world's largest trading areas, much of the focus has been on tariffs. But a...
26/10/2026
Toru , Poland
2026 FilmLight Colour Awards Winners Ceremony Sunday 8 November, 4pm
Seminar Room
Join us along with special guests to celebrate the 2026 FilmL...
26/10/2026
Comscore to Announce Third Quarter 2026 Financial ResultsRESTON, VA, Oct 26, 2026 Comscore, Inc. (Nasdaq: SCOR), a trusted partner for planning, transacting a...
26/10/2026
CUPERTINO, CALIFORNIA Apple today unveiled the all-new iPad mini, featuring a st...
25/10/2026
New 76-key model joins the CK61 and CK88
Yamaha have added a third model to their CK range of portable stage keyboards with the CK76. This brings a 76-key o...
25/10/2026
Do Not Play It By Ear: Next The PrePros Will Focus On All Things Music & Sound
Brie Clayton October 25, 2026
0 Comments
Panel Features Sonic Union, 72...
25/10/2026
Zebra Streaming Equips OB Truck with Blackmagic Design
Brie Clayton October 25, 2026
0 Comments
Designed to scale, the unit packs a range of gear to d...
24/10/2026
Added to the broadcast lineup are 4K and 8K Nucleus cameras, more AR initiatives, two aerial drones, a fleet of high-speed cameras
FOX Sports will broadcast Ga...
24/10/2026
By Ramona Flume
For members of the LGBTQ community around the world, love can ...
24/10/2026
Creative morphing multi-effects with X-Y control
Sample Logic have launched Quadra, a multi-effects plug-in built around an X-Y pad that blends between four...
24/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
24/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
24/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
24/10/2026
Hit Horror Film Buddy Created with DaVinci Resolve Studio
Brie Clayton October 23, 2026
0 Comments
Colorist Sam Daley created authentic 90s kids'...