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

04/08/2026

Dalet Announces Commercial Availability of Dalia, Bringing Media-Aware Agentic AI to Enterprise Productions

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

04/07/2026

Detective Conan: Fallen Angel of the Highway Opens in Dolby Cinemas Across Japan, Presented in Dolby Atmos and Dolby ...

April 7 2026, 19:00 (PDT) Detective Conan: Fallen Angel of the Highway Opens in...

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

06/05/2026

Wisycom RF Solutions Support Gravity Medias Live Cycling and Marathon Broadcasts

Gravity Media Chief RF Communications Engineer Glenn Willems uses Wisycom RF over Fiber and wireless solutions across major cycling events and international mar...

06/05/2026

Sennheiser Spectera Module Now Available in Bitfocus Companion and Buttons

A Sennheiser Spectera module is now available in Bitfocus Companion and Buttons, enabling direct integration of Spectera with the two software platforms. The mo...

06/05/2026

Ted Turner, Cable Television Pioneer, Sports Broadcasting Hall of Famer, Dead at 87

Ted Turner, the visionary media entrepreneur whose appetite for disruption helpe...

06/05/2026

FIFA World Cup 2026: Peacock Launches Visin de Campo (aka Pitchside Live), Will Stream All 104 Matches in Spanish

Peacock is going all-in on the beautiful game - streaming all 104 FIFA World Cup...

06/05/2026

NoiseWorks Audio launch VoiceAssist Basic, Standard & Advanced

New pricing tiers for vocal/dialogue restoration tool NoiseWorks Audio's AI-powered vocal and dialogue processing plug-in is now available in three diff...

06/05/2026

RME TotalMix FX 2 now available

Popular mixing & routing software overhauled Following a recent public beta test, RME have launched the final release version of the powerful mixing and rou...

06/05/2026

Focusrite: Designing The ISA C8X Audio Interface

New SOS Video Feature Focusrites ISA C8X is a milestone product that brings together the companys analogue heritage and their expertise in digital audio. Yo...

06/05/2026

L3Harris to Boost Polish Navy Combat Power with Advanced Ship System

Polands Miecznik-class frigates are part of the largest contract in Polish shipbuilding history. (Image Credit: PGZ Stocznia Wojenna)...

06/05/2026

FCC's Anna Gomez Urges Rigorous Review of Paramount-WBD Merger

Share Copy link Facebook X Linkedin Bluesky Email...

06/05/2026

Riedel Ups Marc Engroff to CFO, Shifts Frank Eischet to Group COO

Share Copy link Facebook X Linkedin Bluesky Email...

06/05/2026

Amagi Launches In-Content Ads' to Attract More CTV Advertisers

Share Copy link Facebook X Linkedin Bluesky Email...

06/05/2026

Riedel Expands Leadership Structure Appoints Marc Engroff...

Riedel Communications today announced the expansion of its leadership structure as part of a strategic initiative to strengthen both its operational management ...

06/05/2026

Production Sound Mixer Dirk Sciarrotta Delivers Camera Re...

For nearly three decades, Veteran Production Sound Mixer and Five-time Emmy Award Winner Dirk Sciarrotta has helped define the sonic identity of the long-runnin...

06/05/2026

ZEISS CinCraft LensCore: Cinema Lens Looks for Compositing

ZEISS CinCraft LensCore: Cinema Lens Looks for Compositing Brie Clayton May 6, 2026 0 Comments ZEISS announces the launch of CinCraft LensCore, a nove...

06/05/2026

Wisycom Solves Extreme RF Challenges Across Miles of Live Action for Gravity Media

Wisycom Solves Extreme RF Challenges Across Miles of Live Action for Gravity Med...

06/05/2026

NAB Launches Weekly Podcast on Local Broadcast Policy

Share Copy link Facebook X Linkedin Bluesky Email...

06/05/2026

Mavis Launches Mavis Studio iPad For Media Production

Share Copy link Facebook X Linkedin Bluesky Email...

06/05/2026

Narrative Entertainment partners with Encompass to provid...

Narrative Entertainment has partnered with Encompass to deliver high-quality subtitling of its Great! network content using the Altitude Intelligence AI assiste...

06/05/2026

SipRadius extends its seamless creation and connectivity...

SipRadius, widely recognized for making content processing and connectivity secure and seamless, is proud to launch a dramatic new approach to AI content creati...

06/05/2026

Big Blue Marble at ANGA COM - TV as a Service in the spot...

When the broadband and media industry gathers at ANGA COM in Cologne from May 19 to 21, Big Blue Marble will be at the forefront. The international broadcast an...

06/05/2026

Cinegy makes its MPTS debut with software-defined televis...

Cinegy GmbH, a leading developer of software-defined television technology, is proud to exhibit at MPTS for the first time. Visitors to the stand will discover ...

06/05/2026

Val Jeanty Receives 2026 Doris Duke Artist Award

Val Jeanty Receives 2026 Doris Duke Artist Award Jeanty, a composer, percussionist, and turntablist, is the fourth Berklee recipient of the prestigious award ...

06/05/2026

Zeiss Launches CinCraft LensCore

Share Copy link Facebook X Linkedin Bluesky Email...

06/05/2026

Gomez Urges Rigorous FCC Review of Paramount-WBD Merger

Share Copy link Facebook X Linkedin Bluesky Email...

06/05/2026

Wisycom Solves Extreme RF Challenges Across Miles of Live...

When live cycling races and international marathons stretch for miles across cities and countryside, there is no margin for RF failure in live broadcast. As Chi...

06/05/2026

ZEISS CinCraft LensCore - Cinema Lens Looks for Compositi...

Oberkochen/Germany, May 5, 2026 ZEISS announces the launch of CinCraft LensCore, a novel solution for creating physically based cinematic lens looks for visual...

06/05/2026

VEON's Kyivstar Authorized to Resell Starlink for Businesses & Enterprises in Ukraine

06 May 2026 VEON's Kyivstar Authorized to Resell Starlink for Businesses & ...

06/05/2026

UKTV Brings the Early Years of Neighbours to U in 420Episode Back Catalogue Deal

UKTV has secured the exclusive rights to the early back catalogue of iconic Australian drama series Neighbours, following a landmark content deal with Fremantle...

06/05/2026

Sky commissions feature documentary to mark 10th anniversary of Manchester Arena bomb

Wednesday 6 May 2026 Sky commissions feature documentary to mark 10th anniversa...

06/05/2026

Sky and Formula 1 agree long-term partnership across UK, Ireland and Italy

Wednesday 6 May 2026 Sky and Formula 1 agree long-term partnership across UK, Ireland and Italy Sky in the UK & Ireland to remain the home of Formula 1 until ...

06/05/2026

GUPPYFRIEND champions microplastic reduction in sport with The Real Bag For Life Sky TV campaign

Sky Zero Footprint Fund-backed TV campaign launches nationwide, supported by new...

06/05/2026

Riedel Expands Leadership Structure, Appoints Marc Engroff as CFO and Frank Eischet as Group COO

Wuppertal May 6, 2026 Riedel Expands Leadership Structure, Appoints Marc Engro...

06/05/2026

Harmonic Defines a New Era of Broadband Connectivity at ANGA COM 2026

SAN JOSE, Calif. - May 6, 2026 - Harmonic (NASDAQ: HLIT) today announced its latest broadband innovations for ANGA COM 2026, highlighting its vision for a new e...

06/05/2026

Statement from Rupert Murdoch, Chairman Emeritus, Fox Corporation on Ted Turner's Passing

Statement from Rupert Murdoch, Chairman Emeritus, Fox Corporation on Ted Turner&...

06/05/2026

Calling all animal lovers, The Shelter: Animal SOS returns for a sixth season

Friday 8 May on RT One and RT Player Meet the NSPCA team caring for and protecting animals in need in this six-part series Fly on the wall, six-part series...

06/05/2026

NVIDIA Spectrum-X - the Open, AI-Native Ethernet Fabric - Sets the Standard for Gigascale AI, Now With MRC

The race to build the world's most powerful AI factories demands networking ...

06/05/2026

May 05, 2026

How changes to proteins can alter drug interactions for new precision therapies Scripps Research team maps how chemical modifications to proteins affect drug bi...

05/05/2026

Lessons from fragile contexts on responding to disinformation

Experts from the world of academia, tech, business, politics and media convened for a Thomson Talks at the Cambridge Disinformation Summit in April. It's th...

05/05/2026

Samsung Galaxy S26 Ultra Phone Cameras Bring New Excitement to Street League Skateboarding

Three phones were hardwired for power and transmission to the truck; camera feat...

05/05/2026

Case Study: How Zaki Rose Rebuilt Its Production Infrastructure, and What It Means for Sports Content Creators

The creative studio behind campaigns for the NBA, Fanatics Sportsbook & Casino, ...

05/05/2026

Nielsen Co-Viewing Pilot Shows Average 4% Viewership Increase for February Live Events

Nielsen has announced results from a co-viewing pilot program covering February&...

05/05/2026

Nippon TV and FOR-A Win NAB Product of the Year and Future Best of Show Awards for viztrick AiDi

viztrick AiDi, an on-device AI solution developed by Nippon TV, delivered global...

05/05/2026

ARRI Introduces Omnibar LED Linear Fixture for Film, Live Entertainment, and Content Creation

ARRI has announced Omnibar, a battery-powered, IP65-rated multi-color LED linear...

05/05/2026

France Tlvisions Becomes First Broadcaster to Deploy Imagine Communications SNP-XS

Imagine Communications has announced that France T l visions is the first broadc...

05/05/2026

WNBA Announces Historic Canadian Media Rights Agreement with Bell Media

The Women's National Basketball Association (WNBA) and Bell Media today announced a multiyear agreement to broadcast and stream WNBA games in Canada beginni...