
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 ...
30/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
30/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
30/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
30/10/2026
Creative software developer Foundry today announced Nuke Stage now supports macOS, making the end-to-end virtual production and in-camera visual effects (ICVFX)...
29/10/2026
Jameis Winston and Willie Colon are among current and former players hosting pro...
29/10/2026
After arriving in Fayetteville with dreams of calling games, the Arkansas native found her passion in the control room, building a promising future in replay an...
29/10/2026
The National Hockey League is taking on a larger role in local game production w...
29/10/2026
Media Links has appointed Mikhail Zavalin Market Development Technical Specialis...
29/10/2026
Gravity Media delivered the live broadcast and media infrastructure for the 2026...
29/10/2026
Rise AV has announced the 23 women selected for the second year of its Elevate program, a six-week management and leadership development course. The cohort incl...
29/10/2026
The F d ration Internationale de l'Automobile (FIA) and Amazon Web Services (AWS) have announced a global partnership under which AWS becomes the Official A...
29/10/2026
Advanced Systems Group (ASG) has appointed Bob Daniel Storage and Workflow Solutions Architect within its Enterprise Storage team. Daniel has more than 30 years...
29/10/2026
FloSports and the Pac-12 Conference have entered a media partnership that will b...
29/10/2026
TSN will launch Film Never Lies Grey Cup Playoffs Watchalong, an altcast hosted by TSN football analyst Luke Willson, for two CFL Grey Cup Playoffs games. Wills...
29/10/2026
For decades, broadcasters have designed production around one rule: build for th...
29/10/2026
Live event production company FOH Productions has built a portable camera switch...
29/10/2026
Gravity Media is marking its 25th year facilitating the host broadcast for the M...
29/10/2026
In-venue and creative video staffers at the professional and collegiate level ha...
29/10/2026
LA28 has named film producer Kathleen Kennedy Head of Ceremonies and Content for the LA28 Olympic and Paralympic Games. Kennedy, an eight-time Academy Award nom...
29/10/2026
In-house local telecasts have added new camera angles, graphics package, and dee...
29/10/2026
In this SVG New Sponsor Spotlight, Jake Blount, EVP, Sales, ICAT Logistics, disc...
29/10/2026
Mastering plug-in treated to ground-up rebuild
With a few plug-in releases now under their belt, Musik Hack have revisited their debut offering and kitted i...
29/10/2026
New modular full-range monitoring system arrives
Following a few weeks of teasers, HEDD Audio have just revealed the latest addition to their high-end monit...
29/10/2026
SGL Carbon LLC ( SGL Carbon ) has received an additional order for the supply of nuclear graphite from X-energy Reactor Company, LLC ( X-energy ) in accordance ...
29/10/2026
Rohde & Schwarz introduces MXO AI Connect for AI-assisted oscilloscope workflows Rohde & Schwarz connects AI assistants to its MXO oscilloscopes through MXO A...
29/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/10/2026
When LinkedIn set out to upgrade meeting spaces across nine APAC cities, the goal was clear: employees needed to walk into rooms in Bangalore, Beijing, Hong Kon...
29/10/2026
Lightware has expanded its LARA (Lightware Advanced Room Automation) Wizard platform with a new Elgato Stream Deck integration, allowing supported Stream Deck d...
29/10/2026
Boston Conservatory Center Stage Presents Opera Masterpiece La Boh me The Conservatory's production of the timeless opera will conclude the fall Center St...
29/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/10/2026
NewMedia Creative Technology Studio combined a large LED character, directional voice capture and remotely hosted AI processing for AI HOST, its interactive ins...
29/10/2026
The Royal Television Society Technology Centre (RTS) presented its 2026 Special Recognition Award to Newsmax, Newsmax Ukraine, Broadcast Solutions and nxteditio...
29/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/10/2026
Share
Copy link
Facebook
X
Linkedin
Bluesky
Email...
29/10/2026
amaran, pioneer of lighting tools for creators, today announced the amaran Cam, its first webcam designed to go beyond simply capturing an image to help creator...
29/10/2026
The Sky Original returns to screens on November 26Thursday 29 October 2026
Ella Purnell is back in the killer new trailer for Sweetpea Season 2Turn on cookies ...
29/10/2026
In our increasingly climate conscious world, many cities are embracing nature, with more tree cover and open spaces such as parks, and restored wetlands, ponds,...
29/10/2026
Red Seat Ventures Announces Exclusive Partnership with Homecoming Golf Partnership Includes Homecoming Golf's New Drink Cart Scramble Series Featuring Hig...
29/10/2026
Oct. 29, 2026 - US-based Alliance for Audited Media (AAM) and the UK's ABC,...
29/10/2026
This Halloween week, GFN Thursday is delivering a fresh batch of gaming treats.
Something wicked this blade comes. S-GAME's Phantom Blade Zero launches on ...
28/10/2026
SDI Failsafe IP Routing: Inside the UTAH-400 Series 2 Router A pure-IP routing core has no inherent fallback. When the ST 2110 network degrades, when the PTP gr...
28/10/2026
MLB Network is nearly all-day media day coverage across MLB Now, MLB Central, ML...
28/10/2026
Voyage Audio and Shure microphones are in the forefront of the sector's transition to digital
Microphones may have come late to the digital table, but they...