
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 ...
04/08/2026
Dalet, a leading technology and service provider for media-rich organizations, t...
04/07/2026
April 7 2026, 19:00 (PDT) Detective Conan: Fallen Angel of the Highway Opens in...
06/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
06/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
06/06/2026
Matrox Video today announced the launch of the Matrox Maevex MGX Series, a new lineup of IPMX-ready video encoders and decoders with USB support that is enginee...
06/06/2026
Atomos (booth# S1006) announced immediate availability of Sumo PRO-19, a new 19-inch 4K HDR monitor-recorder-switcher designed as a central production hub for m...
06/06/2026
Cine Gear Expo 2026 DoPchoice introduces a complete light-shaping system for the new Creamsource Vortex2, further expanding the fixture's wide versatility...
06/06/2026
SmallHD will debut a new OLED 4K production monitor with a 16 display, the OLED 16, that combines OLED's industry-benchmark contrast ratio, exceptional col...
06/06/2026
Ed Lachman ASC, Caleb Deschanel ASC, and M. David Mullen ASC Being Honored at the 30th Annual Cine Gear Expo LA
Cine Gear Expo has announced the recipients of ...
06/06/2026
World premiere at Cine Gear Expo Los Angeles, June 5-6...
06/06/2026
See it first at Cine Gear Expo LA, Booth #S1703
DoPchoice introduces the latest addition to its inflatable AIRGLOW series the 8 2 Frame for RuPixel Canvas. ...
05/06/2026
The university-wide initiative has pushed their creative content to a new level
Although collegiate athletics at a single institution can contain numerous spo...
05/06/2026
In-venue and creative video staffers at the professional and collegiate level ha...
05/06/2026
Synamedia has announced that Lumine Group has agreed to acquire its Video Network business. The company is positioning the transition as the start of a new phas...
05/06/2026
Ateme, Broadcasting Center Europe (BCE), and Scaleway have announced a strategic partnership to deliver a cloud-based media supply chain covering ingest through...
05/06/2026
Audinate has announced three new additions to its Dante AVIO Install adapter series: a 4-Channel Analog Input, a 4-Channel Analog Output, and a 2-Ch In/2-Ch Out...
05/06/2026
Sportradar Group AG has announced a multi-year extension of its exclusive global...
05/06/2026
The M6 Group will broadcast FIFA World Cup 2026 matches live and in Ultra High D...
05/06/2026
The Athletic has announced that PGA TOUR highlights will be integrated into its golf coverage beginning with the Memorial Tournament presented by Workday. PGA T...
05/06/2026
When the FIFA World Cup arrives in North America in 2026, it will bring more tha...
05/06/2026
FIFA and DAZN have announced the launch of FIFA exclusively on DAZN, consolidating FIFA's content portfolio within DAZN's sports platform. The move fol...
05/06/2026
Telemundo's exclusive Spanish-language coverage of the FIFA World Cup 2026 G...
05/06/2026
Dolby Laboratories and NBCUniversal have announced that Peacock will stream Tele...
05/06/2026
Formula 1 has announced a 10-year extension to keep the Las Vegas Grand Prix on the F1 calendar through 2037. Las Vegas Grand Prix, Inc., Clark County, and the ...
05/06/2026
The broadcast-engineering team overcomes wind, speed, and salt water - and dista...
05/06/2026
Deploying both onsite and remote crews, the company is providing calibrated-came...
05/06/2026
With Inter&Co Stadium unavailable, ESPN's UFL team rebuilt its broadcast pla...
05/06/2026
One of the most exciting and informative events on the SVG annual event calendar is the Regional Sports Production Summit, an annual gathering of industry profe...
05/06/2026
For the race's third year at the historic racetrack, the broadcaster has added cameras and will incorporate multiple drones
The 158th edition of the Belmon...
05/06/2026
Ratings Roundup is a rundown of recent rating news and is derived from press rel...
05/06/2026
Built from the same recordings as flagship library
Sonuscore's LUX Orchestral Strings has been met with widespread praise since its launch in late 2025,...
05/06/2026
High-end converter, interface & headphone amp upgraded
Said to represent the next evolution of RME's all-in-one reference converter concept, the all-new...
05/06/2026
Win a Soundgas Type 636P & Type G preamps
Soundgas, one of the UK's leading vintage and boutique audio equipment specialists have just announced the lau...
05/06/2026
New leadership of Technology Systems Division at Rohde & Schwarz On July 1, 2026, Hansj rg Herrbold and Andreas H gele will take over as Executive Vice Presid...
05/06/2026
Hitachi and Intel announced a strategic collaboration to explore opportunities t...
05/06/2026
MRI-Simmons and S&P Global Mobility are expanding advanced audience capabilities...
05/06/2026
New Nielsen data shows insurance ad spend grew 11%, while consumers remain highl...
05/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
05/06/2026
ASG Promotes Joe Marchitto to Western Regional CTO
Brie Clayton June 5, 2026
0 Comments
Appointment to Support Engineering Alignment and Client Experi...
05/06/2026
Stargate Studios Colombia Uses DaVinci Resolve Studio for Vertical Microdramas
Brie Clayton June 5, 2026
0 Comments
End to end post in one platform al...
05/06/2026
People Need to Come First When We Use AI
Andy Marken June 5, 2026
0 Comments
It's just surviving. Life's very existence requires destruction....
05/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
05/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
05/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
05/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
05/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
05/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
05/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
05/06/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...