
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...
27/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
27/08/2026
PlayBox Neo Stand 7.C29 IBC2026 - 11 14 September
Well-established global specialists in media playout, automation, and streaming solutions, PlayBox Neo ...
27/08/2026
Rise Academy, the broadcast and media skills charity dedicated to delivering practical media technology learning experiences, careers resources and work experie...
27/08/2026
Mediagenix, a global leader in smart content solutions to profitably connect the right content to the right audience, will showcase the latest evolution of its ...
27/08/2026
Screen Australia opens applications for Global Fellowships Program 27 August 2026
Applications are now open for the Screen Australia Global Fellowships progra...
26/08/2026
Applicants interested in the Media Innovation Europe 3.0 Validation Booster call can now consult a new FAQ document addressing practical questions raised during...
26/08/2026
Roku Sports Channel will stream eight matches free beginning Aug. 30 as league shifts Sunday-night games away from Victory+...
26/08/2026
Evertz and Mobile TV Group detail how on-premises infrastructure and cloud resou...
26/08/2026
The Sennheiser Group will demonstrate its broadcast audio portfolio at IBC2026 (Hall 8, Booth D50), covering wireless microphone workflows, studio monitoring, a...
26/08/2026
Appear and Transmisiones Televisivas TVTEL Limitada have announced the deploymen...
26/08/2026
Leader Electronics has announced that Danish broadcast rental company Minitech has purchased a Leader LPX500 hybrid IP/SDI waveform monitor and LT4670 sync puls...
26/08/2026
Encompass will demonstrate its Altitude media services at IBC2026 (IAMT Hub, Diamond Lounge, Hall 3, RAI Amsterdam, September 11-14).
Key products on show incl...
26/08/2026
Daktronics has partnered with Massillon Washington High School in Ohio to install a new LED video display and implement the Daktronics Camino show control platf...
26/08/2026
Clear-Com has appointed Dubai-based Venuetech LLC as its main partner for the Middle East. Venuetech distributes professional audiovisual solutions across the r...
26/08/2026
NBC Sports NOW, NBC Sports' free 24/7 streaming channel, will launch a new weekday lineup beginning Monday, August 31, including two new shows.
Not So Fast...
26/08/2026
Calrec will demonstrate updates to its ImPulseV DSP software and Argo ecosystem at IBC2026 (Stand 8.C47), including previews aligned with the EBU's Dynamic ...
26/08/2026
Imagine Communications will demonstrate AI applications across its ad tech and video infrastructure portfolios at IBC2026 (Stand 1.B73, RAI Amsterdam, September...
26/08/2026
Dalet will demonstrate updates to Dalet Flex, Dalet Pyramid, and Dalia, its agentic AI platform, at IBC2026 (Hall 7, Stand 7.A43). The company will also partici...
26/08/2026
Team-owned platform will stream every locally carried Predators game beginning t...
26/08/2026
The 12-day tournament receives the broadcaster's full onsite-studio presence...
26/08/2026
A synth with no controls?
If you're into weird and wonderful instruments, then you may already be familiar with Warsaw-based SOMA Laboratory - if you...
26/08/2026
Physical modelling orchestral instrument announced
Following their recent cryptic hints, Dreamtonics have officially revealed the latest addition to their s...
26/08/2026
Discussions at the Meitingen site on competitiveness, energy supply, and fuel cell technology
Bertram Brossardt, CEO of the Bavarian metal and electrical emplo...
26/08/2026
Rohde & Schwarz USA celebrates grand opening of new manufacturing center in Fred...
26/08/2026
For large media companies, the content archive is a gold mine. There are thousands of hours of existing, high-value assets just waiting to be tapped for highlig...
26/08/2026
Ad Supported Viewing Represents 71.5% of TV in Q2
Streaming Captures Over 48% o...
26/08/2026
Charity sector ad spend reached $278 million as 44% of Australians donated to ch...
26/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
26/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
26/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
26/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
26/08/2026
MediaKind today announced that CNBC UK has selected Beam to modernize its contribution and distribution infrastructure, bringing greater flexibility, resilience...
26/08/2026
Telestream, a global leader in media workflow technologies, today announced the next evolution of Telestream UP, expanding the cloud-native platform introduced ...
26/08/2026
SMPTE, the home for media professionals, technologists and engineers, today announced its 2026 Honorees, recognizing individuals and organizations whose contrib...
26/08/2026
New solution bridges connected TV (CTV) and ecommerce to make shoppable performance advertising easier to scale for streaming platforms and broadcasters
Broadp...
26/08/2026
LA JOLLA, CA-Recent advances in robotics, automation and artificial intelligence...
26/08/2026
How WeFX Made From's' Monsters Feel Uncomfortably Real
Brie Clayton August 26, 2026
0 Comments
From eight-foot dolls and feathered birds to R...
26/08/2026
Eleanor Roosevelt High School Elevates Student Rallies with Blackmagic Design
Brie Clayton August 26, 2026
0 Comments
Student led production team uses...
26/08/2026
K-Frame and Maverik X innovations extend familiar production control into AMPP, alongside new replay, audio, commentary and communications capabilities.
At IBC...
26/08/2026
New products continue to enable any signal, anywhere for creators...
26/08/2026
Dalet, a leading technology and service provider for media-rich organizations, today announced a new integrated newsroom experience with Agence France-Presse (A...
26/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
26/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
26/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...