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

01/06/2026

Dolby Sets the New Standard for Premium Entertainment at CES 2026

January 6 2026, 05:30 (PST) Dolby Sets the New Standard for Premium Entertainment at CES 2026 Throughout the week, Dolby brings to life the latest innovatio...

02/05/2026

Dalet Flex LTS Delivers Smarter Search, Faster Editing, and an AI-Ready Foundation for Modern Media

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

01/05/2026

NBCUniversal's Peacock to Be First Streamer to Integrate Dolby's Full Suite of Premium Picture and Sound Innovations

January 5 2026, 18:30 (PST) NBCUniversal's Peacock to Be First Streamer to ...

01/04/2026

DOLBY AND DOUYIN EMPOWER THE NEXT GENERATON OF CREATORS WITH DOLBY VISION

January 4 2026, 18:00 (PST) DOLBY AND DOUYIN EMPOWER THE NEXT GENERATON OF CREATORS WITH DOLBY VISION Douyin Users Can Now Create And Share Videos With Stun...

03/03/2026

LIV Golf, Beyond Sports Elevate Online Gaming Ecosystem with Launch of LIV Golf Fantasy and LIV X

Beyond Sports, a Sony group company, and LIV Golf, the world's golf league, ...

03/03/2026

Ilitch Sports + Entertainment Announces Launch of Detroit SportsNet

Ilitch Sports + Entertainment announces the launch of Detroit SportsNet (DSN), a year-round broadcast home for two of Detroit's franchises. With flexible op...

03/03/2026

Advanced Systems Group Promotes Gretchen Taipale to Vice President, Managed Services

Advanced Systems Group, LLC (ASG), a technology and services provider for media ...

03/03/2026

PGA of America, NBC Sports, and USA Sports Extend Media Rights Agreement Through 2033

The PGA of America, NBC Sports and USA Sports extend their media rights agreemen...

03/03/2026

HONOR, ARRI Announce Technical Collaboration to Bring ARRI Image Science into Next-Gen Consumer Devices

AI device ecosystem company HONOR enters into a strategic technical collaboratio...

03/03/2026

Telos Alliance Partners with College Radio Foundation to Support College Broadcasters

Cleveland's Telos Alliance, pioneers in broadcast technology for 30 years, l...

03/03/2026

Sennheiser Relaunches MD 9235 Wireless Mic Head

The MD 9235 microphone head for wireless handhelds has been a firm favorite with many engineers and artists for its ability to cut through high on-stage levels ...

03/03/2026

Haivision to Showcase Private 5G and Live Video Contribution Innovations at MWC 2026

Haivision Systems Inc. (Haivision), a global provider of mission-critical, real-...

03/03/2026

BMG Expands Washington Broadcast Center with 3 New TV Studios and Podcast Studio for Media Clients

Broadcast Management Group (BMG) announces the expansion of its 62,000-square-fo...

03/03/2026

Closing the Loop: Maroon 5 and the End of the Analog Era

Maroon 5's musical tour in 2025 marked a leap forward in live audio as Monitor Engineer Dave Rupsch utilized Sennheiser's all-digital Spectera wireless ...

03/03/2026

SVG in Indy: Pacers Sports & Entertainment Finds Production Sweet Spot in ST 2110-Based Control Center

Designed specifically for pro basketball, the renovated space at Gainbridge Fiel...

03/03/2026

Lawo Appoints Jamie Dunn CEO

As part of the move, former CEO Phillipp Lawo joins the broadcast-tech provider's Supervisory Board Lawo has announced appointment of Jamie Dunn as chief e...

03/03/2026

NBC Turns Back the Clock to 1990s for NBA Coast 2 Coast' Tuesday

A team of legendary announcers and analysts and a classic graphics look will bring the past to life NBC Sports and Peacock will return to yesteryear for tonigh...

03/03/2026

Sundance Film Festival: CDMX 2026 Returns for Its Third Edition

From April 30 to May 3, Sundance Film Festival: CDMX 2026 will offer a selection of exciting independent cinema. Mexico City, March 3, 2026 - At a moment of he...

03/03/2026

How Multi-Format Readers' Are Redefining Reading in the UK's National Year of Reading

For many, finding time or headspace to pick up a book can feel out of reach, but...

03/03/2026

Rohde & Schwarz and Realtek demonstrate first test solution for Bluetooth LE High Data Throughput (HDT)

Rohde & Schwarz and Realtek demonstrate first test solution for Bluetooth LE Hi...

03/03/2026

Sediba Scriptwriting Training Programme - Matatiele (Eastern Cape)

The National Film and Video Foundation (NFVF) invites aspiring and emerging filmmakers from Matatiele and surrounding areas to apply for the Sediba Scriptwritin...

03/03/2026

Clear-Com Supplies Cloud-based Communications System for SaxaVord Spaceport

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

03/03/2026

Magellan AI Integrates Nielsen DMA Data to Bring Local Market Measurement to Podcast Attribution

Nielsen's DMA data gives Magellan AI users a standardized way to measure th...

03/03/2026

Lawo Promotes Jamie Dunn to CEO

Share Copy link Facebook X Linkedin Bluesky Email...

03/03/2026

Elements To Showcase Newly Unveiled GRID NAS Platform At 2026 NAB Show

Share Copy link Facebook X Linkedin Bluesky Email...

03/03/2026

Moments Lab To Feature Agentic AI For Video Workflows At 2026 NAB Show

Share Copy link Facebook X Linkedin Bluesky Email...

03/03/2026

Marshall Electronics Launches Compact CV356-10X Full HD C...

Marshall Electronics premieres the CV356-10X, its latest compact 10X camera that offers Full HD with simultaneous SDI and HDMI outputs, at NAB 2026 (Booth C8339...

03/03/2026

farmerswife and Cirkus to Showcase Smarter Media Workflow...

farmerswife, the industry-leading enterprise operations platform for broadcast and post-production, today announced it will exhibit at NAB Show 2026 in Las Vega...

03/03/2026

Manfrotto ONE Hybrid Tripod Wins iF Design Award 2026

Manfrotto has announced that the Manfrotto ONE Hybrid tripod has won the iF DESIGN AWARD 2026, one of the world's most respected design honours. Selected ...

03/03/2026

DHD to Introduce Latest Generation Broadcast Audio Mixers...

DHD is expanding the capabilities of its DX2, RX2, SX2 and TX2 broadcast audio mixers, RM1 portable production unit and XC3/XD3/XS2 processing cores with the in...

03/03/2026

Synamedia and MoMe launch first streaming CDN in Spain

Leading video software provider Synamedia and MoMe, a leading Spanish consultancy and systems integrator, today announced the launch of Spain's first stream...

03/03/2026

Long-Awaited ATSC 3.0 Rulemaking Overshadows NAB Show Expectations

Share Copy link Facebook X Linkedin Bluesky Email...

03/03/2026

Audio Tech at NAB Show: Are We in the Second Wave' of IP?

Share Copy link Facebook X Linkedin Bluesky Email...

03/03/2026

IP's Impact on Imaging Tech on Full Display at NAB Show

Share Copy link Facebook X Linkedin Bluesky Email...

03/03/2026

Live Production Over IP in 2026: Software-Defined Everything

Share Copy link Facebook X Linkedin Bluesky Email...

03/03/2026

NAB Show Leverages Revitalized LVCC To Reflect M&E Transformation

Share Copy link Facebook X Linkedin Bluesky Email...

03/03/2026

Home Post Production Strengthens Factual and Natural Hist...

Home Post Production has further expanded its factual, unscripted, and entertainment capabilities with the acquisition of Picture Shop Bristol, a leading post h...

03/03/2026

Full Year 2025 Results

Luxembourg, 2 March 2026 -- SES S.A. fully consolidates Intelsat from 17 July 2025 and announces financial results for the year ended 31 December 2025 FY25 Pe...

03/03/2026

Iyuno Taps Dante AV to Sync Audio and Video Content

Share Copy link Facebook X Linkedin Bluesky Email...

03/03/2026

HBO Max and Paramount+ Streamers to Merge

Share Copy link Facebook X Linkedin Bluesky Email...

03/03/2026

Survey: 70% of CTV Advertisers Plan to Boost Spending in 2026

Share Copy link Facebook X Linkedin Bluesky Email...

03/03/2026

XGN Global, X1 Mobile Show New 5G Broadcast Smartphone

Share Copy link Facebook X Linkedin Bluesky Email...

03/03/2026

Scripps Completes Sale of WFTX to Sun Broadcasting

Share Copy link Facebook X Linkedin Bluesky Email...

03/03/2026

HbbTV Association Formally Integrates DRM into Core Specification

Share Copy link Facebook X Linkedin Bluesky Email...

03/03/2026

VEON and MeetKai Expand Collaboration to Explore Sovereign AI Infrastructure Partnerships

03 Mar 2026 VEON and MeetKai Expand Collaboration to Explore Sovereign AI Infra...

03/03/2026

Ryan Reynolds and Rob Mac land first ever live commentary gig exclusively on Sky Sports for Wrexham vs Swansea

Tuesday 3 March 2026 Ryan Reynolds and Rob Mac land first ever live commentary ...

03/03/2026

The Dyers Caravan Park reopens for a second season after a hit launch on Sky

Tuesday 3 March 2026 The Dyers' Caravan Park reopens for a second season after a hit launch on Sky The Dyers' Caravan Park JPEG (510KB) Sky books a ...

03/03/2026

Kai Ko and Wang Po-chieh Unleash Divine Glory in Electrifying Agent from Above' Teaser

Back to All News Kai Ko and Wang Po-chieh Unleash Divine Glory in Electrifying ...