
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 ...
11/11/2026
Hornets Sports & Entertainment (HSE) and Spectrum have installed WiFi 7 as part of Spectrum's Managed WiFi solution within Charlotte's recently renovate...
11/11/2026
As 4K displays normalize in living rooms and economy flights, aging minor league...
11/11/2026
Northwestern University has deployed Grass Valley production switching and camera technology at its new Ryan Field stadium in Evanston, Illinois. The installati...
11/11/2026
Central Christian Church has transformed communication across its live productio...
11/11/2026
Monumental Sports & Entertainment developed the new Cisco Command Center for all of the building's technology
Prior to the start of the busy October schedu...
11/11/2026
The new Manhattan set is the latest addition to a network of studios, home setup...
11/11/2026
With a remodeled set, an expanded camera package, and a Steve Aoki performance, MLB Network's production team raises the bar again at The Chelsea...
11/11/2026
Third collaboration with Grammy-winning composer & conductor
Spitfire Audio have announced the release of Eternity, the third sample library to be created a...
11/11/2026
Eurorack experts launch vinyl-inspired plug-in
When praised Eurorackers Modbap revealed their first software effect recently, they stated it was the first r...
11/11/2026
New York, NY - November 10, 2026 - Neptune BidCo US Inc. (the Issuer or the C...
11/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
11/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
11/11/2026
New partnership strengthens local access to Hitomi s precision timing solutions, with MatchBox, MatchBox Glass and Spectra on show at Inter BEE 2026
Hitomi Br...
11/11/2026
Frequency, the engine behind many of the worlds leading streaming television channels, and OpenGlass, the first SSP built for advanced CTV advertising, today an...
11/11/2026
Operative today announced the appointment of Brian Beirne as Senior Vice President, Commercial Growth. Beirne returns to Operative at a pivotal moment, as its U...
11/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
11/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
11/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
11/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
11/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...
11/11/2026
Flanders Scientific (FSI), an Atomos company, has introduced seven new QD-OLED reference monitors across two new series, the VP and V. Designed for professional...
11/11/2026
Pliant Technologies' highly anticipated CrewCom Flex product line is now shipping in the United States. As the industry's first frameless matrix interc...
11/11/2026
Desert Palms Captured with Blackmagic URSA Cine Immersive
Brie Clayton November 10, 2026
0 Comments
Director Tristan Seniuk premieres immersive short ...
11/11/2026
Avid launches Ready to Play, putting new AI creative capabilities into editors...
11/11/2026
Adobe Powers a New Era of Creativity, Bringing Agents and Tools to Creatives Whe...
11/11/2026
Fraud detection and removal tools play an important role in defending advertising budgets against invalid traffic. A robust fraud tool, independently accredited...
11/11/2026
RT lyric fm is partnering with the Department of Climate, Energy, and the Envir...
11/11/2026
RT TODAY show has announced the eight finalists for its festive amateur cook competition Christmas Home Cook'.
Following the success of TODAY TV Home C...
10/11/2026
ENCO provided live stage captioning, multilingual translation and new audio pass-through services at NAB Show New York, held Oct. 21-22 at the Javits Center, an...
10/11/2026
Vizrt has built a proof-of-concept integration with the Story Object Model (SOM), shown at IBC 2026 in Amsterdam as part of the Smart Stories Accelerator projec...
10/11/2026
Gravity Media's Creative and Managed Services team produced a dedicated live 9:16 vertical broadcast workflow for Meta Connect 2026. Meta asked for more tha...
10/11/2026
Blue Stream Fiber has standardized its OTT streaming services on Ateme's end-to-end video platform for its high value linear channels, providing more effici...
10/11/2026
Haivision has opened the survey for its 2027 Broadcast Transformation Report, inviting broadcast, media, and production professionals worldwide to share their p...
10/11/2026
The League of Live Stream Theater (LOLST), the nonprofit organization partnering...
10/11/2026
USA Sports and The Horse Racing League (HRL) has announced a partnership to air ...
10/11/2026
Matrox Video has launched The Sync, a new video podcast series bringing together Matrox Video experts, customers, and partners to explore the technical and busi...
10/11/2026
The CW Network and Professional Bull Riders (PBR) have announced a new multi-yea...
10/11/2026
There is a certain irony that Chip Adams was turned down when he first looked in...
10/11/2026
Pliant Technologies' CrewCom Flex product line is now shipping in the United States. As a frameless matrix intercom system and complete matrix IP-based inte...
10/11/2026
PARK CITY, Utah (November 10, 2026) The Sundance Institute today announced the appointment of Allison Graff-Weisner as its new Chief Development Officer (CDO)...
10/11/2026
New tool humanises orchestral MIDI parts
Described as a session musician inside your DAW, VSL's latest plug-in aims to make quick work of making program...
10/11/2026
Free EQ launched alongside four major updates
PSPaudioware have just launched their latest free plug-in, along with a set of updates that bring modern OS co...
10/11/2026
Save 25% throughout November 2026
Following the recent release of Cubase 16, regular SOS contributor John Walden has announced that he will be running a 25%...
10/11/2026
Set to launch in early 2027
The latest version of Ableton's DAW software has just been unveiled, and will be making an official appearance in early 2027...
10/11/2026
IoT devices use a wide range of frequency bands below 6 GHz, from Sub-GHz LPWAN sensors to 5G and Wi-Fi systems. Lower frequencies such as 433 MHz, 868 MHz, 915...
10/11/2026
A ceramic patch GPS antenna may fit mechanically but still perform poorly if it is too small, incorrectly orientated, placed near noisy electronics or installed...
10/11/2026
A GPS antenna ground plane provides the conductive RF reference a ceramic GPS/GNSS patch needs, but that does not always mean the product PCB must provide it. T...
10/11/2026
An external GPS antenna is usually the better option when the product enclosure ...
10/11/2026
New R&S FNH combines spectrum analysis, vector network analysis and power meteri...