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

04/08/2026

Dalet Announces Commercial Availability of Dalia, Bringing Media-Aware Agentic AI to Enterprise Productions

Dalet, a leading technology and service provider for media-rich organizations, t...

04/07/2026

Detective Conan: Fallen Angel of the Highway Opens in Dolby Cinemas Across Japan, Presented in Dolby Atmos and Dolby ...

April 7 2026, 19:00 (PDT) Detective Conan: Fallen Angel of the Highway Opens in...

06/06/2026

Streaming Platform FIFA+ Launches on DAZN

Share Copy link Facebook X Linkedin Bluesky Email...

06/06/2026

Telycam Expands Broadcast PTZ Camera Lineup

Share Copy link Facebook X Linkedin Bluesky Email...

06/06/2026

Matrox Video Launches Paradigm Shift with Maevex MGX Seri...

Matrox Video today announced the launch of the Matrox Maevex MGX Series, a new lineup of IPMX-ready video encoders and decoders with USB support that is enginee...

06/06/2026

Atomos 4K Sumo PRO-19 Now Shipping

Atomos (booth# S1006) announced immediate availability of Sumo PRO-19, a new 19-inch 4K HDR monitor-recorder-switcher designed as a central production hub for m...

06/06/2026

DoPchoice Modular SNAPBAG System for Creamsource Vortex

Cine Gear Expo 2026 DoPchoice introduces a complete light-shaping system for the new Creamsource Vortex2, further expanding the fixture's wide versatility...

06/06/2026

SmallHD Announces the New OLED 16 Production Monitor

SmallHD will debut a new OLED 4K production monitor with a 16 display, the OLED 16, that combines OLED's industry-benchmark contrast ratio, exceptional col...

06/06/2026

Cine Gear Expo Announces 2026 Awards of Excellence Recipi...

Ed Lachman ASC, Caleb Deschanel ASC, and M. David Mullen ASC Being Honored at the 30th Annual Cine Gear Expo LA Cine Gear Expo has announced the recipients of ...

06/06/2026

ZEISS Introduces Horizon Anamorphic Full - Frame 2x Anamo...

World premiere at Cine Gear Expo Los Angeles, June 5-6...

06/06/2026

DoPchoice Debuts Airglow 8 by 2 Frame for RuPixel Canvas

See it first at Cine Gear Expo LA, Booth #S1703 DoPchoice introduces the latest addition to its inflatable AIRGLOW series the 8 2 Frame for RuPixel Canvas. ...

05/06/2026

LSUs Sarah Ramundt on Celebrating the One-Year Anniversary of The Brand

The university-wide initiative has pushed their creative content to a new level Although collegiate athletics at a single institution can contain numerous spo...

05/06/2026

SVG GameDay, Ep. 18: New York Islanders Brooklyn Boyars - A Career Filled With Championships

In-venue and creative video staffers at the professional and collegiate level ha...

05/06/2026

Synamedia Enters New Chapter Following Lumine Group Acquisition Agreement

Synamedia has announced that Lumine Group has agreed to acquire its Video Network business. The company is positioning the transition as the start of a new phas...

05/06/2026

Ateme, BCE, and Scaleway Announce Sovereign Cloud Media Supply Chain Partnership

Ateme, Broadcasting Center Europe (BCE), and Scaleway have announced a strategic partnership to deliver a cloud-based media supply chain covering ingest through...

05/06/2026

Audinate Adds Three Models to Dante AVIO Install Adapter Line

Audinate has announced three new additions to its Dante AVIO Install adapter series: a 4-Channel Analog Input, a 4-Channel Analog Output, and a 2-Ch In/2-Ch Out...

05/06/2026

Sportradar Extends Data and AV Betting Rights Agreement for Wimbledon Beyond 2026

Sportradar Group AG has announced a multi-year extension of its exclusive global...

05/06/2026

M6 Group to Broadcast FIFA World Cup 2026 in 4K UHD via Fransat Satellite Platform

The M6 Group will broadcast FIFA World Cup 2026 matches live and in Ultra High D...

05/06/2026

The Athletic Adds PGA TOUR Highlights to Golf Coverage

The Athletic has announced that PGA TOUR highlights will be integrated into its golf coverage beginning with the Memorial Tournament presented by Workday. PGA T...

05/06/2026

Op-Ed: Beyond the Stadium: Why Real-Time Visual Intelligence Will Define World Cup 2026 Security

When the FIFA World Cup arrives in North America in 2026, it will bring more tha...

05/06/2026

FIFA+ Launches Exclusively on DAZN

FIFA and DAZN have announced the launch of FIFA exclusively on DAZN, consolidating FIFA's content portfolio within DAZN's sports platform. The move fol...

05/06/2026

Telemundo Announces Group Stage Broadcast Schedule and Talent Assignments for FIFA World Cup 2026

Telemundo's exclusive Spanish-language coverage of the FIFA World Cup 2026 G...

05/06/2026

Peacock to Stream Telemundos FIFA World Cup 2026 Coverage in Dolby Vision and Dolby Atmos

Dolby Laboratories and NBCUniversal have announced that Peacock will stream Tele...

05/06/2026

Formula 1 Extends Las Vegas Grand Prix Through 2037

Formula 1 has announced a 10-year extension to keep the Las Vegas Grand Prix on the F1 calendar through 2037. Las Vegas Grand Prix, Inc., Clark County, and the ...

05/06/2026

Inside SailGP New York: How Riedel Provides Tech Backbone for Challenging Production Effort

The broadcast-engineering team overcomes wind, speed, and salt water - and dista...

05/06/2026

Virtual Eye Powers Broadcast Graphics Across Golf Productions in Busy Three-Event Week

Deploying both onsite and remote crews, the company is providing calibrated-came...

05/06/2026

ESPN Pivots From REMI to Full On-Site Production for UFL Playoff Game on Daytonas Blank Canvas

With Inter&Co Stadium unavailable, ESPN's UFL team rebuilt its broadcast pla...

05/06/2026

Free Registration for SVG Regional Sports Production Summit Ends Today!

One of the most exciting and informative events on the SVG annual event calendar is the Regional Sports Production Summit, an annual gathering of industry profe...

05/06/2026

FOX Returns to Saratoga Race Course for 158th Running of Belmont Stakes

For the race's third year at the historic racetrack, the broadcaster has added cameras and will incorporate multiple drones The 158th edition of the Belmon...

05/06/2026

Ratings Roundup: NBCs Spurs-Thunder Game 7 Best Since 2016, ESPNs Stanley Cup Final Opener Hits Seven-Year High

Ratings Roundup is a rundown of recent rating news and is derived from press rel...

05/06/2026

Sonuscore release LUX Orchestral Strings Essentials

Built from the same recordings as flagship library Sonuscore's LUX Orchestral Strings has been met with widespread praise since its launch in late 2025,...

05/06/2026

RME unveil the ADI-2 Pro EX

High-end converter, interface & headphone amp upgraded Said to represent the next evolution of RME's all-in-one reference converter concept, the all-new...

05/06/2026

Soundgas Sounds: Latest prize draw announced

Win a Soundgas Type 636P & Type G preamps Soundgas, one of the UK's leading vintage and boutique audio equipment specialists have just announced the lau...

05/06/2026

New leadership of Technology Systems Division at Rohde & Schwarz

New leadership of Technology Systems Division at Rohde & Schwarz On July 1, 2026, Hansj rg Herrbold and Andreas H gele will take over as Executive Vice Presid...

05/06/2026

Hitachi and Intel announce strategic collaboration to accelerate AI transformation across key industries

Hitachi and Intel announced a strategic collaboration to explore opportunities t...

05/06/2026

Nielsen, Mediaocean Announce New Integration to Power The Next Phase of Data-Driven Linear, Advanced Audience Measurement

MRI-Simmons and S&P Global Mobility are expanding advanced audience capabilities...

05/06/2026

Latest Nielsen data reveals insurance advertising climbs as Australians weigh cost, cover and loyalty

New Nielsen data shows insurance ad spend grew 11%, while consumers remain highl...

05/06/2026

Nielsen Adds New Audience Data Partnerships

Share Copy link Facebook X Linkedin Bluesky Email...

05/06/2026

ASG Promotes Joe Marchitto to Western Regional CTO

ASG Promotes Joe Marchitto to Western Regional CTO Brie Clayton June 5, 2026 0 Comments Appointment to Support Engineering Alignment and Client Experi...

05/06/2026

Stargate Studios Colombia Uses DaVinci Resolve Studio for Vertical Microdramas

Stargate Studios Colombia Uses DaVinci Resolve Studio for Vertical Microdramas Brie Clayton June 5, 2026 0 Comments End to end post in one platform al...

05/06/2026

People Need to Come First When We Use AI

People Need to Come First When We Use AI Andy Marken June 5, 2026 0 Comments It's just surviving. Life's very existence requires destruction....

05/06/2026

Fahad Haider Joins NESN as VP, Operations and Engineering

Share Copy link Facebook X Linkedin Bluesky Email...

05/06/2026

GatesAir Opens New Brazil Office to Back DTV+ Rollout

Share Copy link Facebook X Linkedin Bluesky Email...

05/06/2026

Supreme Court Upholds FCC's Authority to Levy Fines

Share Copy link Facebook X Linkedin Bluesky Email...

05/06/2026

Montclair State University Will Run NJ PBS

Share Copy link Facebook X Linkedin Bluesky Email...

05/06/2026

Merkhet's Sam Matheny Urges Congress to Expedite BPS Deployment

Share Copy link Facebook X Linkedin Bluesky Email...

05/06/2026

Sinclair Launches NextGen TV Campaign in Columbus, Ohio

Share Copy link Facebook X Linkedin Bluesky Email...

05/06/2026

NAB Releases New Keep the Game On' Spot

Share Copy link Facebook X Linkedin Bluesky Email...

05/06/2026

NCTC, ACAC Going to Disney World for Independent Show

Share Copy link Facebook X Linkedin Bluesky Email...