
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 ...
21/10/2026
Three investigative journalists have been chosen as the finalists for the 2026 Thomson Foundation Young Journalist Award. The successful candidates from Nigeria...
21/10/2026
The lifelong Terps fan is making the most of his dream school, producing and directing broadcasts while gaining professional reps across the Washington, DC, spo...
21/10/2026
University of Washington Intercollegiate Athletics has brought its new Sundodger...
21/10/2026
The Pac 12 has appointed its first ever Chief Commercial & Growth Officer, compl...
21/10/2026
The Wildcats' $875 million home blends an intimate 35,000-seat design with 3...
21/10/2026
M-Tron Select & Axxess free until 1 December 2026
Soft synth gurus GForce Software have just announced that they are relaunching with updated branding, a fr...
21/10/2026
A simplified approach to multiband compression
DDMF's latest plug-in has been designed to simplify the process of applying multiband compression, and in...
21/10/2026
Full-size keys, more controls and XYZ touch matrix.
Arturia have announced the release of MiniFreak 49, a larger version of their six-voice hybrid synthesiz...
21/10/2026
SBS appoints Kathryn Fink as Chief Content Officer in new executive structure
21 October, 2026
Media releases
SBS has announced a new executive structure a...
21/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/10/2026
Clear-Com is debuting the Mentrix panel at NAB Show New York (Booth 739) today. Combining physical controls with a touchscreen interface, Mentrix is designed ...
21/10/2026
Amagi, the media industry cloud company, today announced a strategic partnership with Sistemas de Video Comunicaci n S.A. (SVC) to expand access to its cloud-ba...
21/10/2026
Lipsie Launches LipsieSync, a Human-First AI Dubbing Workflow for Multilingual V...
21/10/2026
Mayday Parade Music Video Shot with Blackmagic PYXIS 12K
Brie Clayton October 20, 2026
0 Comments
Multi scale sensor allows DP to capture 12K, 8K and ...
21/10/2026
USS Defiant Pulse Phasers in After Effects - No Plugins!
Graham Quince October 20, 2026
0 Comments
I love the USS Defiant from Star Trek: Deep Space N...
21/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
21/10/2026
Stacey Dooley Sleeps Over returns for a seventh series in 2027, with Stacey Dooley MBE getting exclusive access to the homes and lives of Kerry Katona, Lauryn G...
21/10/2026
Expansion builds on broadcasters successful FAST launch and grows portfolio to 12 channels
New channels dedicated to iconic brands including Top Gear, EastEnde...
21/10/2026
Comscore Launches New Monthly Report Highlighting Ad Exposure Figures Across Tel...
21/10/2026
Since 2012, Saorsat has provided coverage in areas where Saorview reception may be challenged. Services from RT , TG4 and Oireachtas TV are currently available ...
21/10/2026
NVIDIA builds tools to enable safe agents across the stack. The NVIDIA OpenShell...
21/10/2026
NVIDIA cuDSS, launched today in general availability, is an NVIDIA CUDA-X librar...
21/10/2026
To increase productivity, accelerate innovation and create new opportunities for...
21/10/2026
Demand from AI-natives is pulling the European AI cloud ecosystem forward faster...
21/10/2026
General availability of the instances is coming next month, with planned expansi...
21/10/2026
At GTC Berlin, NVIDIA is showcasing its full lineup of local AI hardware. RTX Spark, which launched last week, powers personal agents on Windows PCs; DGX Spark ...
20/10/2026
Sony's Beyond Sports technology will power real-time animation of the game, ...
20/10/2026
The NBA is putting on a full-court press when it comes to digital offerings this year, and that includes some great new features on the NBA App as well as a new...
20/10/2026
Testing what works is an important part of developing successful fan engagement....
20/10/2026
One fan in The Nordecke will wear the device via headset on Wednesday night
Spo...
20/10/2026
Regular-season game coverage will continue to be a mix of REMI and onsite produc...
20/10/2026
Grass Valley has added Bridge Technologies to the company's Media eXchange Layer (MXL) initiative, demonstrating how this has supported the containerization...
20/10/2026
Gravity Media has rapidly deployed complete IP-based broadcast infrastructure fo...
20/10/2026
Ateme has announced a strategic partnership with Viamedia, the ad tech company b...
20/10/2026
As concerts and other live performances reach audiences through global streaming...
20/10/2026
Media Links' Xscend platform and MDP3020 IP media gateways supported live broadcast contribution for the All-Asia Games, that recently took place in Japan.
...
20/10/2026
For Major League Soccer creative teams, 2027 is going to be unlike any year they...
20/10/2026
The National Hockey League (NHL) has given a first look at its planned transform...
20/10/2026
FloSports and the National Lacrosse League (NLL) have entered into a multiyear m...
20/10/2026
The Advanced Media Workflow Association (AMWA) has received a 2026 Technology & ...
20/10/2026
Pearl TV has made significant progress in its industry-wide initiative to make NEXTGEN TV converter boxes more affordable and accessible to consumers, marking a...
20/10/2026
The 37th edition of SPORTEL Awards took place on Monday, Oct. 19 at the Grimaldi Forum Monaco, under the High Patronage of H.S.H. Prince Albert II of Monaco. Ch...
20/10/2026
Amagi has announced a strategic partnership with Sistemas de Video Comunicaci n ...
20/10/2026
The home of cycling coverage is secure as Eurosport and TNT Sports today extend ...
20/10/2026
By Ramona Flume
One of the most exciting things about the Sundance Film Festiva...
20/10/2026
Veteran Entertainment and Brand Executive to Lead Global Communications Strategy...