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

24/03/2026

FCC Approves TV Station License Transfers to Gray

Share Copy link Facebook X Linkedin Bluesky Email...

24/03/2026

Study: Globally HBO Max Is Most Widely Bundled Streaming Service

Share Copy link Facebook X Linkedin Bluesky Email...

24/03/2026

Charter Communications Names John Lee Head Of Intelligence Ventures

Share Copy link Facebook X Linkedin Bluesky Email...

24/03/2026

Intinor introduces enhanced SRT monitoring, HDR transport and NDI Advanced support at NAB Show 2026

Intinor introduces enhanced SRT monitoring, HDR transport and NDI Advanced suppo...

24/03/2026

Miri V410 Live 4K Encoder/Decoder to Make North American Debut at 2026 NAB Show

Miri V410 Live 4K Encoder/Decoder to Make North American Debut at 2026 NAB Show Brie Clayton March 23, 2026 0 Comments Powerful new solution for strea...

23/03/2026

Professional Fighters League & U-Next Renew Multi-year Partnership to Broadcast PFL Events Live in Japan

The Professional Fighters League (PFL) has renewed its multi-year partnership wi...

23/03/2026

The Snow League Announces Google Cloud as Official Cloud and AI Partner to Power Personalized Fan Experiences Worldwide

The Snow League has named Google Cloud as its Official Cloud and AI Partner. The...

23/03/2026

Chyron Appoints Eric Wolff as Director of Venues Sales, North America

Chyron has appointed Eric Wolff as Director of Venues Sales, North America. Wolff previously served as Director of Broadcast Operations & Media Production for T...

23/03/2026

Chicago Sports Network, WCIU To Simulcast 10 White Sox Games

Chicago Sports Network (CHSN) and Weigel Broadcasting's WCIU (The U, ch. 26.1) will simulcast 10 Chicago White Sox games during the 2026 season, the compani...

23/03/2026

Cosm Appoints Jon Werbeck as VP, Head of Sponsorships

Cosm has appointed Jon Werbeck as Vice President, Head of Sponsorships. He will report to Corey Breton, Head of Venues, and will focus on corporate sponsorship ...

23/03/2026

CP Communications Partners with Mark Roberts Motion Control to Bring Robotic Camera Systems to Florida

CP Communications has announced a partnership with Mark Roberts Motion Control (...

23/03/2026

NAB 2026: Creators, Media Leaders, Storytelling Legends and AI Step Into the Spotlight as Lineup is Unveiled

NAB Show 2026, taking place April 18-22 (exhibits April 19-22) at the Las Vegas ...

23/03/2026

Bay FC Announces Multi-Year Partnership with Victory+ as the Official Streaming Partner

Bay FC and free streaming platform Victory have announced a partnership through...

23/03/2026

MLB, Google Cloud Debut AI-Powered, Real-Time Game Analysis With Scout Insights' in MLB Gameday

Gemini AI models will surface hidden context around pitches, matchups, rare stat...

23/03/2026

Behind the Mic: NBC Sports Announces MLB Opening Day On Air Lineup, Featuring Orel Hershiser, Al Leiter and More.

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

23/03/2026

SVG All-Stars: Alex McKeen, Senior Manager, Strategic Production Planning, TNT Sports

Growing from broadcast engineer to strategic planner, this Ithaca College grad h...

23/03/2026

Announcing the 2026 Sundance Institute | Sandbox Fund Grantees

16 Science-Focused Nonfiction Projects Selected for Funding LOS ANGELES, CA, March 23, 2026 - The nonprofit Sundance Institute and Sandbox Films announced toda...

23/03/2026

Celebrate 20 Years of Hannah Montana With Megan Moroney's New The Best of Both Worlds' Cover and More

It's been 20 years since Miley Cyrus introduced the world to Hannah Montana,...

23/03/2026

BOOM Library release Seasons of Earth: European Autumn

Made entirely from real natural recordings Aimed at sound designers and editors working in film, TV and game audio, the latest release from BOOM Library com...

23/03/2026

Klang.io launch Transcription Studio

Transcribe sheets, tabs or MIDI from audio files Klang.io have announced the launch of a new AI-powered software tool that's capable of detecting multip...

23/03/2026

RL10 and Orion Main Engine are Key to NASA's Historic Artemis II Journey to the Moon

An auxiliary target has been affixed to the Interim Cryogenic Propulsion Stage f...

23/03/2026

Scripps To Launch Scripps Sports Network Streaming Channel

Share Copy link Facebook X Linkedin Bluesky Email...

23/03/2026

IBEW Calls for Scrutiny of Skydance-CBS Layoffs and Proposed CNN Merger

Share Copy link Facebook X Linkedin Bluesky Email...

23/03/2026

Bruno Mars Risk It All Music Video Captures Timeless Text...

Pro8mm, the Super 8 experts, provided cameras, Super 8 movie film, and scanning services for Bruno Mars' Risk It All music video. The debut single from Br...

23/03/2026

Matthews Intros Lightweight Aluminum Grid Clamps

Matthews, introduces their first aluminum grid clamp collection, engineered for the rigging needs of film, television and live production. Combining light weigh...

23/03/2026

Hacks, the multi-Emmy -winning Sky Exclusive comedy, returns to the UK for its final season this April

Monday 23 March 2026 Hacks, the multi-Emmy -winning Sky Exclusive comedy, retur...

23/03/2026

'Too Hot to Handle: Italy' Reignites for a Second Season With the Special Participation of Selvaggia Lucarelli

Back to All News Too Hot to Handle: Italy Reignites for a Second Season With th...

23/03/2026

How Autonomous AI Agents Become Secure by Design With NVIDIA OpenShell

Autonomous agents mark a new inflection point in AI. Systems are no longer limited to generating responses or reasoning through tasks. They can take action: Age...

23/03/2026

RT Statement on the Death of Sports Broadcaster Michael Lyster

RT is sad today to learn of the death of legendary RT Sport broadcaster Michael Lyster, who died this morning aged 71 years. Kevin Bakhurst, Director-General...

23/03/2026

RT Documentary On One wins its first ever dedicated music award

RT Documentary On One has scooped its first ever dedicated music award. At the 2026 Icelandic Music Awards, composer lfur Eldj rn won Release of the Year in t...

23/03/2026

Czechia v Republic of Ireland live on RT2, RT Player and RT Radio 1

Inside Sport, Liveline, Morning Ireland and 2FM DRIVE will all be in Prague to bring fans to the heart of the action Every Moment, Every GenerationRT | FIFA W...

22/03/2026

VSL update Synchron Woodwinds & Strings

Free updates now available VSL have just released some free updates that add some existing features to a selection of libraries in their expansive Synchron ...

22/03/2026

Live-Action Sins of Kujo' Premieres April 2: Main Trailer and Key Art Debut

Back to All News Live-Action Sins of Kujo' Premieres April 2: Main Trailer and Key Art Debut Entertainment 22 March 2026 GlobalJapan Link copied to cl...

21/03/2026

MPG announce new Impact Award

Presented to War Child UK's HELP(2) project The MPG (Music Producers Guild) have announced the launch of the MPG Impact Award, a brand-new honour that w...

21/03/2026

Eduardo Tarilonte's Ancient ERA Persia from Best Service

Microtuning support for Arabic, Persian & Turkish scales The latest release from Best Service brings together a selection of string, wind and percussion ins...

21/03/2026

New campaign from NAATI and SBS CulturalConnect highlights how we all deserve to be understood'

New campaign from NAATI and SBS CulturalConnect highlights how we all deserve t...

21/03/2026

Statement regarding Rhoda Roberts AO

Statement regarding Rhoda Roberts AO 21 March, 2026 Media releases SBS is deeply saddened by the passing of Widjabul Wia-bal woman from the Bundjalung Na...

21/03/2026

Survey: Fans Prefer Sports on Broadcast Over Streaming

Share Copy link Facebook X Linkedin Bluesky Email...

21/03/2026

Graham Promotes Stephanie Slagle to VP, CRO & GM of WDIV Local 4

Share Copy link Facebook X Linkedin Bluesky Email...

21/03/2026

Study: Repurposed Traditional TV Ads for CTV Is a Missed Opportunity

Share Copy link Facebook X Linkedin Bluesky Email...

21/03/2026

Carr Backs Trump Army/Navy Game Executive Order

Share Copy link Facebook X Linkedin Bluesky Email...

21/03/2026

Opponents File Emergency FCC Petition to Block Nexstar/Tegna Merger

Share Copy link Facebook X Linkedin Bluesky Email...

21/03/2026

Eight States Ask for Court to Stop Nexstar/Tegna Merger

Share Copy link Facebook X Linkedin Bluesky Email...

21/03/2026

Cine Gear Connect NY Ramps Up for March 28 - 2026

Cine Gear Connect NY, presented by Universal Production Services, is filling in the slate for a full day of panels, peers, learning the latest, and mixing it up...

21/03/2026

Studio Technologies Debuts New StudioComm System at NAB 2026

Studio Technologies Debuts New StudioComm System at NAB 2026 Brie Clayton March 20, 2026 0 Comments StudioComm Model 794 Central Controller and Model ...