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

16/11/2025

Symphony MKII TB2 to TB3 Self Install Guide

Upgrading your Apogee Symphony MKII from TB2 to TB3: Need to Knows Upgrading your Apogee interface to Thunderbolt 3 isn't difficult - but it's not a cas...

16/11/2025

Apogee Electronics Acquired by Dirk Ulrich's Rockforce Tech Holding, Parent Company of Manley Labs

Apogee Electronics Acquired by Dirk Ulrich's Rockforce Tech Holding, Parent ...

15/11/2025

Disney, YouTube TV Reach Multi-Year Distribution Deal

BURBANK, Calif. The Walt Disney Company and YouTube TV have reached a new multi-year distribution agreement, ending a carriage dispute that had blacked out ABC,...

15/11/2025

ATSC 3.0 Interop Puts NextGen TV's Advanced Features in the Crosshairs

PLYMOUTH, Wis. A group of about 20 TV technology vendors supporting NextGen TV are wrapping up their ATSC 3.0 Interop here at Heartland Video Systems headquarte...

15/11/2025

NBCUniversal to Launch NBC Sports Network on Nov. 17

NEW YORK NBCUniversal has announced that it will be launching NBC Sports Network (NBCSN), a 24/7 linear network featuring a wide range of marquee sporting event...

15/11/2025

FCC Updates Agenda for November Open Meeting

WASHINGTON The Federal Communications Commission has released an updated agenda for its Open Meeting on Thursday, November 20, 2025, which is scheduled to comme...

15/11/2025

Study: DOCSIS 3.1 Drives 3X Increase in Median Broadband Usage

JERSEY CITY, N.J. OpenVault has released new data showing that DOCSIS 3.1 and higher services are driving significant across-the-board increases in speed and co...

15/11/2025

Gray Media Inks OTA Deal for Ohio Valley Conference Basketball

ATLANTA Gray Media has concluded an agreement with the Ohio Valley Conference ( OVC ) to broadcast OVC college basketball games across 20 Gray markets in five s...

15/11/2025

Wheatstone Names Darrin Paley VP of Business Accounts

NEW BERN, N.C. Wheatstone has named company veteran Darrin Paley vice president of business accounts, effective immediately....

15/11/2025

Netflix Serves Up the Trailer for Dining with the Kapoors': A Celebration of Legacy, Laughter and Love

Back to All News Netflix Serves Up the Trailer for Dining with the Kapoors'...

14/11/2025

Op-Ed: The Automation Imperative - Why AI Is the Only Scalable Defense Against Live-Sports Piracy

Op-Ed: The Automation Imperative - Why AI Is the Only Scalable Defense Against L...

14/11/2025

FutureSPORT 2025: Caretta Research on Why Streaming Won't Save Broadcasters

FutureSPORT 2025: Caretta Research on why streaming won't save broadcasters By Jo Ruddock Monday, November 10, 2025 - 14:37 Print This Story Caretta R...

14/11/2025

Daneysse Daniels, Emmy-Winning Production Manager and Beloved Teammate at TNT Sports, ESPN, and FOX Sports, Passes Away at 35

Daneysse Daniels, Emmy-Winning Production Manager and Beloved Teammate at TNT Sp...

14/11/2025

The NBA 2K League Returns as an Immersive Entertainment Ecosystem' With Non-Stop Multiplatform Content

The NBA 2K League Returns as an Immersive Entertainment Ecosystem' With Non...

14/11/2025

Inaugural SVG LIVE! Conference Brings 250+ Top Sports and Entertainment Production Leaders Together in L.A.

Inaugural SVG LIVE! Conference Brings 250 Top Sports and Entertainment Producti...

14/11/2025

From Family Band to Icon: Selena y Los Dinos is a Loving Tribute to the Queen of Tejano

(L-R) Suzette Quintanilla, Isabel Castro, and Chris P rez attend the 2025 Sundan...

14/11/2025

Casa Spotify Celebrates Latin Music's Biggest Week in Las Vegas

This week, Casa Spotify lit up Las Vegas with an unforgettable celebration of Latin music and culture ahead of the 26th Annual Latin Grammy Awards. Hosted at th...

14/11/2025

Boston Conservatory Orchestra to Perform at Carnegie Hall for United Nations General Assembly

Boston Conservatory Orchestra to Perform at Carnegie Hall for United Nations Gen...

14/11/2025

Berklee Alum Lewis Pickett Wins Record of the Year at Latin Grammy Awards

Berklee Alum Lewis Pickett Wins Record of the Year at Latin Grammy Awards Pickett, a 2009 graduate, was nominated six times across three categories at this ye...

14/11/2025

ATSC 3.0 Interop Puts NextGen TV Advanced Features In The Crosshairs

PLYMOUTH, Wisc. A group of about 20 TV technology vendors supporting NextGen TV are wrapping up their ATSC 3.0 Interop here at Heartland Video Services headquar...

14/11/2025

NECF Launches Patented AI Platform That Turns Idle Contro...

What if your idle operations centers, inactive cloud time, staff or you as a freelancer could start generating revenue tomorrow? NECF Corporation today announc...

14/11/2025

Dalet Named a Major Player in the 2025 IDC MarketScape fo...

Dalet, a leading provider of cloud-native, end-to-end media workflow solutions, today announced that it has been recognized as a Major Player in the IDC MarketS...

14/11/2025

Record-Breaking Live Broadcast Achieved with Clear-Com at...

The recent ADAC RAVENOL 24h Race at Germany's legendary N rburgring circuit marked a milestone for live broadcast production, and Clear-Com played a pivota...

14/11/2025

To stream FIFA Club World Cup 2025 to millions DAZN trust...

Streaming tech companies M2A Media and Unified Streaming provided key software components that enabled the world's leading sports entertainment platform, DA...

14/11/2025

Lightware ESG initiatives empower communities and inspire...

Lightware, an industry leader in signal management solutions, is strengthening its commitment to sustainability through a series of people-focused ESG (Environm...

14/11/2025

FCC Extends Filing Deadlines

WASHINGTON As the federal government shut down comes to an end, the Federal Communications Commission has further extended some filing deadlines and issued some...

14/11/2025

Versant Consolidates Sports Operations Under 'USA Sports' Brand

STAMFORD, Conn. In the run-up to being spun off from Comcast, Versant has announced that USA Sports will be the new brand and division name for the company'...

14/11/2025

Documentary short, Children No More, comes to Sky this December

Friday 14 November 2025 Documentary short, Children No More, comes to Sky this December Following its world premiere at DOC NYC yesterday, Sky today announces...

14/11/2025

Sky to remain the home of Ryder Cup and DP World Tour through 2029

Friday 14 November 2025 Sky to remain the home of Ryder Cup and DP World Tour through 2029 Sky and the DP World Tour have today announced a four-year partners...

14/11/2025

Rohde & Schwarz redefines border security with comprehensive signals intelligence solutions at MILIPOL Paris

Rohde & Schwarz redefines border security with comprehensive signals intelligenc...

14/11/2025

Rohde & Schwarz, together with Samsung, first to validate 3GPP NR-NTN conformance across RF, RRM and PCT

Rohde & Schwarz, together with Samsung, first to validate 3GPP NR-NTN conformanc...

14/11/2025

Netflix Unveils the Trailer of 'City of Shadows'

Back to All News Netflix Unveils the Trailer of City of Shadows Entertainment 14 November 2025 GlobalSpain Link copied to clipboard PREMIERING ON NETFLIX ...

14/11/2025

How to Unlock Accelerated AI Storage Performance With RDMA for S3-Compatible Storage

Today's AI workloads are data-intensive, requiring more scalable and afforda...

14/11/2025

The Late Late Toy Show blasts off! RT launches The Late Late Toy Show's official trailer

The Late Late Toy Show blasts off! RT launches The Late Late Toy Show's of...

14/11/2025

November 13, 2025

Scripps Research study reveals how uterine contractions are regulated by stretch and pressure during childbirth Molecular insights could lead to improved labor ...

13/11/2025

Versant Announces USA Sports as New Brand for Sports Portfolio

Versant Announces USA Sports as New Brand for Sports PortfolioBy SVG Staff Thursday, November 13, 2025 - 6:15 am Print This Story | Subscribe Story Highli...

13/11/2025

SVG Campus Shot Callers: Mike Szlamowicz, Assistant Athletics Director, Sport and Broadcast Production, University of Virginia

SVG Campus Shot Callers: Mike Szlamowicz, Assistant Athletics Director, Sport an...

13/11/2025

REMI Realities: Finding Success in Switching, Replay, Graphics, Commentary, and More in At-Home Production

REMI Realities: Finding Success in Switching, Replay, Graphics, Commentary, and ...

13/11/2025

SVG Sit-Down: E1's Laurence Boyd Shares the Tech Challenges of the 2025 Race Season

SVG Sit-Down: E1's Laurence Boyd Shares the Tech Challenges of the 2025 Race...

13/11/2025

Versant's USA Sports Inks Five-Year Rights Deal With New Pac-12 Conference

Versant's USA Sports Inks Five-Year Rights Deal With New Pac-12 ConferencePac-12 Enterprises will produce all USA Network games in partnership with USA Spor...

13/11/2025

NBCU To Launch New NBC Sports Network on Nov. 17

NBCU To Launch New NBC Sports Network on Nov. 17By SVG Staff Thursday, November 13, 2025 - 10:40 am Print This Story | Subscribe Story Highlights NBCUniv...

13/11/2025

2025 Sports Broadcasting Hall of Fame: Glenn Adamo, Artist of Storytelling

2025 Sports Broadcasting Hall of Fame: Glenn Adamo, Artist of StorytellingBy Ken Kerschbaumer, Editorial Director Thursday, November 13, 2025 - 11:29 am Pri...

13/11/2025

In Come See Me in the Good Light Andrea Gibson Turns Dying Into Something Beautiful

(L-R) Jessica Hargrave, Tig Notaro, Stef Willen, Ryan White, Megan Falley, and A...

13/11/2025

Dinner and a Movie: Remaining Native and Chicken Adobo for the Soul

By Roni Jo Draper My father was born and raised in the Yurok village of Weitpus, in what is now considered Northern California. There at the fork of the Klamat...

13/11/2025

The Spotify Partner Program Expands to the Nordics, Empowering More Creators to Earn and Grow

At Spotify, we're always working to help creators earn, grow, and connect wi...

13/11/2025

Spotify Updates Shuffle to Keep Your Playlists Feeling Fresh

This year, Spotify has introduced even more ways for users to take control of their listening experience. Whether you're refreshing your Discover Weekly wit...

13/11/2025

Introducing Audiobook Recaps, a New Way to Reengage With Your Favorite Stories

Today, Spotify is beginning to roll out a powerful new feature designed to help listeners jump back into stories they've put down, whether it's after a ...

13/11/2025

L3Harris Successfully Tests Second RS-25 Engine for Artemis V

NASA and L3Harris conducted a full-duration RS-25 hot fire test Nov. 12 on the Fred Haise Test Stand at Stennis Space Center near Bay St. Louis, Mississippi, ma...

13/11/2025

Record-Breaking Live Broadcast Achieved with Clear-Com at the ADAC RAVENOL 24h Race at...

eds3_5_jq(document).ready(function($) { $(#eds_sliderM519).chameleonSlider_2_1({...