
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...
11/08/2026
Weekly immersive broadcasts will feature 8K 3D video, a 180-degree field of view...
11/08/2026
By Briana Brady, Social Media Manager, Production Hub
Sports content is having ...
11/08/2026
She addresses why media organizations need more than asset storage, how sports t...
11/08/2026
Remote commentary has improved significantly on these broadcasts
At a clip of ...
11/08/2026
A pair of LANTIME IMS M2000 PTP Grandmasters deliver resilient timing infrastruc...
11/08/2026
LTN has announced expanded capabilities for its Live Event Master Control offering, providing sports broadcasters, leagues, rights holders, and content owners w...
11/08/2026
WTA Ventures has appointed IMG as its managed production services partner in a multi-year agreement commencing with the 2027 season. The partnership is the late...
11/08/2026
The New York Jets and CBS New York have agreed to a multi-year extension of their partnership, keeping CBS New York as the official broadcast home of the team. ...
11/08/2026
Nielsen Holdings and DoubleVerify have announced a definitive agreement under which Nielsen will acquire DoubleVerify in an all-cash transaction with an enterpr...
11/08/2026
The Audio Engineering Society has announced the results of its 2026 Board of Dir...
11/08/2026
The CSN co-founder details its network and affiliate' model, how creator wi...
11/08/2026
Gravity Media is providing host broadcast operations for the Esports World Cup (EWC) 2026, supporting ESL FACEIT Group (EFG) in delivering the tournament to glo...
11/08/2026
TAG Video Systems has released a memory usage optimization for its MCM software that reduces the cost per channel by up to two-thirds for compressed workflows. ...
11/08/2026
SMT is expanding its technology partnership with the Cincinnati Open this year, adding new LED displays, production capabilities, and fan-facing experiences at ...
11/08/2026
The Pac-12 has announced that home Olympic sports broadcasts throughout the fall season will be available free on the conference's YouTube channel at youtub...
11/08/2026
Spreading a message of faith requires both widespread accessibility and uncompromising visual quality. Real Life Network (RLN), a free, faith-based digital stre...
11/08/2026
Taking the synergy of sports and entertainment a step further, the NFL venue in Nashville will house iterations of two iconic music clubs
The marriage of Taylo...
11/08/2026
Free library captures pro classical string section
There's no shortage of freebies in The Crow Hill Company's line-up, with their Vaults series offe...
11/08/2026
Percussion instrument introduces all-new engine
Emergence Audio have just introduced a instrument that brings together a vast collection of percussive analo...
11/08/2026
Introduces new all-in-one Spatial Panner tool
Boris FX have recently announced the latest major update for their mastering and broadcast-focused DAW softwar...
11/08/2026
Rohde & Schwarz installs millimeter wave security scanners at Airports of Thaila...
11/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
11/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
11/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
11/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
11/08/2026
farmerswife and Cirkus will return to IBC 2026 to showcase new tools designed to help broadcast, media and post-production teams manage workflows with greater s...
11/08/2026
LiveUs LU900Q intelligent production unit played a central role in the host broadcast operation for the Games in Glasgow (July 23 to August 2, 2026). The host b...
11/08/2026
Jigsaw24 has appointed James Morse as Client Director, Media Sales, as it deepens its focus on sports, live events and integrated production. His appointment co...
11/08/2026
Net Insight today announced that DMC Production Norway has selected its Open Live Media solution to centralize the production of Blinkfestivalen 2026. Combining...
11/08/2026
Modular HEVC and JPEG XS workflows enabled resilient, ultra-low-latency delivery for leading linear and digital media platforms across all 104 matches
Appear A...
11/08/2026
Homecoming Artist Spotlight: Fabiola M ndez The first cuatrista to graduate from Berklee talks about the community that shaped her career ahead of her Homecom...
11/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
11/08/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
11/08/2026
Dalet, a leading technology and service provider for media-rich organizations, today announced Dalet Solution Suites, a new portfolio of cloud-native solutions ...
11/08/2026
Mediagenix, a global leader in smart content solutions to profitably connect the right content to the right audience, will showcase how media companies can prep...
11/08/2026
Transforming your audience into advocates with Kelsey Gamble 10 August 2026
Building community, harnessing fandom for marketing and activating the four stages ...
11/08/2026
Whether gamers are looking for high-octane action or a laid-back afternoon, Appl...
11/08/2026
Hosts D ith S and Kathryn Thomas rose to the occasion on Tuesday (August 11)...
11/08/2026
Every new generation of accelerated computing demands more from the infrastructure underneath it - more compute performance, higher rack density and more effici...
11/08/2026
A Day in May airs Wednesday 12 August at 9.35pm RT One and RT Player
A Day in May revisits the people and stories behind Ireland's historic marriage equa...
11/08/2026
As AI shifts from chatbots to autonomous agents, open models are serving market ...
11/08/2026
The open source ecosystem is making it easier for AI enthusiasts and developers to build, customize and run increasingly capable agents locally.
Throughout Au...
10/08/2026
Weekly immersive broadcasts will feature 8K 3D video, a 180-degree field of view...
10/08/2026
Saturation plug-in free until 20 August 2026
fedDSP have announced the launch of Raiju, a new guitar pedal-style saturation plug-in that's capable of de...
10/08/2026
New mix-comparison & feedback tool
Independent Swedish record label I/O Music have recently released a handy new tool that provides artists, engineers, prod...
10/08/2026
Additive soft synth gains free counterpart
Sound Radix have just released a free monophonic additive software synth that's based on the same engine as t...
10/08/2026
Chroma integrates MXO oscilloscopes into ATS 8000 platform, rounding out its hig...