Sony Pixel Power calrec Sony

ree Simple Meods to Invoke the Vidispine API From .NET Code

15/06/2016

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.
LINK: http://howto.vidispine.com/insight/three-simple-methods-to-invoke-the-...
See more stories from vidispine

Most recent headlines

05/01/2027

Worlds first 802.15.4ab-UWB chip verified by Calterah and Rohde & Schwarz to be demoed at CES 2026

Worlds first 802.15.4ab-UWB chip verified by Calterah and Rohde & Schwarz to be ...

01/06/2026

Dolby Sets the New Standard for Premium Entertainment at CES 2026

January 6 2026, 05:30 (PST) Dolby Sets the New Standard for Premium Entertainment at CES 2026 Throughout the week, Dolby brings to life the latest innovatio...

01/05/2026

NBCUniversal's Peacock to Be First Streamer to Integrate Dolby's Full Suite of Premium Picture and Sound Innovations

January 5 2026, 18:30 (PST) NBCUniversal's Peacock to Be First Streamer to ...

01/04/2026

DOLBY AND DOUYIN EMPOWER THE NEXT GENERATON OF CREATORS WITH DOLBY VISION

January 4 2026, 18:00 (PST) DOLBY AND DOUYIN EMPOWER THE NEXT GENERATON OF CREATORS WITH DOLBY VISION Douyin Users Can Now Create And Share Videos With Stun...

17/01/2026

Lightware and Google enhance meeting room flexibility wit...

Lightware, an industry leader in signal management, is helping to elevate the Google Meet experience with the introduction of an integration with Taurus UCX. Th...

17/01/2026

Clear-Com Partners with NETGEAR to Deliver OEM Networking...

Clear-Com announced a strategic partnership with NETGEAR AV to offer four high-performance networking switches as original equipment manufacturer (OEM) solutio...

17/01/2026

QuickLink Expands US Reach With Midwich Distribution

QuickLink, a leading provider of award-winning video production and remote guest contribution solutions, today announced a new U.S. distribution partnership wit...

17/01/2026

NUGEN Audio Launches the Next Evolution of MasterCheck

NUGEN Audio announces the latest evolution of MasterCheck, its industry-trusted optimization plug-in for cross-platform mastering and loudness verification. Des...

17/01/2026

BHV Introduces Pro AV Market to SportsBox at ISE 2026

BHV has announced that it will highlight its new SportsBox remote vision mixer and picture processor at ISE in Booth #4H900 marking its official introduction in...

17/01/2026

Clear-Com Reveals New 4-Channel HelixNet Beltpack and Adv...

Clear-Com will return to ISE 2026 to demonstrate its latest intercom solutions for broadcast, live production, and AV professionals. Exhibiting at Stand #4P700...

17/01/2026

Grass Valley Brings Scalable Creative Freedom to Broadcas...

Grass Valley, a leading provider in live production solutions, will exhibit at ISE 2026 in Barcelona from February 3 6, presenting its vision for how modern Bro...

17/01/2026

Utelogy Advances AI and Cloud-First Innovation at ISE 202...

Utelogy Corporation, the global leader in connected workplace management, monitoring, control, automation and analytics closes out a record-breaking 2025. The c...

17/01/2026

FOR-A Europe to Demonstrate Broadcast and Pro-AV Converge...

FOR-A, a cutting-edge video broadcast technology company backed by more than 50 years experience, will showcase its innovative production solutions at ISE 2026 ...

17/01/2026

Tim Jackson Appointed Sr Director of Sales and Business D...

Techex, the UK-based expert in live video solutions over IP and cloud, today announced that Tim Jackson has joined the company as Senior Director of Sales and B...

17/01/2026

Redflag AI Joins Akamais New ISV Catalyst Program as the...

Redflag AI, an AI-powered content protection platform, and Akamai, the cybersecurity and cloud computing company that powers and protects business online, today...

17/01/2026

Encompass Digital Media Strengthens Global Operations wit...

Encompass Digital Media has today announced the appointment of David Hunter as Chief Operating Officer (COO). As a highly respected technology and operations le...

17/01/2026

Glensound highlights quality practicality and innovation...

Glensound is set to showcase its audio and intercom solutions supporting broadcast, live events and professional AV environments at ISE 2026 (stand 7H800, Fira ...

17/01/2026

Matrox Video Showcases New AV-over-IP Capabilities Drivin...

As Matrox Video marks its 50th year of innovation, the company will use ISE 2026 to showcase the latest advancements across its AV-over-IP ecosystem, highlighti...

17/01/2026

Hollywood Professional Association Unveils 2026 HPA Award...

The Hollywood Professional Association (HPA) today announced the nominees for the 2026 HPA Awards Innovation & Technology, marking an expanded evolution of the ...

17/01/2026

Sinclair Asks FCC to Approve Nexstar/Tegna Deal

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

16/01/2026

From Berlin to London: Amazon Prime Video Delivers NBA Europe Games to Global Audience

From Berlin to London: Amazon delivers NBA Europe games for an international aud...

16/01/2026

How Vizrt, TriCaster Helped Harvard Athletics Embrace Vertical Video and More to Serve Fans

How Vizrt, TriCaster Helped Harvard Athletics Embrace Vertical Video and More to...

16/01/2026

SVG GameDay, Ep. 1: PMY Group's Mike Bonner

SVG GameDay, Ep. 1: PMY Group's Mike BonnerThe longtime industry veteran provides insight into his approach to producing live eventsBy Kristian Hern ndez, S...

16/01/2026

Attacking the Pin: Inside the PGA TOUR's Replay Remodel With Hawk-Eye Innovations

Attacking the Pin: Inside the PGA TOUR's Replay Remodel With Hawk-Eye Innova...

16/01/2026

Back to Unrivaled: TNT Sports Reconnects With Mediapro for the League's Sophomore Season

Back to Unrivaled: TNT Sports Reconnects With Mediapro for the League's Soph...

16/01/2026

FloSports Orchestrates Mega Weekend Spotlighted by Chili Bowl Nationals, UCA & UDA College Nationals

FloSports Orchestrates Mega Weekend Spotlighted by Chili Bowl Nationals, UCA & U...

16/01/2026

Sundance Institute Names 2026 Screenwriters Lab and Screenwriters Intensive Fellows

Eleven Projects to Be Developed at Annual January Screenwriters Lab; Nine Projec...

16/01/2026

5 Audiobooks to Help You Level Up in 2026

The start of a new year brings fresh possibilities. Whether you're diving in with big goals or simply setting new intentions, audiobooks can bring inspirati...

16/01/2026

1 Year In: How Creators Are Growing Their Shows and Connecting With Audiences Through the Spotify Partner Program

In 2025 we launched the Spotify Partner Program to give creators more ways to tu...

16/01/2026

NAB Spokesman Alex Siciliano to Depart

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

16/01/2026

Marshall Electronics Showcases the VMV 402 3GSH Seamless...

Marshall Electronics is showcasing its VMV-402-3GSH Seamless 4X Switch at ISE 2026 (Booth 4N900). Designed for presentation systems, control rooms and remote pr...

16/01/2026

HPA Announces Innovation & Technology Award Nominees

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

16/01/2026

Graduate Spotlight: Nadia Castagna

Graduate Spotlight: Nadia Castagna The educator, who grew up in Rochester, New York, shares how she went from Berklee to collaborating on meaningful programs ...

16/01/2026

Culinary Class Wars' Returns for Season 3, Raising the Stakes With a Team-Based Showdown

Back to All News Culinary Class Wars' Returns for Season 3, Raising the St...

15/01/2026

Milano Cortina 2026: OBS CEO Yiannis Exarchos Previews Production Innovations

Milano Cortina 2026: OBS CEO Yiannis Exarchos Previews Production InnovationsFirst Person View drones, AI-based tech target greater fan engagement, efficiencyBy...

15/01/2026

Clever With Cameras: Bringing the Drama of the 2026 ISU European Figure Skating Championships to Viewers with Sunset+Vine

Clever with cameras: Bringing the drama of the 2026 ISU European Figure Skating ...

15/01/2026

No Stranger to Ice: Host Broadcaster Sunset+Vine on Pressure and Planning for the 2026 ISU European Figure Skating Championships

No stranger to ice: Host broadcaster Sunset Vine on pressure and planning for th...

15/01/2026

SVG Campus Shot Callers: Leah Gill, Associate Athletic Director, Digital Media, University of Tennessee at Chattanooga

SVG Campus Shot Callers: Leah Gill, Associate Athletic Director, Digital Media, ...

15/01/2026

National Sports Broadcaster Perspectives: What to Expect in Production in 2026

National Sports Broadcaster Perspectives: What to Expect in Production in 2026Leaders from ESPN, FOX Sports, Netflix, and Warner Bros. Discovery share their pro...

15/01/2026

From Berlin to London: Amazon Delivers NBA Europe Games for an International Audience

From Berlin to London: Amazon delivers NBA Europe games for an international aud...

15/01/2026

Sundance Institute Appoints David Linde as CEO

LOS ANGELES, CA, January 15, 2026 - The nonprofit Sundance Institute today announced the appointment of David Linde as Chief Executive Officer. Linde will assum...

15/01/2026

Excellent training at SGL Carbons Bonn site

The SGL Carbon site in Bonn has a long tradition of training. For many years, young talent has been successfully trained here, regularly achieving excellent exa...

15/01/2026

SGL Carbon and BMW Group receive JEC Innovation Award for Natural Fiber Composites Project

The JEC Composites Innovation Awards annually honor the most innovative and ambi...

15/01/2026

SGL Carbon signs long-term supply agreement with X-energy

X-energy Reactor Company, LLC ( X-energy ) and SGL Carbon LLC ( SGL ) have signed a 10-year framework agreement to provide graphite for the deployment of X-ener...

15/01/2026

Versant Completes Acquisition Of Free TV Networks

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

15/01/2026

House Oversight Hearing on FCC Puts Chair in Spotlight

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

15/01/2026

Radiant Media Player, Cloud DRM Partner on Integration

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

15/01/2026

Telycam to Showcase New Mix One Video Switcher at ISE 2026

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

15/01/2026

Pliant Names Adam Grede as Regional Sales Manager

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

15/01/2026

NFL Wild Card Games Score With Viewers

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...