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

22/11/2025

Deadline Extended for 2025 Best in Market Awards

The deadline for entries for the 2025 Best in Market Awards has been extended to 23:59 PST on November 28, 2025....

22/11/2025

Clear-Com Unveils 4-Channel HelixNet Beltpack - Expanding...

Clear-Com announced the upcoming launch of its 4-Channel HelixNet beltpack, a next-generation advancement of its widely used 2-channel model. The new beltpack...

22/11/2025

Marshall Electronics Features its CV625 and CV612 PTZ Cam...

Marshall Electronics is showcasing the latest additions to its CV600 Series of PTZ cameras, the CV625 and CV612, which both feature AI track and follow capabili...

22/11/2025

QuickLink StudioPro Powers LiveConnect Live Production at...

At this year's European Respiratory Society (ERS) Congress, held at the RAI Amsterdam, LiveConnect delivered an ambitious and technically complex live produ...

22/11/2025

Professional Wireless Systems PWS Delivers Flawless RF Co...

Professional Wireless Systems (PWS), a leader in wireless frequency coordination and RF system design, provided a comprehensive wireless gear package and onsite...

22/11/2025

Telestream Introduces ARGUS v23 Featuring Live Look for R...

Telestream, a global leader in media workflow technologies, today announced the release of ARGUS v2.3, which introduces Live Look, a powerful new feature that e...

22/11/2025

Peer Software Expands Data Orchestration and Analytics Pl...

Peer Software today announced significant advancements across its enterprise data orchestration and analytics platform with new releases of Peer Global File Ser...

22/11/2025

Atomos Expands Ninja TX Series Capabilities with Powerful...

At InterBEE 2025, Atomos announces a major firmware update that brings integrated camera control to the Ninja TX GO and Ninja TX its new CFexpress-based monit...

22/11/2025

AWS Announces Elemental MediaConnect Router

Today, AWS announces the general availability of AWS Elemental MediaConnect Router, a new capability that enables broadcasters and content providers to dynamica...

22/11/2025

Rise Announces 2025 Award Winners

Rise, the award-winning advocacy group for gender diversity in the broadcast media technology sector, is delighted to announce the winners for this year's R...

22/11/2025

Lightware introduces new HC60 product line to strengthen...

Lightware, industry leader in signal management, is strengthening its Taurus UCX product family with the introduction of the new HC60 lineup. The new product li...

22/11/2025

IDX Unveils CUE-J Series Batteries

CARSON, Calif. IDX has introduced the IDX CUE-J Series battery/charger kits, including the CUE-J98, CUE-J150 and CUE-J198....

22/11/2025

NBA: More Than 60 Million Watched Games in First Month, Best in 15 Years

The NBA has released encouraging viewing and social media data that the beginnings of its $76 billion deal with NBC/Peacock, Prime Video and ESPN are paying off...

22/11/2025

FCC Sets Deadlines for Comments on New NextGen TV Proposals

WASHINGTON The Federal Communications Commission has set deadlines for comments on its newest proposals for NextGen TV, aka ATSC 3.0, with comments due on Jan. ...

22/11/2025

Seeking Advice for a New Opera, Laura Kaminsky Consulted the Experts: Her Students

Seeking Advice for a New Opera, Laura Kaminsky Consulted the Experts: Her Studen...

21/11/2025

Platinum White Paper: Appear Shares Why Media Exchange Is the Missing Link in Software-Defined Live Production

Platinum White Paper: Appear Shares Why Media Exchange Is the Missing Link in So...

21/11/2025

NWSL Championship 2025: CBS Sports To Deploy Two-Point FlyCam for Match Coverage at PayPal Park

NWSL Championship 2025: CBS Sports To Deploy Two-Point FlyCam for Match Coverage...

21/11/2025

NWSL Caps 2025 Season With Awards Show, Skills Challenge Productions

NWSL Caps 2025 Season With Awards Show, Skills Challenge ProductionsA team of 70 is on the ground in California to produce both eventsBy Mark J Burns, SVG Contr...

21/11/2025

USL and NEP Ready for Largest USL Championship Final Production Ever

USL and NEP Ready for Largest USL Championship Final Production EverThe broadcast from Tulsa, OK, will air CBS and TUDN on Saturday at 12 p.m. ETBy Jason Dachma...

21/11/2025

With Two New Teams, PWHL Boosts Production Workforce and Central Review for Season 3

With Two New Teams, PWHL Boosts Production Workforce and Central Review for Seas...

21/11/2025

Dinner and a Movie: Jared Lank on Powwow Highway and Luskinikn

Jared Lank and his mother in the '90s...

21/11/2025

Explore the Lands of Oz on Spotify With This Exclusive Wicked' Experience

Fans have been counting down the days until the final theatrical chapter of Wicked is revealed. To celebrate the highly anticipated release of Wicked: For Good ...

21/11/2025

Spotify House Seoul Delivered Unforgettable Performances From Central Cee, The Kid LAROI, Jay Park, ZICO, GroovyRoom, and More

Last week, Spotify turned up the volume in Seoul with the return of Spotify Hous...

21/11/2025

Training success at SGL Carbon in Meitingen

Wiesbaden, November 21, 2025. The SGL Carbon site in Meitingen has reason to celebrate as one of its trainees received a special award. Elias Stemmer was honore...

21/11/2025

L3Harris Recognizes Employee Achievements with LHX Excellence Awards

MELBOURNE, Fla., Nov. 21, 2025 - L3Harris Technologies (NYSE: LHX) has announced this year's LHX Excellence Awards, the company's most prestigious recog...

21/11/2025

FCC Proposes Upper C-Band Rules for 2027 Auction

WASHINGTON The Federal Communications Commission by a 3-0 vote opened a notice of proposed rulemaking (NPRM) to advance Congress's mandate to clear a minimu...

21/11/2025

FCC Votes to Clear at Least 100MHz of Upper C-Band Spectrum

WASHINGTON The Federal Communications Commission by a 3-0 vote adopted a Notice of Proposed Rulemaking (NPRM) to advance Congress's mandate to clear a minim...

21/11/2025

Spectrum Expands 4K Content to Apple TV 4K and Roku Devices

STAMFORD, Conn. Charter's Spectrum has expanded the devices that can offer 4K content on the Spectrum TV app to compatible Apple TV 4K and Roku devices....

21/11/2025

Study: Salaries in Content, Connectivity Industries Continue To Grow

NAPERVILLE, Ill. Media industry employers are continuing their multiyear trend of increasing salaries for all worker segments but lag general industry raises, s...

21/11/2025

NAB Opens Nominations for 2026 Technology Awards

WASHINGTON The National Association of Broadcasters said it is accepting nominations for the 2026 NAB Technology Awards, honors that recognize excellence in bro...

21/11/2025

AAT Introduces Automated RF Line Analysis

American Amplifier Technologies has released a vector network analysis module....

21/11/2025

The Best Movie Musicals on Every Streaming Platform

The Best Movie Musicals on Every Streaming Platform From Wicked to The Sound of Music, heres where to stream all the classic movie musicals and recent hits on...

21/11/2025

Space42 and Hisdesat Lay Groundwork for UAE-Spain Partnership to Advance Satellite Innovation and Secure Communications

The agreement creates a platform for joint collaboration, technology integration...

21/11/2025

GoodGym named Grand Prix winner of the 2025 Sky Zero Footprint Fund

Sky Media's £2m award-winning sustainability initiative crowns its first charity as this year's standout changemakerFriday 21 November 2025 GoodGym nam...

21/11/2025

Standards Pavilion concludes COP30 with call to embed International Standards in every step of climate action

As COP30 draws to a close, the International Electrotechnical Commission (IEC), ...

20/11/2025

MLB Media-Rights Shakeup: NBC's New Three-Year Deal Covers Sunday Night Baseball,' Peacock-Exclusive Games, and More

MLB Media-Rights Shakeup: NBC's New Three-Year Deal Covers Sunday Night Bas...

20/11/2025

MLB Media-Rights Shakeup: New Deal Will Bring 30 National Games to ESPN's Linear Platform, MLB.TV Exclusively to ESPN App

MLB Media-Rights Shakeup: New Deal Will Bring 30 National Games to ESPN's Li...

20/11/2025

MLB Media-Rights Shakeup: Netflix Lands Opening Night, Home Run Derby, Field of Dreams

MLB Media-Rights Shakeup: Netflix Lands Opening Night, Home Run Derby, Field of ...

20/11/2025

MLB Media-Rights Shakeup Overview: ESPN, NBCU, Netflix Ink Three-Year Deals

MLB Media-Rights Shakeup Overview: ESPN, NBCU, Netflix Ink Three-Year DealsESPN gets new 30-game package, MLB.TV; NBC extends Sunday nights; Netflix adds tentpo...

20/11/2025

SVG Students To Watch: Henry Thuss, Indiana University

SVG Students To Watch: Henry Thuss, Indiana UniversityThe Southern California product has his goals set on the front benchBy Brandon Costa, Director of Digital ...

20/11/2025

Done+Dusted's Guy Carrington on Creating the Spectacular League of Legends World Championship Opening Ceremony

Done+Dusted's Guy Carrington on Creating the Spectacular League of Legends W...

20/11/2025

FIA Extreme H World Cup Host Broadcaster Aurora Goes Inside the Production of the Hydrogen-Fuelled Motorsport

FIA Extreme H World Cup Host Broadcaster Aurora Goes Inside the Production of th...

20/11/2025

Platinum White Paper: Amagi Utilizes Cloud Production for Sports Events - Multi-Camera Live Workflow with Remote Commentary and Graphics

Platinum White Paper: Amagi Utilizes Cloud Production for Sports Events - Multi-...

20/11/2025

2025 Sports Broadcasting Hall of Fame: Marc Herklotz, Steady Hand Behind the Scenes

2025 Sports Broadcasting Hall of Fame: Marc Herklotz, Steady Hand Behind the Sce...

20/11/2025

NFL Deep Dive: How 32 Cameras at Each Stadium Drive Virtual Measurement, Boundary Replays, and Skeletal Tracking

NFL Deep Dive: How 32 Cameras at Each Stadium Drive Virtual Measurement, Boundar...

20/11/2025

Zodiac Killer Project Refuses to Kill Its Darlings With an Avant-Garde Essay Film

Charlie Shackleton attends the 2025 Sundance Film Festival premiere of Zodiac K...

20/11/2025

5 Ways to Get More out of Your Playlists on Spotify

Your playlists are personal. They're the soundtracks to your road trips, your quiet mornings, and your biggest celebrations; collections of memories and dis...

20/11/2025

Spotify, Trk mziinin efsanelerine sayg duruu niteliindeki ICON Trkiye'yi duyurdu

Spotify, uzun s redir zerine al t T rk m zik k lt r n n ikon haline gelmi ...

20/11/2025

Spotify and The Hollywood Reporter' Partner on the First-Ever Podcaster Roundtable

For the first time, Spotify has teamed up with The Hollywood Reporter to cohost ...