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

26/12/2025

TV Tech's Top Streaming Stories of 2025

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

26/12/2025

TV Tech's Top Data Points of 2025

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

25/12/2025

Make Spirits Bright With Holiday Hits on GeForce NOW

Holiday lights are twinkling, hot cocoa's on the stove and gamers are settling in for a well-earned break. Whether staying in or heading on a winter getawa...

24/12/2025

What is AI good for?

What is AI good for? Posted by MTI Film on December 24, 2025 What is AI good for? What is AI good for? It's been three years since ChatGPT first cap...

24/12/2025

AI in 2026: More Collaboration, Less Hype

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

24/12/2025

Carr Lays Out FCCs 'Key Wins in 2025'

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

24/12/2025

CES: Cineverse Unveils New Features for Cinesearch

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

24/12/2025

IES, AES Promote Graham Kirk, Brienne Willcock

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

24/12/2025

Ad Tech and CTV Experts Forecast 2026's Biggest Trends

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

24/12/2025

The Boyfriend' Season 2 Unveils Heartwarming Trailer, Key Art, and Participants' Profiles

Back to All News The Boyfriend' Season 2 Unveils Heartwarming Trailer, Key...

24/12/2025

Love, Fights, and Everything in Between: Badly in Love' Returns for Season 2

Back to All News Love, Fights, and Everything in Between: Badly in Love' Returns for Season 2 Entertainment 24 December 2025 GlobalJapan Link copied t...

24/12/2025

December 23, 2025

Scripps Research study links sleep variability with sleep apnea and hypertension How consumers' digital activity trackers could enable personalized health s...

23/12/2025

How guilas Cibaeas Dominican Winter League Games Are Locally Produced for Global Audience

How guilas Cibae as Dominican Winter League Games Are Locally Produced for Glob...

23/12/2025

CAMB.AI Enables European Athletics to Offer Multi-Language Support

CAMB.AI Enables European Athletics to Offer Multi-Language SupportPlan is to eventually offer translation into all languages spoken in EuropeBy Ken Kerschbaumer...

23/12/2025

Analysis: As Sports Media Values Trend Negative, Scarcity and Quality Are King

Analysis: As sports media values trend negative, scarcity and quality are king By Callum McCarthy, Editor-at-Large Monday, December 22, 2025 - 14:08 Print ...

23/12/2025

ESPN, Disney, and NBA Return to the Animated Altcast Fray With Second Edition of Dunk the Halls'

ESPN, Disney, and NBA Return to the Animated Altcast Fray With Second Edition of...

23/12/2025

End the Year on a High Note and Donate to the Sports Broadcasting Fund Today!

End the Year on a High Note and Donate to the Sports Broadcasting Fund Today! By Ken Kerschbaumer, Editorial Director Tuesday, December 23, 2025 - 12:25 pm ...

23/12/2025

Find Your Perfect Holiday Romance Listen With These Swoon-Worthy Audiobooks

The year is winding down, the weather outside is frightful, and it's the perfect time to escape into a story that warms the heart. For listeners looking for...

23/12/2025

L3Harris Receives Letter of Intent from Kratos Defense for Production of Large Hypersonic Solid Rocket Motors

A Zeus motor is hot fire tested at L3Harris' Camden, Arkansas, solid rocket ...

23/12/2025

FCC Bans All New Foreign-Made Drones

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

23/12/2025

Gray Media Renews Its NBC Affiliation Agreements

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

23/12/2025

Lightware to showcase breakthrough Google Meet and TPN MM...

Lightware will exhibit several major product innovations at ISE 2026, including the new USB-C BOOSTER-V1, Google Meet. integration for various Taurus UCX models...

23/12/2025

Nielsen, Roku Expand Measurement Partnership

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

23/12/2025

PwC: Streaming Market Shifting to 'Scale and Sustainability'

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

23/12/2025

Inside the Gray Innovation Lab

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

23/12/2025

ESPN Renews Deal for Heisman Trophy Coverage

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

23/12/2025

Gray Media to Acquire WBBJ from Bahakel Communications

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

23/12/2025

Taking the Stage at Carnegie Hall-On a Global Scale

Taking the Stage at Carnegie Hall-On a Global Scale Boston Conservatory Orchestra students reflect on their epic concert marking the 80th session of the UN Gene...

23/12/2025

Netflix's 'The Great Flood' and 'Culinary Class Wars 2' Top Global Charts Simultaneously

Back to All News Netflix's The Great Flood and Culinary Class Wars 2 Top Gl...

23/12/2025

'Stranger Things' By the Numbers: How the Global Phenomenon Shaped Culture

Back to All News Stranger Things By the Numbers: How the Global Phenomenon Shap...

23/12/2025

Boost Performance with a System Effectiveness Review

Experience the power of WO Automation for Radio's newest service, the System Effectiveness Review. Designed to help you achieve more, a System Effectiveness...

23/12/2025

VEON's Beeline Kazakhstan and Rakuten Symphony Collaborate to Advance Next-Generation Connectivity and Digital Infrastructure

23 Dec 2025 VEON's Beeline Kazakhstan and Rakuten Symphony Collaborate to A...

23/12/2025

How Steamy Can It Get? Single's Inferno' Season 5 Premieres January 20, Previews All-Out Flirting War in Sizzling Teaser

Back to All News How Steamy Can It Get? Single's Inferno' Season 5 Pre...

23/12/2025

33 Million Global Viewers on Netflix Watched Jake Paul vs. Anthony Joshua's Epic Six-Round Battle

Back to All News 33 Million Global Viewers on Netflix Watched Jake Paul vs. Ant...

23/12/2025

December 22, 2025

New technique lights up where drugs go in the body, cell by cell Scripps Research scientists developed a technique that maps drug binding in individual cells th...

22/12/2025

SVG New Sponsor Spotlight: Presidio's Neerav Shah on the Role of Its Captivate and Resonate Platforms in Sports Production

SVG New Sponsor Spotlight: Presidio's Neerav Shah on the Role of Its Captiva...

22/12/2025

Hitting the Bullseye: Sky Sports Readies Itself for the Biggest PDC World Darts Championship to Hit Ally Pally Yet

Hitting the bullseye: Sky Sports readies itself for the biggest PDC World Darts ...

22/12/2025

Unique Skillset: Bringing New Directors to the World of Darts at The Worlds with Sky Sports

Unique skillset: Bringing new directors to the world of darts at The Worlds with...

22/12/2025

Gravity Media Prepares for a Flight of Fancy With the PDC World Darts Championship 2025 for Sky Sports

Gravity Media prepares for a flight of fancy with the PDC World Darts Championsh...

22/12/2025

One Hundred and Eighty: Gravity Media on Hitting the Production Bullseye at the World Darts Championship 2025

One hundred and eighty: Gravity Media on hitting the production bullseye at the ...

22/12/2025

The Famous Group's Jon Slusser on Fascinating Fans Through Immersive Content Experiences

The Famous Group's Jon Slusser on Fascinating Fans Through Immersive Content...

22/12/2025

ESPN's Meg Aronowitz on Continuing High-Quality Broadcasts of Collegiate Sports, Expanding Growth of Internal Production Team

ESPN's Meg Aronowitz on Continuing High-Quality Broadcasts of Collegiate Spo...

22/12/2025

ESPN Takes Data-Driven Storytelling to New Heights with MNF Playbook with Next Gen Stats' NFL Altcasts

ESPN Takes Data-Driven Storytelling to New Heights with MNF Playbook with Next ...

22/12/2025

A Decade of Giving: Fest & Flauschig' Christmas Circus Celebrates Record Turnout and Generosity

For a decade, popular German podcast Fest & Flauschig has hosted an annual Chris...

22/12/2025

Paramount and Netflix Boast Double-Digit Gains in Nielsen's November Media Distributor Gauge

Paramount Scores Largest Share Increase Among Distributors as Paramount and CBS...

22/12/2025

Nielsen and Roku Expand Strategic Measurement Partnership

New multi-year deal integrates Roku's data to fuel Nielsen's measurement suite Roku gains access to Nielsen's streaming ratings, showing The Roku C...

22/12/2025

Allen Media Group to Deploy Infillion TrueX for Streaming Services

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