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 ...

04/08/2026

Dalet Announces Commercial Availability of Dalia, Bringing Media-Aware Agentic AI to Enterprise Productions

Dalet, a leading technology and service provider for media-rich organizations, t...

04/07/2026

Detective Conan: Fallen Angel of the Highway Opens in Dolby Cinemas Across Japan, Presented in Dolby Atmos and Dolby ...

April 7 2026, 19:00 (PDT) Detective Conan: Fallen Angel of the Highway Opens in...

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...

02/05/2026

Dalet Flex LTS Delivers Smarter Search, Faster Editing, and an AI-Ready Foundation for Modern Media

Dalet, a leading technology and service provider for media-rich organizations, t...

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 ...

28/04/2026

WNBA to Stream All Preseason Games for Free

Share Copy link Facebook X Linkedin Bluesky Email...

28/04/2026

Nexstar Media Charitable Foundation Sets 30 Days of Giving'

Share Copy link Facebook X Linkedin Bluesky Email...

28/04/2026

Sinclair's Chief Compliance Officer Jeff Lewis to Retire

Share Copy link Facebook X Linkedin Bluesky Email...

28/04/2026

Nielsen Introduces Predictive Sales Lift' Tool

Share Copy link Facebook X Linkedin Bluesky Email...

28/04/2026

Sencore's VB440 Monitoring, Analysis Tool Debuts at NAB Show

Share Copy link Facebook X Linkedin Bluesky Email...

28/04/2026

Pinterest Makes a Major Push into CTV Advertising

Share Copy link Facebook X Linkedin Bluesky Email...

28/04/2026

Introducing Nx 3-Strip v2 - A Physics-Based Technicolor Reconstruction for DaVinci Resolve

Introducing Nx 3-Strip v2 - A Physics-Based Technicolor Reconstruction for DaVin...

27/04/2026

CES Power Acquires Three Ireland-Based Businesses

CES Power, a provider of infrastructure for live events, has announced the acquisition of three Ireland-based businesses: GH Energy Rental Ltd, Event Power, and...

27/04/2026

Fubo to Launch Multiview on Select LG TVs Ahead of 2026 Football Season

FuboTV Inc. has announced it is developing its Multiview feature for the Fubo streaming service on select LG TVs, including 2024, 2025, and newer 4K and 8K mode...

27/04/2026

Shade Raises $14 Million in Funding Round Led by Khosla Ventures

Shade, a file management platform for creative teams, has announced a $14 million funding round led by Khosla Ventures, Construct Capital, and Bling Capital, br...

27/04/2026

AES to Present Immersive Audio Academy 12th Edition on April 30

The Audio Engineering Society (AES) will present the Immersive Audio Academy 12th Edition - Immersive Audio in All Flavors - on April 30, 2026, at 12:00 p.m. ...

27/04/2026

DAZN Launches DAZN48 Creator Program for FIFA World Cup 2026

DAZN has announced DAZN48, a creator program for the FIFA World Cup 2026 that will recruit 48 creators - one representing each of the 48 qualified nations - to ...

27/04/2026

FloSports Acquires Streaming Rights to Four CrossFit Events

FloSports has announced exclusive streaming rights to four CrossFit competitions: Legends Del Mar: CrossFit Semi-Finals, Magic City Games, NorCal Classic, and t...

27/04/2026

NAB 2026: Telestream Pulse Named NAB Show 2026 Product of the Year for Monitoring and Measuring

Telestream has announced that Pulse, its software-defined test and measurement p...

27/04/2026

NAB 2026: Shade Wins 2026 NAB Show Product of the Year Award

Shade has announced it is a Cloud Computing and Storage winner in the 2026 NAB Show Product of the Year Awards. Winners were selected by a panel of industry exp...

27/04/2026

SVG All-Stars: Kelsey Kjeldsen, Senior Director and Video Ads Platform Lead, DTC Products, Tech, and Operations, NBA

Leading the NBA's video-ads platform, this Penn State grad is at the forefro...

27/04/2026

DAZN Extends T100 Triathlon World Tour Rights to Africa

DAZN has expanded its international broadcast rights for the T100 Triathlon World Tour to include Africa. All races from the T100 calendar will be available for...

27/04/2026

NAB 2026: NAB Show Announces 2026 Project and Product of the Year Award Winners

NAB Show has announced the recipients of its 2026 Project of the Year and Product of the Year Awards at a ceremony at the Las Vegas Convention Center. Each wi...

27/04/2026

DIRECTV Launches on Meta Quest Headsets as Sports Season Heats Up

DIRECTV has launched on Meta Quest headsets, becoming the first MVPD to offer live TV through the platform. The timing coincides with the stretch run of the MLB...

27/04/2026

TBL Team Boxing League and MSG Networks Announce Broadcast Partnership

TBL Team Boxing League has announced a broadcast agreement with MSG Networks to air all remaining Season 4 fights live across MSG's television and digital p...

27/04/2026

Audio Exhibitors Showcase New Platforms, Innovative Solutions for Complex Issues

IP integration, interoperability, growth of intercommunications were key concerns for vendors and visitors alike Attendees at the recently concluded 2026 NAB S...

27/04/2026

Behind The Mic: Kenny Beecham to Launch NBA Radio Show on SiriusXM; Mike Tomlin to Join NBC Pregame Show

Behind The Mic provides a roundup of recent news regarding on-air talent, includ...

27/04/2026

On the Show Floor, the Microphone Is Still the Place Where Audio Begins

A pro-audio emphasis, spectrum changes, and on-field audio mark the new products and enhancements to existing offerings Microphones remain the primary point of...

27/04/2026

NAB Show 2026 In Review: Our Complete Collection of Video Interviews with Industry Thought Leaders

The Sports Video Group team was all over the NAB Show floor out in Las Vegas las...

27/04/2026

Svenska artister genererade nra 2 miljarder kronor frn Spotify under 2025

N r Spotify grundades f r 20 r sedan dominerades musikmarknaden av illegal nedladdning. Sedan dess har streaming bidragit till att teruppr tta betalningsvilja...

27/04/2026

Introducing Fitness With Spotify: A New Way to Bring Movement Into Your Daily Routine

Time on Spotify should feel meaningful and intentional, not something that slips...

27/04/2026

Brainworx release bx_tonebox

New modular multi-effects plug-in revealed The latest plug-in from Brainworx delivers a modular set of effects designed to offer a convenient alternative to...

27/04/2026

Desert Island Boom Set from Schoeps

Kit includes supercardioid & shotgun capsules High-end mic manufacturer Schoeps have recently introduced another member of their Desert Island Set family. O...

27/04/2026

Sound Skulptor introduce the LA502T

LA2A-inspired 500-series module arrives Sound Skulptor have announced the upcoming launch of a new 500-series module that aims to recreate one of the most p...

27/04/2026

Stam Audio announce the SA-4000+

SSL-inspired compressor unit upgraded Stam Audio are well known for their painstaking recreations of vintage audio gear, with their extensive product range ...

27/04/2026

Study: Local TV Political Ad Spend to Top $4 billion in 2026

Share Copy link Facebook X Linkedin Bluesky Email...

27/04/2026

Nippon TV's In-House Proprietary AI Solution AiDi Wins Product of the Year Award at NAB 2026

Nippon TV's In-House Proprietary AI Solution AiDi Wins Product of the Year A...

27/04/2026

Outpost Introduces Unlimited Collaboration Model for Review and Approval Workflows

Outpost Introduces Unlimited Collaboration Model for Review and Approval Workflo...

27/04/2026

Ikegami Announces VFE-P07D Monocular OLED Viewfinder with Tiltable 3.5-inch LCD Monitor

Ikegami Announces VFE-P07D Monocular OLED Viewfinder with Tiltable 3.5-inch LCD ...

27/04/2026

Custom Consoles Completes Large Module-R MCR Desk and Med...

Custom Consoles announces the completion of a large Module-R desk and MediaWall monitor display mount for an expanded master control room at Gravity Medias West...

27/04/2026

Other World Computing Launches OWC Express 4M2 Ultra - Thunderbolt 5 Four-Slot NVMe M.2 SSD Enclosure

Other World Computing Launches OWC Express 4M2 Ultra - Thunderbolt 5 Four-Slot N...

27/04/2026

Netflix announces El sobrino, the new film by Damin Szifron starring Leonardo Sbaraglia

Back to All News Netflix announces El sobrino, the new film by Dami n Szifron s...

27/04/2026

Red Seat Ventures Announces Exclusive Multiyear Partnership with Kill Tony

Red Seat Ventures Announces Exclusive Multiyear Partnership with Kill Tony The Company is the New Monetization and Distribution Home for the Globally Popula...

27/04/2026

RT 2FM launches nationwide quest for next superstar DJ to play Forbidden Fruit Festival

RT 2FM is calling on aspiring DJs across Ireland to take their shot at the spot...

27/04/2026

RT is Supporting 32 Arts and Cultural Events all over Ireland this May

RT continues to champion Ireland's creative life this May, supporting a broad range of festivals, exhibitions and performances across music, theatre, liter...

26/04/2026

Director Yoon Jong-bin Returns with The Generals' (WT), An Incisive Chronicle of a Second-in-Command

Back to All News Director Yoon Jong-bin Returns with The Generals' (WT), A...

26/04/2026

'Nine Queens,' Starring Alvaro Morte and Patrick Criado, Starts Production

Back to All News Nine Queens, Starring Alvaro Morte and Patrick Criado, Starts ...

25/04/2026

Spotify and Vogue Celebrate Music and Culture in Mexico City

In the heart of Mexico City, music, culture, and fashion converged last night as Spotify and Vogue Latin America welcomed guests to an intimate gathering at Soh...