
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 ...
01/06/2026
January 6 2026, 05:30 (PST) Dolby Sets the New Standard for Premium Entertainment at CES 2026
Throughout the week, Dolby brings to life the latest innovatio...
02/05/2026
Dalet, a leading technology and service provider for media-rich organizations, t...
01/05/2026
January 5 2026, 18:30 (PST) NBCUniversal's Peacock to Be First Streamer to ...
01/04/2026
January 4 2026, 18:00 (PST) DOLBY AND DOUYIN EMPOWER THE NEXT GENERATON OF CREATORS WITH DOLBY VISION
Douyin Users Can Now Create And Share Videos With Stun...
16/03/2026
NEW YORK - March 16, 2026 - A E Global Media and Nielsen today announced a new,...
16/03/2026
aconnic AG (ISIN: DE000A0LBKW6), Munich, is delivering the first commercial 100-Gigabit systems following successful validation and certification for customer n...
16/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
16/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
16/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
16/03/2026
Shotoku USA, Shotoku Broadcast Systems' North American operation, will unveil significant additions to its platform at NAB 2026. Topping the list is the wor...
16/03/2026
Ikegami USA will demonstrate the latest additions to its wide range of broadcast-quality cameras, controllers and monitors on Central Hall booth C3819 during th...
16/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
16/03/2026
ELEMENTS launches GRID at NAB Show 2026
Brie Clayton March 15, 2026
0 Comments
North Hall, Booth N1717
ELEMENTS returns to NAB Show 2026, with an exp...
16/03/2026
Blackmagic Design Cameras Capture Artist Salavat Fidai's Micro Sculptures
Brie Clayton March 15, 2026
0 Comments
6K sensor and open gate capabilit...
16/03/2026
DHD to Introduce Latest Generation Broadcast Audio Mixers at NAB 2026, Las Vegas
Brie Clayton March 15, 2026
0 Comments
Hero image: Front of DHD RM1 P...
16/03/2026
The reporting option was introduced following extensive consultation with publis...
16/03/2026
After a nail-biting Grand Finale, Rose of Tralee Katelyn Cummins has been announced as the winner of Dancing with the Stars 2026.
The four finalists each dance...
16/03/2026
Welcome to Moore Street will begin on RT One and RT Player on Thursday 19 Marc...
15/03/2026
Visit ToolsOnAir at NAB Las Vegas 2026
More Details:From April 19-22, join us at NAB Show Las Vegas in the North Hall, Booth N1258, for an exclusive preview of...
15/03/2026
Latest dark drama, thrillers & tension library announced
The Very Loud Indeed Co.'s latest Kontakt library has just arrived, delivering a third instalme...
15/03/2026
Johannesburg, 14 March 2026 - On 13 and 14 March 2026, the 19th Annual South Afr...
15/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
14/03/2026
Combines mic, USB interface & wireless IEMs
Following a successful Kickstarter campaign, HISONG have announced that their innovative AirStudio S1 device is ...
14/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
14/03/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
14/03/2026
Yospace, the trusted leader in Dynamic Ad Insertion (DAI), stitched 5.4 billion one-to-one addressable OTT advertisements across the 17 days of Milano Cortina 2...
14/03/2026
Telestream Advances Production-Ready AI Across Its Product Portfolio
Brie Clayton March 13, 2026
0 Comments
New AI capabilities drive smarter automati...
14/03/2026
Kraken Graded in DaVinci Resolve Studio
Brie Clayton March 13, 2026
0 Comments
Senior Colorist Dylan Hopkin delivers the first Scandinavian feature in...
14/03/2026
Tedial Powers the Future of Media Operations at NAB Show 2026
Brie Clayton March 13, 2026
0 Comments
Transforming Media Through Intelligence, Flexibil...
13/03/2026
Recently named CEO Andreas Eriksson has taken the helm at Net Insight at a pivot...
13/03/2026
Scripps Sports and Ally Financial are partnering with the Professional Women's Hockey League (PWHL) to broadcast its first game on national linear televisio...
13/03/2026
Disney+ has launched Verts, a vertical video feed on its U.S. mobile app, markin...
13/03/2026
LTN, a managed IP video transport company, and Appear, a live production technol...
13/03/2026
The Professional Fighters League (PFL) has announced an agreement with Sportradar for global betting data and streaming rights. Under the deal, Sportradar becom...
13/03/2026
In-venue and creative video staffers at the professional and collegiate level ha...
13/03/2026
The streamer will be the first entertainment platform to offer AI-enabled vertical video for live games, starting with the NBA...
13/03/2026
Ease Live, an Evertz company specializing in interactive graphical overlays, has deployed its platform on Red Bull TV for Premier Padel coverage. The deployment...
13/03/2026
Monday Night Football, ESPN's premiere NFL property, has continued to be improved and upgraded from a production perspective. Alternative broadcasts are aug...
13/03/2026
At NAB Show 2026, Net Insight (booth W1653) is introducing the Nimbra 520, a high-density media processing node for live contribution and distribution across ma...
13/03/2026
Harmonic (booth W2831) has announced Spectrum X Plus, the newest generation of its Spectrum X media server, offering double the channel density of previous gene...
13/03/2026
Riedel Communications has announced the expansion of its Managed Technology Divi...
13/03/2026
Telestream (booth W1503) has announced the expansion of Telestream Cloud Services with the introduction of UP, a cloud-native solution for ingest, orchestration...
13/03/2026
From awards ceremonies and sports honors shows to festivals and fan conventions,...
13/03/2026
Overtime has announced a partnership with Metro by T-Mobile, naming Metro the Of...
13/03/2026
At NAB 2026, Calrec (booth C6907) will IP Ecosystem powered by True Control 2.0, integrating the company's IP-native Argo consoles - including the U.S. debu...
13/03/2026
Ratings Roundup is a rundown of recent ratings news derived from press releases ...
13/03/2026
Spotify has always been built around your taste. More than 80% of listeners say personalization is what they love most about us. Now we're taking that even ...
13/03/2026
The new Spotify Legends Club has opened its doors. Its members: select German-sp...
13/03/2026
Pushing drum sampler technology into new territories
The latest version of Klevgrand's software drum sampler has just arrived, boasting a newly designe...