
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 ...
18/11/2026
William Kamau is an investigative journalist from Kenya. He says witnessing the pain, displacement and killings' that followed the country's 2007 elect...
18/11/2026
Humberto Basilio is a freelance science, health and environmental journalist from Mexico. He says that working in one of the most dangerous countries in the wo...
18/11/2026
Aaron Atsahyel is a multimedia investigative journalist from Nigeria who draws on his own experiences as someone displaced by the Boko Haram insurgency to tell...
18/11/2026
Held in New York City, the event explored the latest technologies and trends shaping the future of live-sports transmission and distribution...
18/11/2026
The Youth Olympic Games Dakar 2026 opened in Senegal on October 31, giving young...
18/11/2026
Dynamic bands, unmasking features & new stereo tools
Launched in 2021, Eventide's SplitEQ plug-in introduced an interesting new approach to EQ, with the...
18/11/2026
Parametric Tone Models emulate control responses & interactions
IK Multimedia have just announced the launch of Parametric Tone Models, a new technology tha...
18/11/2026
Captures immersive audio on phone, tablet or computer via USB-C
Shure have just announced the launch of the MV360 Spatial Audio Microphone, a compact USB-C ...
18/11/2026
SBS announces key appointments across programming and commissioning
18 November, 2026
Media releases
SBS has announced a series of appointments and role up...
18/11/2026
The National Film and Video Foundation (NFVF), an agency of the Department of Sp...
18/11/2026
Strategic renewal builds on existing engagement, supports DIRECTV's objectiv...
18/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...
18/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...
18/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...
18/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...
18/11/2026
Share
{alert(Link copied)}).catch(err => {console.error(Failed to copy: , er...
18/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...
18/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...
18/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...
18/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...
18/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...
18/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...
18/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...
18/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...
18/11/2026
SMPTE, the home for media professionals, technologists and engineers, today announced the publication of an engineering report with the summarized results of an...
18/11/2026
Wednesday 18 November 2026
Live from London, it's Saturday night! Saturday ...
18/11/2026
BAFTA award-winning series sees 16-year-old reporter explore topics including toxic digital influencers and disrespectful attitudes to girls in a groundbreaking...
18/11/2026
TMxCore has no built-in display. If you use TMxCore with a network display, you may not need a dedicated display at all. If you prefer a directly connected scre...
18/11/2026
Key Takeaways
TeleData is building a unified DOCSIS and fiber network with Ha...
18/11/2026
Beeble recently launched SwitchX 3.0, a major update to its AI-powered video-to-...
18/11/2026
Film London will lead and manage a long-term industry research program in partne...
18/11/2026
Hexagon, the global leader in measurement technologies, recently launched MANTIS by Leica Geosystems, a camera-mounted 3D capture and tracking system to give fi...
18/11/2026
Arvato Systems Expands BSI-C5 Testing
Greater Confidence in Cloud Security and Regulatory Resilience
Successful BSI-C5 Retest
Certification in accordance wi...
18/11/2026
Brendan O'Connor joins six disabled job seekers as they navigate the barriers of finding work and challenge perceptions of disability in the workplace
Begi...
18/11/2026
Poison Ink begins Friday 20 November 2026 on RT Listen and RT Radio 1
Listen ...
18/11/2026
RT Choice Music Prize
In association with IMRO and IRMA
2027 KEY DATES
Irish Album of the Year 2026 Shortlist 18th January
Irish Artist of the Year 2026 ...
18/11/2026
New NVIDIA RTX Spark compact desktops from ASUS, Dell and MSI are available today, bringing local AI agents, image and video generation, and model fine-tuning t...
17/11/2026
Fabric Insights and Fonn Group have announced a partnership to connect editorial...
17/11/2026
The National Association of Black Journalists is offering up a Thanksgiving Eve treat on Wednesday, Nov. 25, in the form of a live streaming event featuring for...
17/11/2026
Bridge Technologies has announced that its VB440 production probe now supports both monitoring and signal generation for Apple ProRes video streams. The additio...
17/11/2026
Canon U.S.A., Inc. recently welcomed 21 Jericho High School students to its Melv...
17/11/2026
Spectrum News has deployed the Amagi platform to support its live news operations. Amagi says the platform lets Spectrum News streamline newsroom workflows, red...
17/11/2026
Microsoft has expanded its use of Haivision's live video contribution ecosys...
17/11/2026
Setanta Sports has deployed Ateme's TITAN Live platform to support its OTT video delivery operations. Ateme's transcoding technology is integrated into ...
17/11/2026
Media Links has joined the KAIROS Alliance Partner program for Panasonic's KAIROS IT/IP live video production platform. The company completed interoperabili...
17/11/2026
Behind The Mic provides a roundup of recent news regarding on-air talent, including new deals, departures, and assignments compiled from press releases and repo...
17/11/2026
In live sports and in life, things go by in the blink of an eye. Savoring the mo...
17/11/2026
Satellite operators are adding a new generation of low-Earth-orbit (LEO) network...
17/11/2026
Clear-Com has delivered five customized test systems for electromagnetic securit...