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

10/12/2025

Sound-Alike Commercials Are Part of Sports' Soundtrack

Sound-Alike Commercials Are Part of Sports' Soundtrack Johnny Cash for Coca-Cola is the latest in a long litany of sonic approximationsBy Dan Daley, Audio ...

10/12/2025

Immersive Sound Is Logical Next Step for Sports Venues

Immersive Sound Is Logical Next Step for Sports VenuesSound-systems suppliers are sanguine, but the market has its challengesBy Dan Daley, Audio Editor Wednes...

10/12/2025

The Romans Built Arenas for Immersive Sound 2,000 Years Ago

The Romans Built Arenas for Immersive Sound 2,000 Years AgoThe historic Arena of Nimes in France is still in use todayBy Dan Daley, Audio Editor Wednesday, De...

10/12/2025

SVG Summit 2025 Preview: Audio Workshop Hits on Immersive, Virtualized, and Next-Gen Streaming Workflows

SVG Summit 2025 Preview: Audio Workshop Hits on Immersive, Virtualized, and Next...

10/12/2025

SVG Summit 2025 Technology Exhibits Preview: Audio Spotlight

SVG Summit 2025 Technology Exhibits Preview: Audio SpotlightBy SVG Staff Wednesday, December 10, 2025 - 8:21 am Print This Story | Subscribe Story Highlig...

10/12/2025

SVG Europe Audio: Listening to the Sounds of Powder and Ice at Milano Cortina with a Behind the Scenes Tour of OBS and NBC's Audio Set Ups

SVG Europe Audio: Listening to the sounds of powder and ice at Milano Cortina wi...

10/12/2025

Advancements in Audio Technology: Capturing the Atmosphere of Live Sports

Advancements in audio technology: Capturing the atmosphere of live sports By David Davies Tuesday, November 25, 2025 - 09:27 Print This Story Although wor...

10/12/2025

Everything Smelled of Popcorn: The Art of Bringing the Complex Sound of Esports to Fans With Sound Supervisor Matt Gilbert

Everything smelled of popcorn: The art of bringing the complex sound of esports ...

10/12/2025

2026 Sundance Film Festival Unveils 97 Projects Selected for the Feature Film and Episodic Program

Top L-R: Ha-Chan, Shake Your Booty!, Hanging by a Wire, Broken English, Buddy C...

10/12/2025

You're in Control: Spotify Lets You Steer the Algorithm

For the first time, Spotify is giving users the power to steer the algorithm. Gustav S derstr m, Spotify's Co-President, CPO, and CTO, shares the vision beh...

10/12/2025

L3Harris to Produce Additional Solid Rocket Motors for Precision-Guided Artillery System

L3Harris' new contract for Guided Multiple Launch Rocket System Insensitive ...

10/12/2025

US Space Force Expands Offensive Space Programs Through L3Harris Foreign Sales

L3Harris Meadowlands system has been designed with an open architecture software system that allows for more flexible and efficient software updates. This capab...

10/12/2025

Football Shifts TV Viewing Towards Ad Supported, Nielsen's Q3 2025 Ad Supported Gauge Finds

During this interval, streaming comprised the majority of ad supported TV (46.4%...

10/12/2025

Bitcentral Names Venture Capital Exec Rick Arnold to Board

NEWPORT BEACH, Calif. Bitcentral, a provider of production, asset management, playout and streaming workflow solutions, has named technology veteran Rick Arnold...

10/12/2025

TV Tech Announces Winners of 2025 Best in Market Awards for M&E Tech

TV Tech is delighted to reveal the winners of the 2025 Media & Entertainment: Best in Market Awards....

10/12/2025

AIMS, VSF, AMWA, EBU To Hold Inaugural IPMX Testing, Certification Event

BOTHELL, Wash. The Alliance for IP Media Solutions (AIMS), the Video Services Forum (VSF), the Advanced Media Workflow Association (AMWA) and the European Broad...

10/12/2025

DirecTV Launches Peacock Games

In a notable example of how pay TV operators are integrating streaming services into their lineup and using those services to retain or attract subscribers, Dir...

10/12/2025

Chaos Brings Real-Time Rendering to Maya and Houdini

Today, Chaos builds instant feedback into the viewport, connecting Maya and Houdini to Chaos Vantage's real-time path tracer. Artists can now assess 3D asse...

10/12/2025

Smeup doubles capacity with Cubbit under a new agreement...

Smeup, a key partner for companies engaged in digital transformation, today announced the expansion of its adoption of Cubbit, the first geo-distributed cloud s...

10/12/2025

Mediagenix Strengthens Its Security Posture with ISO 2700...

Mediagenix, a global leader in smart content solutions to profitably connect the right content to the right audience, today announced two significant milestones...

10/12/2025

HDR10+ Technologies Unveils HDR10+ ADVANCED Dynamic Metadata Technology

BEAVERTON, Ore. HDR10+ Technologies, LLC has announced that they will soon begin the licensing and certification of devices, content, and services that support ...

10/12/2025

SMPTE, EBU, ETC Publish Report on AI's Impact on the Media

SMPTE has joined forces with the European Broadcasting Union (EBU) and Entertainment Technology Center (ETC) to publish an updated report on AI and its impact o...

10/12/2025

Clear-Com Appoints Kris Koch as New Director of Sales - N...

Clear-Com is pleased to announce the appointment of Kris Koch as Director of Sales - North & South America. In this expanded leadership role, Kris will oversee...

10/12/2025

Mavis Camera Launches Film Kit Unlocking LUT Workflows an...

Mavis today announced the latest version of Mavis Camera (v7.4), a major update to its professional iOS camera app, headlined by the launch of Film Kit - an opt...

10/12/2025

Creamsource Taps Industry Heavyweight Markus Zeiler as Gr...

Creamsource, renowned for its Vortex series of cinematic lighting, is laying the groundwork for its next phase of growth with the addition of Markus Zeiler as G...

10/12/2025

Digital Alert Systems Introduces DAS3-DC-PS DASDEC-III DC...

Digital Alert Systems, a global leader in emergency communications solutions for media providers, today announced that the DAS3-DC-PS, a new DC power supply opt...

10/12/2025

Riedel and Racing Electronics Announce Strategic Partners...

Riedel Communications today announced it has formed a strategic partnership with Racing Electronics, a premier provider of motorsport communication equipment in...

10/12/2025

GALSNGEAR Announces 2026 Leadership Retreats on East and...

#GALSNGEAR is launching two signature leadership retreats in early 2026, designed to equip women in media, entertainment, and technology with the tools to lead...

10/12/2025

CVP Launches Global Price Guarantee for Seamless Internat...

Providing worldwide customers with total confidence through transparent, all-inclusive pricing CVP, one of Europe's leading suppliers of professional video...

10/12/2025

Securing the Future of Broadcast TV in the U.S.

With the Federal Communications Commission working on new rules for the deployment of NextGen TV, next year promises to be an important one for both the future ...

10/12/2025

Former Charter CEO Tom Rutledge to Receive Cable Centers Bresnan Award

DENVER Tom Rutledge, director emeritus and former president and CEO of Charter Communications, will be honored with the 2026 Bresnan Ethics in Business Award by...

10/12/2025

Cadent Acquires YouTube Measurement Firm VuePlanner

NEW YORK Novocap's Cadent has acquired VuePlanner, a YouTube video ad planning, optimization, and measurement company in a deal that will help Cadent expand...

10/12/2025

Avoid Playlist Conflicts: Scheduling Back-to-Back Special Playlists

In preparation for the madness of March, here are some important reminders for scheduling back-to-back Special Playlists. The first Special Playlist MUST end b...

10/12/2025

VEON's Rising Capital Markets Profile Strengthened by Inclusion in Key Global Indices

10 Dec 2025 VEON's Rising Capital Markets Profile Strengthened by Inclusion...

10/12/2025

VEON Recognized for JazzCash, Kyivstar and Jazz at the World Communication Awards 2025

10 Dec 2025 VEON Recognized for JazzCash, Kyivstar and Jazz at the World Commun...

10/12/2025

Tribeca Films to Release the Independent Documentary Film Beam Me Up, Sulu by Timour Gregory and Sasha Schneider

December 10th, 2025 TRIBECA FILMS TO RELEASE THE INDEPENDENT DOCUMENTARY FILM...

10/12/2025

Sky extends partnership with the Ladies European Tour for a landmark 30th year

Wednesday 10 December 2025 Sky extends partnership with the Ladies European Tour for a landmark 30th year Sky and the Ladies European Tour (LET) have announce...

10/12/2025

Walk-on if you love the darts: James Maddison, Luke Littler and Big John star as Club 180 opens before 2026 PDC World Darts Championship

Wednesday 10 December 2025 Walk-on if you love the darts: James Maddison, Luke ...

10/12/2025

Rohde & Schwarz presents world's first RF power sensor with 0.80 mm RF connector for gapless DC to 150 GHz coverage

Rohde & Schwarz presents world's first RF power sensor with 0.80 mm RF conne...

10/12/2025

2026 Starts With a Swoon: Kim Seon-ho and Go Youn-jung Lead Can This Love Be Translated?', Premiering January 16

Back to All News 2026 Starts With a Swoon: Kim Seon-ho and Go Youn-jung Lead C...

10/12/2025

'Berlin and the Lady with an Ermine' Arrives to Netflix on May 15

Back to All News Berlin and the Lady with an Ermine Arrives to Netflix on May 15 Entertainment 10 December 2025 GlobalSpain Link copied to clipboard THE N...

10/12/2025

From stand-up to Foxtrot: Comedian Michael Fry revealed as fourth contestant for Dancing with the Stars 2026

It's out of the frying pan and into the sequins for comedian and actor Micha...

10/12/2025

Documentary film on the extraordinary life of Patrick Lydon, pioneer of social inclusion and disability, to premiere on RT

Born That Way airs Thursday 18 December on RT One and RT Player Born That ...

09/12/2025

2025 Sports Broadcasting Hall of Fame: Pam Oliver, Sideline Icon Who Redefined the Role

2025 Sports Broadcasting Hall of Fame: Pam Oliver, Sideline Icon Who Redefined t...

09/12/2025

SVG Summit 2025 Technology Exhibits Preview, Part 2

SVG Summit 2025 Technology Exhibits Preview, Part 2By Jason Dachman, Editorial Director, U.S. Tuesday, December 9, 2025 - 7:17 am Print This Story | Subscr...

09/12/2025

SVG Summit 2025 Preview: Cloud Production Workshop Spotlights Live and Non-Live Workflows in the Cloud

SVG Summit 2025 Preview: Cloud Production Workshop Spotlights Live and Non-Live ...

09/12/2025

Next-Generation Content Protection: Multi-Technology Security is Integral to Combating New Threats

Next-generation content protection: Multi-technology security is integral to com...

09/12/2025

CBS Sports Provides One-of-a-Kind Production' for UEFA Champions League Crossover Event

CBS Sports Provides One-of-a-Kind Production' for UEFA Champions League Cro...

09/12/2025

Spanish Professional Basketball League Relies on NETGEAR AV, MAM Tech for Seamless Production

Spanish Professional Basketball League Relies on NETGEAR AV, MAM Tech for Seamle...