
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 ...
06/09/2026
June 9 2026, 23:00 (PDT) Dolby and MagentaTV Bring Fans Closer to the FIFA Worl...
04/08/2026
Dalet, a leading technology and service provider for media-rich organizations, t...
07/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
07/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
07/07/2026
New appointments to Screen Australia board 7 July 2026
The Albanese Labor Government has made new appointments to the Screen Australia board.
Dr Tania Chamber...
07/07/2026
The right team. The right time.' How The Killings at Parrish Station stuck t...
07/07/2026
Berklee College of Music Alum and Faculty Perform at Boston Public Library's...
07/07/2026
Scripps Research scientists train the immune system to make antibodies against numerous HIV strains Preclinical findings mark progress toward a long-sought vacc...
06/07/2026
Long-developed relationships and informal access, three production models, and c...
06/07/2026
The deal follows Lumine's recent acquisition of Synamedia's video-networ...
06/07/2026
This former SportsCenter producer is shaping local-team studio coverage to surro...
06/07/2026
IMS Productions and FOX Sports deployed more than 100 cameras, 32 onboard feeds,...
06/07/2026
Lumine Group Inc. has announced the completion of its acquisition of the Video Network Business from Synamedia. The business will operate as a standalone compan...
06/07/2026
NASCAR has announced a content and commercial partnership with Motorsport Network, a motorsports and automotive media platform, to distribute NASCAR original co...
06/07/2026
Versant Media Group has announced a definitive agreement to acquire Full Swing, a sports technology company, from Bruin Capital and a group of minority investor...
06/07/2026
DAZN has announced global broadcast rights to 3ICE, a professional hockey format featuring three skaters and a goalkeeper per side, with no power plays or offsi...
06/07/2026
Bundle gains 100 new synths & more
Synth Anthology 5 the largest and most feature-packed edition of UVI's hardware synth emulation bundle, bringing toge...
06/07/2026
Available now via free firmware update
MOTU have just announced that three of their popular audio interfaces now boast official Milan Certification. The 16A...
06/07/2026
Rohde & Schwarz completes Hunter Preliminary Design Review for the Integrated Co...
06/07/2026
The R&S IMAGER from Rohde & Schwarz uses millimeter wave imaging to inspect the ...
06/07/2026
The National Film and Video Foundation (NFVF), an agency of the Department of Sp...
06/07/2026
Digital Domain Appoints Industry Veteran Patrick Davenport as Executive Vice Pre...
06/07/2026
Gravity Media USA appoints Brittney Boston as Head of Business Development
Brie Clayton July 6, 2026
0 Comments
The strategic new appointment supports...
06/07/2026
Remote Editing Without Cloud Storage in Resolve
Michael Cioni July 6, 2026
0 Comments
This is a step-by-step guide that demonstrates how to setup your...
06/07/2026
Automatic Caption Translation in Adobe Premiere Pro
Colin Smith July 6, 2026
0 Comments
Here I showcase the innovative automatic caption translation f...
06/07/2026
Flavor's First Ever Managing Director Neal Cohen Retires; Longstanding Execu...
06/07/2026
How Adam Rosenwach Pivoted from Music to Medtech Without Missing a Beat What do the rehearsal room and the boardroom have in common? More than you might think...
06/07/2026
Zhongyi Optics unveils the Dreamy Zone T1 FF Cine Lens Series on Indiegogo with ...
06/07/2026
Open source AI has shown how quickly developers can innovate when models, data a...
06/07/2026
Techtel debuts insyght: making ST 2110 media discovery easy
intellisphereinsyght2026
6 July Written By Suzanne Costello
Sydney, Australia - 06 July 2026 T...
06/07/2026
Monday 6 July 2026
Sky agrees to acquire ITV Media & Entertainment, creating a ...
06/07/2026
Fresh from his World Cup heroics with Cabo Verde, Roberto Pico' Lopes will join the RT panel for Argentina v Egypt tomorrow and for the England v Norway q...
06/07/2026
Nations have long invested in domestic infrastructure to advance their economies, protect and use their data, and take advantage of technology opportunities in ...
06/07/2026
Every year, the International Conference on Machine Learning (ICML) reveals where thousands of AI researchers have decided to put their work.
This year's ...
06/07/2026
A death can be unsuspicious, but it has to be explained
What happened to Ke...
05/07/2026
We've gone to another level of integrating the graphics into the set architecture' - Zac Fields, SVP, Graphic Technology and Integration, FOX Sports...
05/07/2026
Browser-based and desktop apps available
Digital Sunset Studios have been busy working on an interesting project: a free software tool that provides compute...
04/07/2026
When Canada qualified for the FIFA World Cup 2026, OneSoccer knew this wasn'...
04/07/2026
Celebrates company's 80th anniversary
Rhodes have recently revealed that they will be producing a limited run of electric pianos in celebration of their...
04/07/2026
Blackmagic Design Cameras Empower Youth Broadcasting Program
Brie Clayton July 3, 2026
0 Comments
Blackmagic Pocket Cinema Camera 6K Pro and Blackmagi...
04/07/2026
iZotope Joins Boris FX
Boris Yamnitsky July 3, 2026
0 Comments
iZotope, the team behind RX and Ozone, is joining Boris FX. A letter from founder Boris...
04/07/2026
April 7 2026, 19:00 (PDT) Detective Conan: Fallen Angel of the Highway Opens in...
03/07/2026
New bundle & three Single Packs
Continuing to expand their already sizeable orchestral collection, VSL's latest release introduces three new Single Pack...
03/07/2026
Venue installs new ATC-equipped control room
LSO St Luke's, a unique music venue that also serves as the home of the London Symphony Orchestra, have rec...
03/07/2026
Caden Pearson appointed new Commissioning Editor for NITV
3 July, 2026
Media releases
National Indigenous Television (NITV) has strengthened its commitment...
03/07/2026
1 February 2023
SHARE Facebook Twitter Linkedin Email
Munich, Germany, 1st February 2023: Cinegy GmbH, the premier provider of software technology for digit...
03/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
03/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...