
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/08/2026
Dalet, a leading technology and service provider for media-rich organizations, t...
30/07/2026
CP Communications provided RF audio, RF video, communications, RF coordination, ...
30/07/2026
OpenDrives has been included in CRN's 2026 Storage 100 list in the Software-Defined Storage category. The annual list, selected by the CRN editorial team, r...
30/07/2026
LATAM Airlines has selected SES to provide multi-orbit inflight connectivity to its fleet of Airbus and Embraer aircraft. More than 60 aircraft - including Airb...
30/07/2026
Tagboard has launched the Producer API, an open interface that allows key commands in Tagboard's live production environment to be triggered from external d...
30/07/2026
FOX Sports and the New York Racing Association (NYRA) have announced a multi-year agreement with Del Mar Thoroughbred Club that will make FOX Sports the exclusi...
30/07/2026
ABC Commercial has launched four free ad-supported streaming television (FAST) channels on LG Smart TVs across North America, Great Britain, and select countrie...
30/07/2026
The Six Kings Slam exhibition tennis tournament will return to Riyadh on October 21, 22, and 24, streaming live on Netflix at no additional cost to subscribers....
30/07/2026
Central Christian Church in Mt. Vernon, Illinois has deployed Clear-Com's LQ...
30/07/2026
Blackmagic Design has released the UltraStudio Express 3G family, a pair of USB4 capture and playback devices compatible with Mac, Windows, and Linux computers ...
30/07/2026
ESPN has reached a media rights agreement with the Women's Pro Baseball League (WPBL), making ESPN the national streaming home of the league's 2026 seas...
30/07/2026
Most Valuable Promotions (MVP) and the Professional Fighters League (PFL) have announced a merger that will operate under the MVP banner. PFL CEO John Martin wi...
30/07/2026
The Columbus Blue Jackets will simulcast all game broadcasts across television and radio beginning with the 2026-27 NHL season. Under the new format, the televi...
30/07/2026
TMRW Sports has selected Populous as architect for a purpose-built stadium for its professional flag football league, being developed in partnership with the NF...
30/07/2026
SiriusXM has announced SiriusXM Sports Pass, a new subscription plan launching September 1 that bundles the company's sports audio programming into a single...
30/07/2026
Leagues, broadcasters, and technologists gather to tackle cloud economics, distr...
30/07/2026
A major player in the cloud-based solutions, Amazon Web Services (AWS) has conti...
30/07/2026
The NBA will provide production for all local game broadcasts, including pregame and postgame coverage...
30/07/2026
Cosm will open its fourth immersive sports and entertainment venue in downtown Detroit on September 10. Located at 25 Cadillac Square, adjacent to Campus Martiu...
30/07/2026
NFL Network will be available on the ESPN App beginning July 30 for Unlimited plan subscribers. The addition brings NFL Network's live games, studio program...
30/07/2026
NEP Group has added Riedel's SimplyLive Production Suite to NEP Platform, giving customers access to the live production software through NEP's orchestr...
30/07/2026
LOS ANGELES, CA, July 30, 2026 - The nonprofit Sundance Institute today announce...
30/07/2026
A new take on classic algorithmic reverbs
Waves have just introduced a new flagship algorithmic reverb plug-in that offers the company's take on the ico...
30/07/2026
Save up to 30% on virtual instruments & plug-ins
Arturia have recently launched their annual Summer Sale, which sees discounts of up to 30% applied across a...
30/07/2026
ActiveAnalogue technology powers new flagship modular console
A year on from the launch of the Oracle, SSL have revealed a new flagship console which they s...
30/07/2026
Up to 22dBA of passive attenuation
The latest arrival to the beyerdynamic range introduces a new compact monitoring headphone that's been designed to ta...
30/07/2026
As part of its traditional graduation ceremony, SGL Carbon honored the achievements of a total of twelve young professionals who successfully completed their ap...
30/07/2026
Premiere date revealed for SBS Original drama The Airport Chaplain, starring Hug...
30/07/2026
TVNZ and Evergent are celebrating a major TVNZ milestone - the evolution from a free-to-view, ad-supported business into a hybrid model, offering premium sport...
30/07/2026
WebMiere Adds Native VP9/AV1 WebM/MKV Import to Adobe Premiere Pro
Brie Clayton July 29, 2026
0 Comments
Brought to you by KawaiiEngine, WebMiere is a...
30/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
30/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
30/07/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
30/07/2026
At IBC2026, GlobalM will showcase the latest evolution of its software-defined media platform, enabling broadcasters, telecom operators and media organisations ...
30/07/2026
At the 2026 TAB Show, Digital Alert Systems will highlight and demo the new DAS-Link AIR, an over-the-air common alert protocol (CAP) dissemination system for ...
30/07/2026
OpenDrives Named to the 2026 CRN Storage 100 List
Company Recognized Among the 50 Coolest Software-Defined Storage Vendors for Unlimited Capacity, S3 Hybrid M...
30/07/2026
New Scene Search capability in VIDA Content OS makes video content itself searchable, letting broadcasters and streamers find key moments across millions of ass...
30/07/2026
Thursday 30 July 2026
Which WSL matches are Sky Sports showing on the 2026/27 opening weekend?
The season will kick off on Friday 4 September with Manchester ...
30/07/2026
Thursday 30 July 2026
Enjoy discounts on the iPhone Air, plus 5Gb speeds with U...
30/07/2026
Broadcaster John Creedon explores Ireland's rich musical heritage Sunday 2 A...
30/07/2026
Back to school means balancing assignments, deadlines and downtime. GeForce NOW makes it easy to have it all.
With cloud gaming, everyday laptops used for clas...
29/07/2026
In this series, Grass Valley explores the seven paradoxes shaping the next era o...
29/07/2026
Thats a wrap on Season 1 of SVG Students to Watch! Across the country, these stu...
29/07/2026
The agreement will move Gotham Sports App subscribers to DAZN during the 2026-27...
29/07/2026
Longtime digital-media leader expands role overseeing conference branding, video...
29/07/2026
By Bailey Pennick
One of the most exciting things about the Sundance Film Festival is having a front-row seat for the bright future of independent filmmaking. ...
29/07/2026
Organisation team up with TI:ME USA
Founded in 2019 with the aim of helping educators to embrace new music technology, Technology in Music Education (TiME U...