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

17/11/2025

EA SPORTS Madden NFL Cast to Return Thanksgiving Night With Immersive, Data-Driven Broadcast on Peacock

EA SPORTS Madden NFL Cast to Return Thanksgiving Night With Immersive, Data-Driv...

17/11/2025

Behind the Broadcast Booth: Impact Ventures' Greer Christian on Building Her Career Around Passion

Behind the Broadcast Booth: Impact Ventures' Greer Christian on Building Her...

17/11/2025

SVG Sit-Down: Sportradar's Brian Josephs Talks Peacock's Powerful Performance View - and Just Telling Better Sports Stories

SVG Sit-Down: Sportradar's Brian Josephs Talks Peacock's Powerful Perfor...

17/11/2025

2025 Sports Broadcasting Hall of Fame: Greg Gumbel, Iconic Voice and Comforting Presence

2025 Sports Broadcasting Hall of Fame: Greg Gumbel, Iconic Voice and Comforting ...

17/11/2025

ESPN, Pixar, the NFL, and Beyond Sports Team Up for ESPN's Dec. 8 Monsters, Inc.' MNF' Altcast Effort

ESPN, Pixar, the NFL, and Beyond Sports Team Up for ESPN's Dec. 8 Monsters,...

17/11/2025

SVG Sit-Down: EA SPORTS' Evan Dexter on How the EA SPORTS Madden NFL Cast' Blends Gaming and Live NFL Production

SVG Sit-Down: EA SPORTS' Evan Dexter on How the EA SPORTS Madden NFL Cast&#...

17/11/2025

Cast your votes and sail into 2026 with the return of SBS's the Chillest 100

Cast your votes and sail into 2026 with the return of SBS's the Chillest 100 17 November, 2025 Media releases Voting is now open for Australia's ul...

17/11/2025

Building a unified, secure localisation operating model with Blue Lucy

When VSI Group, one of the world's leading localisation providers, set out to modernise its complex, multi-site operations built through years of acquisitio...

17/11/2025

Sinclair Acquires 8% Stake in E.W. Scripps

Dealmaking for broadcast stations continues to heat up with Sinclair reporting that it has built up a 8.2% stake in E.W. Scripps and that it has been talking to...

17/11/2025

ITU: 6 Billion Now Online Globally

The worlds online population grew by more than 240 million people in 2025, according to Facts and Figures 2025 released today by the International Telecommunica...

17/11/2025

ASB GlassFloor Launches an Elite Training Facility in Par...

ASB GlassFloor, the leading provider in LED sports flooring, today announced the opening of Athletes Lab 2.0, a premier athletic training facility designed to e...

17/11/2025

SmallHD Unlocks Camera Control for Canon

SmallHD today announced the release of its popular Camera Control for Canon cinema cameras. This new integration enables filmmakers to adjust critical camera se...

17/11/2025

Matthews Helps Samuel and Sons Bring Luxury Trim to Life...

Luxury is in the details, and no one captures that better than the creative team at Samuel & Sons. As the visionaries behind iconic photography and advertising ...

17/11/2025

Sky brings top comedy talent to screens with new stand-up specials

Monday 17 November 2025 Sky brings top comedy talent to screens with new stand-up specials Sky and streaming service NOW are bringing audiences a fresh dose o...

16/11/2025

Viper Shield Advances Production for Global F-16 Fleet

L3Harris to deliver advanced electronic warfare systems quickly for worldwide F-16 programs...

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