
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...
04/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
04/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
04/09/2026
ACEMAGIC First to Introduce Ryzen AI Max PRO 495 AI Mini Workstation at IFA 202...
04/09/2026
Krotos Brings Video to Sound Footsteps Directly into Premiere Pro and DaVinci Re...
04/09/2026
RED DIGITAL CINEMA Comes Out Swinging at IBC 2026 with Next-Generation Live Broa...
04/09/2026
Orty v2.0-web - the cold-outreach assistant moves to the web
Brie Clayton September 4, 2026
0 Comments
Orty today announced v2.0-web of its AI cold-ou...
04/09/2026
Lightware is expanding its LARA (Lightware Advanced Room Automation) platform with the GUDE Power Distribution Units (PDU) driver module. GUDE devices can now b...
04/09/2026
Lightware shares the second release in its ESG communications series. Following the first piece, which focused on the companys environmental performance, this r...
04/09/2026
Big Blue Marble supported a leading European public service broadcaster in delivering the Soccer World Cup 2026 streams, supplying more than 10 Tbps of bandwidt...
04/09/2026
Outstanding achievement in engineering, science and technology
Hitomi Broadcast has been recognised with an Engineering, Science & Technology Emmy from the Ac...
04/09/2026
California, Hollywood at a Crossroads
Andy Marken September 3, 2026
0 Comments
I'm doing everything alone. Crossing roads alone. Seeing the Eiffe...
04/09/2026
Berklee Announces Winners of 2026 SongwritersdB Songwriting Contest Students Luca Alexandru, Annika Wild, and Johanna James received the top prizes for origin...
04/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
04/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
04/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
04/09/2026
RT ANNOUNCE NEW DRAMA THE MURDER OF MR. MOONLIGHT
BASED ON THE DISAPPEARANCE...
03/09/2026
Yospace will be at IBC from 11th - 14th September (booth 5.C78). For more inform...
03/09/2026
NEP Group has announced leadership changes at Creative Technology Group. Founder and CEO Graham Andrews will step away from day-to-day leadership at the end of ...
03/09/2026
The NFL and TikTok have announced a multi-year partnership renewal expanding the league's presence on the platform. NFL posts on TikTok increased more than ...
03/09/2026
Grass Valley has appointed Ronny Van Geel as Vice President, Cameras. Van Geel began his career in 1999 at Philips DVS and moved into product management in 2005...
03/09/2026
Telestream has announced Vantage Super Resolution, an AI-powered upscaling capability for the Vantage media workflow platform, developed in collaboration with N...
03/09/2026
Solid State Logic (SSL) will debut the TCA Tour at IBC2026 (Hall 8, Stand 8.B45), a portable production system built from System T components in a desktop frame...
03/09/2026
DPA Microphones has announced the 6388 CORE Headset Microphone, making its debut at IBC2026 (Hall 8, Stand D60). The supercardioid headset features a physicall...
03/09/2026
Qvest will present a multi-vendor Dynamic Media Facility (DMF) showcase at IBC2026 (Booth 10.C24), demonstrating how the EBU's DMF architecture can be imple...
03/09/2026
Imagine Communications will showcase the Magellan PanelFlex control surface and other control portfolio updates at IBC2026 (Stand 1.B73, RAI Amsterdam, Septembe...
03/09/2026
Bridge Technologies will announce at IBC2026 (Booth 1.A71) that its VB440 production probe is now available as a software-based solution, deployable on commerci...
03/09/2026
Audio-Technica has unveiled the BP350ST MS (mid-side) microphone in two versions: the camera-mount BP350ST-UL and the boundary or gooseneck-mountable BP350ST-UB...
03/09/2026
Telos Alliance will introduce updates to the J nger Audio flexAI audio processin...
03/09/2026
DUNKMAN, the professional dunk league founded by Shaquille O'Neal in partner...
03/09/2026
Orlando's WRDQ TV 27, WFTV Channel 9 previously named over-the-air broadcast...
03/09/2026
EverPass Media has announced a multi-year commercial distribution agreement with Netflix, expanding on an existing partnership that has delivered NFL Christmas ...
03/09/2026
Yahoo Sports and Apple TV have announced a partnership to deliver alternate broadcasts of select Friday Night Baseball and MLS games on the Yahoo Sports website...
03/09/2026
With another academic year underway, college athletic departments across the cou...
03/09/2026
Facility becomes permanent home of NFL Live on Sept. 9; centerpiece studio for c...
03/09/2026
Create musical synth bass sounds from scratch
Anthony Marinelli Music have recently announced the launch of Bass DNA, a new online course that teaches music...
03/09/2026
Most powerful Tonex hardware to date
IK Multimedia's latest release introduces their most advanced Tonex hardware unit to date, combining their AI Machi...
03/09/2026
Upmix & downmix software upgraded
Penteo Audio Plugins have announced that the latest version of their powerful upmix and downmix software is now available....
03/09/2026
With the start of the new apprenticeship year, young talent has once again begun their professional careers at SGL Carbon's sites in Germany. Recently, the ...
03/09/2026
With the industry increasingly embracing hybrid, software-defined production models, Calrec will preview a series of Argo and ImPulseV software enhancements at ...
03/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
03/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
03/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
03/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
03/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
03/09/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
03/09/2026
Recognizing the ever-increasing demands for media throughput in challenging environments like post-production, two leaders in network technology have worked tog...
03/09/2026
EVS, a leader in live video technology and production infrastructure solutions, and Matrox Video, a leader in software-defined media technology and IP-based vid...