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

05/01/2027

Worlds first 802.15.4ab-UWB chip verified by Calterah and Rohde & Schwarz to be demoed at CES 2026

Worlds first 802.15.4ab-UWB chip verified by Calterah and Rohde & Schwarz to be ...

02/12/2026

Entravision Settles with FCC Over Kidvid Violations

Share {alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...

02/12/2026

Hearst Names Arleda Hackett President and GM of KSBW Monterey-Salinas

Share {alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...

02/12/2026

Courtney Gross Joins Television Academy Foundation as Senior Director, Development

Share {alert(Link copied)}).catch(err => {console.error(Failed to copy: , er...

02/12/2026

QuickLink Introduces 2 All-in-One Production Platforms

Share {alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...

02/12/2026

BMG Completes Live Replay Upgrade

Share {alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...

02/12/2026

Geronimo Creek Adopts Pliant's MicroCom XR Wireless Intercom

Share {alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...

02/12/2026

Miris and Evercast announce high-fidelity 3D asset stream...

Miris, a 3D streaming infrastructure provider, and Evercast, a leading provider of real-time media review tools, today announced the beta of an Evercast Present...

02/12/2026

QuickLink Launches StudioPro Ascent and StudioPro Apex Ex...

QuickLink, the leading provider of multi-camera video productions and remote contribution solutions, announces the launch of StudioPro Ascent and StudioPro Ap...

01/12/2026

William Kamau wins Young Journalist Award 2026

William Kamau, a journalist with the investigative media house Africa Uncensored in Nairobi, has been named Thomson Foundation Young Journalist of the Year 2026...

01/12/2026

Gravity Media Acquires MOOV to Expand Broadcast Graphics and Virtual Production Capabilities

Gravity Media has acquired MOOV, a UK broadcast graphics and virtual production ...

01/12/2026

PanMetro and Alliance Broadband Launch IPTV and Hybrid TV Platform with Ateme and CAASTV

Ateme and CAASTV have announced that PanMetro (Pan Metro Convergence) and Allian...

01/12/2026

CP Communications Supports Live With Kelly & Mark in Clearwater Beach

CP Communications provided broadcast engineering and production support for Live With Kelly & Mark in Clearwater Beach, FL, Nov. 16-17. A 10-person crew led by...

01/12/2026

Riedel DIVA+ Connects Linzer Klangwolke with Easy5G

Riedel Communications supported the Klangwolke festival in Linz with a DIVA+ infrastructure. On behalf of Linzer Veranstaltungsgesellschaft (LIVA), Riedel Manag...

01/12/2026

TF1 Partners with Ateme to Power TF1+ Across Screens

TF1, France's private broadcaster, has chosen Ateme as its technology partner for TF1 . Ateme supports the service on TF1's own apps, connected TVs, ope...

01/12/2026

AIMS Announces Winter 2027 IPMX Product Testing and Certification Event

The Alliance for IP Media Solutions (AIMS), together with the Video Services Forum (VSF) and the European Broadcasting Union (EBU), has announced the next IPMX ...

01/12/2026

Clark Wire & Cable Develops Custom Cable for Broadcast Infrastructure at New Highmark Stadium

Clark Wire & Cable supplied broadcast infrastructure cable, panels and SMPTE com...

01/12/2026

2026 Sports Broadcasting Hall of Fame: Bucky Gunts, Treasured Director, Mentor, and Olympics Storyteller

Over the past three decades, no sports entity has set a higher bar for storytell...

01/12/2026

SVG Sit-Down: MASV's Gene Villeneuve on How Gameday Speeds Transfer of Media From Away Venues to Home Base

Sports media has become one of the few reliable growth areas in an otherwise slu...

01/12/2026

ESPN Details Massive Santa Monica Beach Studio Operation for Super Bowl LXI

Studio 61 will feature four production sets, more than 30 cameras, aerial systems, AR, and nearly 100 hours of live programming during Super Bowl week...

01/12/2026

ESPN, NFL Films, Anamorph Build Super Bowl Generations,' an Interactive Super Bowl Archive Experience for ESPN Beach

On-site activation will use touchscreen inputs and Anamorph technology to assemb...

01/12/2026

ESPN Deportes Unveils Super Bowl LXI Commentary Team, with Rebeca Landa Set To Make History

ESPN Deportes has announced its commentary team for Super Bowl LXI: Rebeca Landa...

01/12/2026

ESPN Announces First-Ever In-Game Super Bowl Ad and Fan Casting Call, Unveils Were Going' Finale

With Super Bowl LXI 75 days away, ESPN and The Walt Disney Company have announce...

01/12/2026

The House of the Mouse: ESPN Adds 10 Hours of Live Programming From Disneyland

ESPN and ABC will punctuate ESPN's Year of the Super Bowl with 10 hours of live programming from Disneyland Resort in Anaheim, CA, on Monday, Feb. 15, mere ...

01/12/2026

ESPN Unveils 24-Hour Super Bowl LXI Pregame Operation Across Santa Monica, SoFi Stadium

Five-hour Super Bowl LXI Countdown, multiple studio locations, Disney+ simulcast...

01/12/2026

ESPN Honors Legacy of NFL Primetime With Upcoming Rumblin', Bumblin', Stumblin Documentary

As ESPN prepares for its historic first Super Bowl presentation, the network wil...

01/12/2026

ESPN Adds Streaming-Only Red Carpet Show to Super Bowl LXI Pregame Lineup

Disney+, Hulu, and ESPN App will carry Live From Super Bowl LXI Red Carpet from the NFL VIP Tailgate at SoFi Stadium...

01/12/2026

The State of AI in Sports Broadcast': 88 Projects in Live Production Fit Into Eight Categories

To help determine where the industry stands, SVG AI Innovation Lab analyzed and ...

01/12/2026

ESPN, Omaha Productions Revive The All-Madden Team' for Super Bowl LXI Week

Peyton Manning and Rich Eisen will host the hour-long ESPN Original, produced with NFL Films and The Montag Group...

01/12/2026

ESPN Lays Out Super Bowl Plans; ESPN Beach Studios, 200+Cameras Set to Dazzle

By Jason Dachman and Ken Kerschbaumer ESPN today took some additional wraps off of its Super Bowl LXI plans, including more details about ESPN Beach will prese...

01/12/2026

StageBox 2 arrives

Audio inputs, backing playback, PDF support & more In the April 2026 issue, we ran a review on StageBox, a handy macOS and Windows application designed to h...

01/12/2026

Universal Audio release Paradise Guitar Studio 2

Three new high-gain amps added Universal Audio's all-in-one amp and effects modelling software has just been treated to a major update that introduces t...

01/12/2026

Telepathic Instruments launch Orchid V

Innovative instrument gains virtual counterpart Telepathic Instruments have just released a new plug-in that recreates their innovative Orchid instrument, a...

01/12/2026

Waves introduce Rogue Modules

Vintage-inspired effects suite revealed Waves latest release brings together a set of creative effects plug-ins that promise to capture the sound and charac...

01/12/2026

Rohde & Schwarz and Zurich Instruments back the London Quantum Cluster to support quantum technology development

Rohde & Schwarz and Zurich Instruments back the London Quantum Cluster to suppor...

01/12/2026

Weekly Live Sports Viewership Summary

Nielsen has released its Top 25 Live Sports Events Telecasts ranker for the week of November 16 - November 22. The list highlights a dynamic week in sports broa...

01/12/2026

BBC Weather Modernizes Production Sites for New Met Office Data

Share {alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...

01/12/2026

Jeremy Broggi Becomes FCC General Counsel

Share {alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...

01/12/2026

NAB Show Introduces Marketplace Pass

Share {alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...

01/12/2026

On Giving Tuesday, Support Broadcasters in Need

Share {alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...

01/12/2026

NESN Taps Ron Wechsler as Chief Content Officer

Share {alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...

01/12/2026

Appear X20 Passes DTV+ POC Test With Brazil's TV Globo

Share {alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...

01/12/2026

Mediagenix Names Otto Larsen Chief Revenue Officer

Share {alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...

01/12/2026

Hornets Tech announces reseller partnership with Framecas...

Framecastics encoding, decoding and IP streaming solutions now available through Hornets Tech, with specialist engineering support...

01/12/2026

Mediagenix Appoints Otto Larsen as Chief Revenue Officer

Brussels, Belgium December 1, 2026 Mediagenix, a global leader in smart content solutions to profitably connect the right content to the right audience, tod...

01/12/2026

Hollywood Editor Develops Free VFX Screen Tracking App

Hollywood Editor Develops Free VFX Screen Tracking App Christopher W. Hill December 1, 2026 0 Comments I've been working in Hollywood as an editor...

01/12/2026

Clear Life Media Creates Youth Sports Streaming with Blackmagic Design

Clear Life Media Creates Youth Sports Streaming with Blackmagic Design Brie Clayton December 1, 2026 0 Comments Company creates profitable live multic...

01/12/2026

Unreal Engine & Blender Inside After Effects? Shot Link Plugin Review

Unreal Engine & Blender Inside After Effects? Shot Link Plugin Review Graham Quince December 1, 2026 0 Comments I found a plugin which lets you bring ...

01/12/2026

Coalition Asks Appeals Court to Block FCCs Repeal of TV Ownership Rule

Share {alert(Link copied)}).catch(err => {console.error(Failed to copy: , err)}) data-platform=copy_link data-action= class=font-ui-heading py-2 text-sm tex...

01/12/2026

Waiken ILW partners with Broadpeak to power dynamic ad in...

Partnership delivers personalized viewing experiences and premium advertising experiences across Latin America Broadpeak , a leader in streaming and monetizati...