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

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

04/02/2026

NFVF ANNECY 2026 SOUTH AFRICAN ANIMATION SHOWCASE CALL

The National Film and Video Foundation (NFVF) invites final-year animation students to participate in an exclusive creative showcase at the Annecy International...

04/02/2026

Viper Shield Flight Tests Accelerate Delivery with New Digital Electronic Warfare Capability

Viper Shield's robust phase of flight-testing production representative hard...

04/02/2026

Nielsen launches co-viewing pilot program to further enhance TV measurement

Pilot To Launch with Super Bowl LX on February 8 and Continue with High Profile Live Events, Entertainment and Sports Nielsen to Use State of the Art Wearable...

04/02/2026

Vinten Extends VEGA Platform with VEGA Lite PTZ Control S...

New control solution applies broadcast robotics workflows to PTZ cameras with third-party integration and upgrade paths Vinten, a global leader in robotic cam...

04/02/2026

Vinten Launches Vega Lite PTZ Control System

Share Copy link Facebook X Linkedin Bluesky Email...

04/02/2026

Chyron to Provide Graphics, Virtual Sets for Winter Olympics Coverage

Share Copy link Facebook X Linkedin Bluesky Email...

04/02/2026

NBC Sports Taps Appear for 2026 Winter Olympics Production

Share Copy link Facebook X Linkedin Bluesky Email...

04/02/2026

Katie Vitolins Announced as Vice President of Alumni Products and Services

Katie Vitolins Announced as Vice President of Alumni Products and Services An alumna and former trustee, Vitolins will lead the relaunch of Berklee's alum...

04/02/2026

Rohde & Schwarz powers next generation television in Brazil with DTV+ technology for Globo

Rohde & Schwarz powers next generation television in Brazil with DTV technology...

04/02/2026

Netflix Shares Teaser of the Third and Final Season of 'Knokke Off'

Back to All News Netflix Shares Teaser of the Third and Final Season of Knokke Off Entertainment 04 February 2026 GlobalNetherlands Link copied to clipboar...

04/02/2026

Netflix Premieres 'The TikTok Killer' on March 6

Back to All News Netflix Premieres The TikTok Killer on March 6 Entertainment 04 February 2026 GlobalSpain Link copied to clipboard Download the pictures ...

04/02/2026

Music Is Having a Golden Moment on Netflix as New and Nostalgic Songs Storm the Charts

Back to All News Music Is Having a Golden Moment on Netflix as New and Nostal...

04/02/2026

Fox Corporation Reports Second Quarter Fiscal 2026 Financial Results

Fox Corporation Reports Second Quarter Fiscal 2026 Financial Results NEW YORK, NY, February 4, 2026 - Fox Corporation (Nasdaq: FOXA, FOX; FOX or the Compan...

04/02/2026

Lucas P. Aragn Joins FOX Advertising as Senior Vice President, Creative

Lucas P. Arag n Joins FOX Advertising as Senior Vice President, Creative New York, NY - February 4, 2026 - Accomplished Creative Executive Lucas P. Arag n has...

04/02/2026

RT Statement on Home of the Year and The Great House Revival

Following the passing of our friend and colleague Hugh Wallace, and with the full support of his family, RT will proceed with the broadcast of the new series o...

04/02/2026

Nemotron Labs: How AI Agents Are Turning Documents Into Real-Time Business Intelligence

Editor's note: This post is part of the Nemotron Labs blog series, which exp...

03/02/2026

Tagboard's New Partner Development Kit Turns Complex Third-Party Integrations into Instant Graphics

Tagboard, a modern, interactive graphics system for news, sports, and entertainm...

03/02/2026

SNS Launches New S3-Compatible Cloud Storage Service

Studio Network Solutions (SNS) announces the launch of Trio, a new S3-compatible cloud storage service fully integrated with EVO for media backup, archival, and...

03/02/2026

NEP Group Running at Full-Scale This Month in Support of Major International Events

50 Production Trucks at center of 160 U.S.-based productions...

03/02/2026

Nielsen Launches Co-Viewing Pilot Program to Further Enhance TV Measurement

Nielsen, which specializes in audience measurement, data, and media intelligence, announces that it is piloting a new methodology enhancement to more accurately...

03/02/2026

NBC Sports Relies on Appear X Platform for Winter Games

Appear's X Platform will be used by NBC Sports to deliver video compression, satellite modulation and transport stream aggregation for its production of the...

03/02/2026

Behind The Mic: NBC Sports Unveils Presentation Cast for Super Bowl LX as Part of Legendary February

Behind The Mic provides a roundup of recent news regarding on-air talent, includ...

03/02/2026

NHL Network to Take Fans Rinkside as NHL Players Return to Winter Olympic Games

NHL Network announces its comprehensive programming schedule for the upcoming Winter Olympic Games, underscoring the highly anticipated return of NHL players to...

03/02/2026

Canon Lenses Power NBC Coverage of Milano Cortina Winter Games

NBC Sports has chosen Canon to deliver 115 Canon UHD broadcast lenses for its production of the 2026 Winter Olympics and Paralympics. Canon will also send suppo...

03/02/2026

NBC Sports Selects Audio-Technica for Vital Winter Games Role

Audio-Technica equipment will be used by NBC Sports to deliver much of its audio capture requirements across all sporting venues for its production of the 2026 ...

03/02/2026

Cisco VXLAN Makes Olympic Debut for NBC Sports

NBC Sports will use Cisco to deliver AI networking technology for its all-IP production of the 2026 Winter Olympics and Paralympics, including the deployment of...

03/02/2026

Chyron PRIME CG Drives NBC Sports Winter Games Graphics

NBC Sports will utilize Chyron PRIME CG to produce live broadcast graphics to display names, athlete information, scores, statistics, leaderboards, headshots an...

03/02/2026

NBC Sports Relies on Grass Valley for Winter Games Signal Conversion, Routing, Orchestration

NBC Sports will utilize Grass Valley to deliver advanced signal conversion, rout...

03/02/2026

Planar Supplies LED Wall Technology for NBC Sports Winter Games Coverage

NBC Sports will utilize Planar to deliver leading-edge fine pixel pitch LED video wall technology for its production of the 2026 Winter Olympics and Paralympics...

03/02/2026

FOX Sports Wraps Run Airing Westminster Kennel Club Dog Show

Taking place in two venues, the 2026 production celebrates the 150th Anniversary of the Super Bowl of Dogs' When the Westminster Kennel Club Dog Show conc...

03/02/2026

ESPN To Broadcast 2026 NFL Pro Bowl Games Live From San Francisco's Convention Center

For the indoor production, NEP Specialty Capture has mounted a 100-ft. overhead ...

03/02/2026

Inside League One Volleyball: Mobile TV Group Drives Broadcasts via Onsite Support, Remotely From Mountain Media Center

MTVG Edge, the production-services supplier's software-based production solu...

03/02/2026

Inside League One Volleyball: CMO Raquel Braun on Partnering With Omaha Productions, Mobile TV Group

In the league's second year, new partnerships enhance broadcast quality for ...

03/02/2026

NBC Sports Taps Ross Video's Rocket Surgery for Virtual and AR at 2026 Winter Games

Rocket Surgery will showcase the combined creative strength of Ross Video, with ...

03/02/2026

Sony Supplies 100+ Cameras, 500 Monitors, and More for NBC's Winter Olympics Coverage

NBC Sports will utilize Sony Electronics to deliver imaging, monitoring, and tec...

03/02/2026

NBC Sports Selects SMT to Handle Results, Timing, and Production Data Services for Milano-Cortina 2026

SMT will provide TVI (broadcast television interface) support services for figur...

03/02/2026

Spotify Celebrates the 2026 Best New Artist Nominees During a Star-Studded Party in LA

Spotify's annual Best New Artist celebration returned to Los Angeles last ni...

03/02/2026

The smash-hit series The Hospital: In the Deep End returns to shine a spotlight on the real-life heroes of our healthcare system

The smash-hit series The Hospital: In the Deep End returns to shine a spotlight ...

03/02/2026

Introducing: FoMa Antares

FoMa Antares: Redefining Camera Stabilization for Modern ProductionsIn high-end broadcast and cinematic environments, precision, reliability, and flexibility ar...

03/02/2026

Viper Shield Flight Tests Accelerates Delivery with New Digital Electronic Warfare Capability

Viper Shield's robust phase of flight-testing production representative hard...

03/02/2026

L3Harris: A Strategic Partner for National Vigilance and Regional Peace

Countries throughout the Indo-Pacific have made the ability to defend their people and sovereign borders a top priority, but no single nation can monitor every ...

03/02/2026

L3Harris Achieves Record-Breaking Fuzing Delivery Milestone

U.S. Marine loads a round in an 81 mm mortar system during an exercise. (Credit: U.S. Marines)...

03/02/2026

Cobalt Targets Need for Multiple Video Feeds with openGear 9905MPx Multi-Channel Processor

9905MPx Card features unprecedented level of density with four independent signa...

03/02/2026

Cobalt Wins Three 2021 NAB Show Product of the Year Awards

Champaign, IL - November 15, 2021 - Cobalt Digital, announced today that three of its products have received 2021 NAB Show Product of the Year Awards. Cobalt, ...

03/02/2026

LOG4J Does Not Affect Cobalt Digital Products

Cobalt is pleased to confirm that Log4j vulnerability does NOT affect ANY Cobalt products including the HPF-9000 frame. Given the recent concerns regarding wi...

03/02/2026

Cobalt Digital's Launch of +UDX-Dante-1616 Introduces First License-based 12G-SDI Bridge to Dante Audio

Software-based embedding and de-embedding solution will be highlighted at NAB 20...