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

11/03/2026

Calrec To Unlock Hybrid Workflows At 2026 NAB Show

Share Copy link Facebook X Linkedin Bluesky Email...

11/03/2026

Matrox Video Enables the Next Era of Software-Defined Med...

Matrox Video will showcase its vision for the future of live production at NAB 2026 in Las Vegas, April 19-22, highlighting how broadcasters and media organizat...

11/03/2026

GlobalM Showcases Distributed Video Gateway Architecture...

Geneva-based technology company, GlobalM SA, is presenting its GMX Distributed Video Gateway, a software-defined IP media transport platform designed to replace...

11/03/2026

Video is King - 2026 Iconik Media Stats Report Finds Vide...

Backlight (booth #N2829), the company behind Iconik and Wildmoka, which power video workflows for large media and entertainment organizations, has released the ...

11/03/2026

QuickLinks Latest StudioEdge Models to Make North America...

QuickLink, a leading provider of award-winning video production and remote guest contribution solutions, presents its latest StudioEdge models at The NAB Show ...

11/03/2026

Telestream Expands Its Cloud Services with the Introducti...

Telestream, a global leader in media workflow technologies, today announced the expansion of Telestream Cloud Services with the introduction of UP, a new cloud-...

11/03/2026

Operative Launches AOS Configuration for Digital-First Mo...

Operative, the preferred advertising management provider for the world's leading media brands, today announced the launch of AOS for digital media, an AI-po...

11/03/2026

Calrec Redefines Broadcast Workflows at NAB 2026

Calrec will be located in Central Hall, on Booth C6907 Choice without compromise The broadcast industry is going through a rapid evolution that s signalling a...

11/03/2026

Worldstream and Cubbit launch sovereign S3 cloud storage...

The new service is hosted and operated entirely in the Netherlands, combining data sovereignty, resilience, scalability, and predictable costs without relying...

11/03/2026

Ease Live powers interactive Premier Padel experiences on...

Ease Live, an Evertz company and leader in interactive graphical overlays, today announced the successful deployment of its platform on Red Bull TV for Premier ...

11/03/2026

Mediagenix Title Management Accelerates Content Monetizat...

Mediagenix, a global leader in smart content solutions to profitably connect the right content to the right audience, is advancing its Semantic Intelligence cap...

11/03/2026

Emergent Launches Fusion- The Interactive Anything Platfo...

Emergent, a leading provider of AI-enhanced media production solutions, today announced the official launch of Fusion, a powerful, no-code application builder d...

11/03/2026

Techex Names Matt McKee as Senior Director of Sales, Americas

Share Copy link Facebook X Linkedin Bluesky Email...

11/03/2026

IAB Tech Lab Announces Content Monetization Protocol for AI LLMs

Share Copy link Facebook X Linkedin Bluesky Email...

11/03/2026

Mondae Hott Joins Kokusai Denki as Northeast Sales Manager

Share Copy link Facebook X Linkedin Bluesky Email...

11/03/2026

Gray Media to Air Cincinnati Reds' Games on WXIX FOX19

Share Copy link Facebook X Linkedin Bluesky Email...

11/03/2026

Shure Audio Solutions Deliver Super Bowl Win

Share Copy link Facebook X Linkedin Bluesky Email...

11/03/2026

UK's First Live Broadcast Using New n40 Private 5G Spectrum

Share Copy link Facebook X Linkedin Bluesky Email...

11/03/2026

Utah Scientific Expands Technology Partner Program With I...

Utah Scientific today announced the expansion of its Technology Partner Program with the addition of Audinate, Bitfocus, and Skaarhoj, three industry leaders wh...

11/03/2026

DigitalGlue Ends the Post Production Tax creativespace In...

DigitalGlue, creator of the creative.space on-premise managed storage platform, today revealed plans to launch creative.space Intelligence (CSI) at NAB 2026 (Bo...

11/03/2026

Maxon and Tencent Cloud Partner to Integrate HY 3D into C...

Maxon, maker of powerful, approachable software solutions for creators working in 2D and 3D design, motion graphics, visual effects, gaming, and more, has annou...

11/03/2026

NUGEN Audio Halo Vision Plug In Serves as Spatial Compass...

Composer and Re-recording Mixer Michael Phillips Keeley has built his career around immersive storytelling. Working from his Dolby Atmos-equipped studio, Sound ...

11/03/2026

YES selects Synamedia Iris to power advanced advertising

Leading video software provider Synamedia today announced that YES, the pay-TV subsidiary of the telco Bezeq (TASE: BEZQ), has selected Synamedia Iris to delive...

11/03/2026

Cost Savings Scalability and Smarter Monetization Viacces...

As media companies face increasing cost pressures and operational complexity, at the 2026 NAB Show in Las Vegas, Viaccess-Orca (VO), a global leader in OTT / TV...

11/03/2026

Digital Alert Systems Unveils Version 6 Software for DASD...

Digital Alert Systems, a global leader in emergency communications solutions for media providers, today announced the release of Version 6 software for its DASD...

11/03/2026

SES Brings Satellite Connectivity to Refugees in Chad

First Medium-Earth Orbit (MEO) deployment of the emergency.lu platform for refugees and their host communities' use provides dependable broadband for humani...

11/03/2026

Foundry releases Nuke 17.0

Foundry releases Nuke 17.0 Brie Clayton March 1, 2026 0 Comments Native Gaussian Splat support, new 3D system based on USD, expanded machine learning ca...

11/03/2026

Preserving UNESCO World Heritage with URSA Cine Immersive

Preserving UNESCO World Heritage with URSA Cine Immersive Brie Clayton March 1, 2026 0 Comments The Explorers turned to France's cultural landmark...

11/03/2026

I Clicked This By Accident And It Made After Effects SO Much Faster

I Clicked This By Accident And It Made After Effects SO Much Faster Graham Quince March 1, 2026 0 Comments Discover how Region of Interest in Adobe A...

11/03/2026

Cine Gear Connect Brings a Focused All-Day Experience to Industry City, NY

Cine Gear Connect Brings a Focused All-Day Experience to Industry City, NY Brie Clayton March 4, 2026 0 Comments Registration is now open for Cine Gea...

11/03/2026

La Vorgine Edited and Finished with DaVinci Resolve Studio

La Vor gine Edited and Finished with DaVinci Resolve Studio Brie Clayton March 4, 2026 0 Comments One of Colombia's most ambitious projects goes g...

11/03/2026

SoundMarket Launches 18,000+ Tracks of Real Music by Award-Winning Composers for Editors and Post Professionals

SoundMarket Launches 18,000 Tracks of Real Music by Award-Winning Composers for...

11/03/2026

Capta Center Supports NOVO19 Remote Production with Blackmagic Design

Capta Center Supports NOVO19 Remote Production with Blackmagic Design Brie Clayton March 5, 2026 0 Comments The facility provides production and playo...

11/03/2026

DigitalGlue Ends the Post-Production Tax: creative.space Intelligence (CSI) Unifies On-Premise Storage with Forensic AI at NAB 2026

DigitalGlue Ends the Post-Production Tax: creative.space Intelligence (CSI) Unif...

11/03/2026

Kochi Sun Sun Uses Blackmagic Replay for High School Volleyball Finals

Kochi Sun Sun Uses Blackmagic Replay for High School Volleyball Finals Brie Clayton March 9, 2026 0 Comments Versatile Blackmagic Replay system proves...

11/03/2026

Richard Bona Joins Berklee for Signature Series Concert

Richard Bona Joins Berklee for Signature Series Concert The Grammy-winning Cameroonian bassist and vocalist collaborates with students and faculty in a progra...

11/03/2026

New NVIDIA Nemotron 3 Super Delivers 5x Higher Throughput for Agentic AI

Launched today, NVIDIA Nemotron 3 Super is a 120 billion parameter open model with 12 billion active parameters designed to run complex agentic AI systems at sc...

11/03/2026

March 10, 2026

Scripps Research scientists awarded nearly $5 million by NIH to investigate cancer growth Researchers will investigate how a common dietary nutrient may control...

11/03/2026

The 2026 RT Short Story Competition is now open for entries

TELL US YOUR (SHORT) STORIES The 2026 RT Short Story Competition is now open for entries Recognising and rewarding the best new Irish fiction writing for...

11/03/2026

Celtic Media Festival 2026 Nominees Announced

RT 's The Traitors Ireland is among the nominees for the 2026 Celtic Media Festival Torc Awards for Excellence, announced today....

10/03/2026

Harvey Arnold, Bert Goldman to Be Honored at the 2026 NAB Show

Share Copy link Facebook X Linkedin Bluesky Email...

10/03/2026

Senators Urge FCC to Preserve Citizens Broadband Radio Service

Share Copy link Facebook X Linkedin Bluesky Email...

10/03/2026

SCTE TechExpo26 Issues Call for Content, Technical Papers

Share Copy link Facebook X Linkedin Bluesky Email...

10/03/2026

Zefr Receives MRC Accreditation

Share Copy link Facebook X Linkedin Bluesky Email...

10/03/2026

Study: Overloaded Sports Fans Fed Up with Fragmented Viewing Options

Share Copy link Facebook X Linkedin Bluesky Email...