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

03/12/2026

ESPN, Disney Unveil Super Bowl Plans

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

03/12/2026

White Paper Details the Critical Role Affordable Converters Play in the Success of ATSC 3.0

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

03/12/2026

Spanish University Master Class Offers Hands-On Use of LiveU EcoSystem

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

03/12/2026

Sony Unveils Three New 4K Pro BRAVIA Displays

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

03/12/2026

Emergent Launches AI-Assisted Production for Houses of Wo...

Sunday comes every week. For most church production teams, so does the scramble. They build graphics for the sanctuary walls, rebuild them for the stream, then ...

03/12/2026

Wisycom MPR60 IEM IFB Receiver Named 2027 NAMM TEC Award...

Wisycom is pleased to announce that its MPR60 Wideband True Diversity IEM/IFB Receiver has been named a finalist in the Wireless Technology category for the 202...

03/12/2026

Screen Australia identifies opportunities to strengthen local audiences and returns for Australian film

Screen Australia identifies opportunities to strengthen local audiences and retu...

03/12/2026

How can Aussie films win over cinema audiences?

How can Aussie films win over cinema audiences? 3 December 2026 Australians are passionate movie-goers*, but are they watching local film? Find this episode ...

03/12/2026

Australia/Korea Co-production unites to fright audiences

Australia/Korea Co-production unites to fright audiences 3 December 2026 Image credit: Mark Taylor The first official feature film under the Australia/Korea C...

02/12/2026

International Sports Broadcasting Inks Equity Deal with Zoom Communication

ZOOM Communications Private Limited (ZOOM) announces a significant strategic equity investment in International Sports Broadcasting Company (ISB), Spain. This i...

02/12/2026

YouTube LiveCon 2026 To Explore the Future of Live Streaming in New York City on Dec. 8-9

The summit connects broadcasters and technology providers directly with YouTube&...

02/12/2026

SVG Students To Watch: Corey Townsend, Texas Christian University

From directing TCU baseball broadcasts on ESPN+ to working major events at AT&T Stadium, this senior from Texas is embracing every opportunity to grow as a live...

02/12/2026

Beyond the Conference Network: Big 12 Builds Its Sports-Media Future With Production Partnerships

Collaborations with BYUtv, JWP Productions, and member institutions fuel enhance...

02/12/2026

The Crow Hill Company release GUM

Ambitious project inspired by General MIDI The Crow Hill Company's latest release marks the start of a bold project that aims to culminate in the ultima...

02/12/2026

Tarn Audio reveal Wavefile & Overview

Two new handy Mac mix-check Apps announced Tarn Audio is the latest venture of Tim Lloyd, a developer who spent 13 years creating pro-audio tools for the li...

02/12/2026

Q Up Arts MusicSketch 4.0 now available

Free songwriting & notation iOS App upgraded Q Up Arts have just launched the latest version of their free songwriting and notation App for the iPhone and i...

02/12/2026

Big stories. Big moments. A standout year for SBS.

Big stories. Big moments. A standout year for SBS. 2 December, 2026 Media releases SBS reached an average of 13.8 million Australians each month - up 8% Yo...

02/12/2026

Rohde & Schwarz and Altair Semiconductor advance 3GPP Rel 18 eRedCap readiness with verification of first test cases

Rohde & Schwarz and Altair Semiconductor advance 3GPP Rel 18 eRedCap readiness w...

02/12/2026

AgileTV to take control of TV complexity at IBC2026, helping operators focus on growth

The company will showcase how its end-to-end TV platform unifies experiences, op...

02/12/2026

AgileTV to showcase TV Solutions for Hotels & Hospitals at IBC2026, helping operators and telcos unlock new growth opportunities beyond traditional TV

The company will present its vision for the future of TV operations through four strategic pillars, with TV Solutions for Hotels & Hospitals taking center stage...

02/12/2026

Colorfront Extends Its Industry-Leading Color Science to RED Connect

December 2, 2026 Colorfront has partnered with RED DIGITAL CINEMA to integrate native Colorfront color management into RED Connect, extending its renowned col...

02/12/2026

Nielsen Scales Ad Intel AI Internationally, Unifying Competitive Media Intelligence Across 95+ Markets

New enhancement helps multi-market brands and agencies turn fragmented ad data i...

02/12/2026

ESPN, Disney Unveil Super Bowl LXI Plans

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

Pliant Technologies MicroCom XR Sets a New Standard for M...

Geronimo Creek Inc., a leading lighting and grip company specializing in fast moving, location based production, has adopted Pliant Technologies' MicroCom X...

02/12/2026

Miris and Evercast announce high-fidelity 3D asset streaming in Presenter

Miris and Evercast announce high-fidelity 3D asset streaming in Presenter Brie Clayton December 2, 2026 0 Comments Miris, a 3D streaming infrastructur...

02/12/2026

Lawrence Virtual Studio Relies on Blackmagic Design

Lawrence Virtual Studio Relies on Blackmagic Design Brie Clayton December 2, 2026 0 Comments Digital film cameras and DaVinci Resolve Studio bring fle...

02/12/2026

Riedel, ARRI Announce New Leadership for Americas

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

Circle Studios and ionoco announce global partnership com...

Circle Studios and ionoco today announced a global partnership to develop and deliver dynamic, interactive and gamified experiences for clients around the world...

02/12/2026

LiveU Technology Helps Students Bridge the Broadcast and...

Media postgraduates at Complutense University in Madrid will once again gain hands-on experience with professional live broadcast and Pro AV technology this Dec...

02/12/2026

Blue Lucy Partners with QMPLY to Bring Automated Complian...

Blue Lucy, the workflow orchestration and integration platform for broadcasters, rights owners and production companies, today announced a new integration conne...

02/12/2026

Inside the Palais Garnier with URSA Cine Immersive

Inside the Palais Garnier with URSA Cine Immersive Brie Clayton December 1, 2026 0 Comments INIT Lab produces an extended run Apple Immersive Video ex...

02/12/2026

Berklee Music and Health Institute to Lead National Coalition Advancing Musics Role in Well-Being

Berklee Music and Health Institute to Lead National Coalition Advancing Musics R...

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

02/12/2026

Jensen Huang Joins Agent Safety Panel at GTC Washington, DC

Safety and capability aren't a trade-off. NVIDIA founder and CEO Jensen Huang made that case Wednesday at GTC Washington, D.C., joining Advancing Safety ...

02/12/2026

What Matters Is Doing It': US Department of Energy's Daro Gil and NVIDIA's Ian Buck on Genesis Mission's First Year

In just one year, the U.S. Department of Energy (DOE)'s Genesis Mission has ...

02/12/2026

Turn Your Radio Up! Omnia XII Is Now Shipping

Turn Your Radio Up! Omnia XII Is Now Shipping Search Cleveland, Ohio (December 2, 2026) - Telos Alliance , trusted global leader in broadcast audio for mor...

02/12/2026

Dynamo celebrates Houdinis legacy in new series Dynamo Vs Houdini, bringing magic to Sky on 20 December

Wednesday 2 December 2026 Dynamo celebrates Houdini's legacy in new series ...

02/12/2026

UNIDO and IEC strengthen partnership to advance Quality Infrastructure and sustainable industry

-- As technological change accelerates, the world needs common, robust founda...

02/12/2026

It's about to get messy with new RT KIDS exploding cake show Cca Cca Boom Boom hosted by Tony Cantwell and Meg Reilly

Create, Decorate, Boom! It's about to get messy with new RT KIDS explodin...

02/12/2026

Food conservationist Max Jones is on a mission to rediscover our traditional food heritage in new RT programme

The Last of It airs on Thursday 10 December on RT One and RT Player Cork bas...

02/12/2026

Christmas Crackers on RT: Can't Wait

Settle in for Documentaries, Sport, Entertainment and more Festivities begin as Christmas kicks off on RT with The Late Late Toy Show, a packed weekend of liv...

02/12/2026

RT Supporting the Arts is supporting 30 cultural events nationwide this December

RT Supporting the Arts is proudly rounding off the year with a vibrant programme of events and exhibitions celebrating creativity across theatre, opera, film, ...