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

12/05/2026

Ad-Hoc News: aconnic AG announces improved fund raising plan to support business and refinance debt

aconnic AG (ISIN: DE000A0LBKW6), Munich, has developed a modified fund raising p...

12/05/2026

CNN Pushes Into Lifestyle Products with CNN Weather' App Launch

Share Copy link Facebook X Linkedin Bluesky Email...

12/05/2026

Marshall Electronics Cameras Elevate Elite Equestrian Com...

Tyrell Corporation, specialists in high-end live sports and entertainment broadcasts, was tasked with delivering compelling broadcast coverage of premier equest...

12/05/2026

IBC2026 registration opens as international media industr...

Registration is now open for IBC2026 as the global media, entertainment and technology community prepares to converge on the RAI Amsterdam from 11 14 September ...

12/05/2026

Ross Video Showcases Unified Production Workflows at Broa...

Ross Video, a global leader in live video production technology, will present its latest innovations and integrated production workflows at BroadcastAsia 2026, ...

12/05/2026

With over 50bn euros in assets under management and recor...

500 selected leaders from around the world across start-ups, corporates, and venture capital. Over 50bn in assets under management among attending investors, a...

12/05/2026

Randy Koeman Joins CVP as Part of Continued European Expa...

CVP, one of Europe's leading suppliers of professional video and broadcast solutions, has appointed Randy Koeman as Sales Manager, Netherlands, marking anot...

12/05/2026

Taiwan Television selects PlayBox Neo Suite multi-channel...

Taiwan Television has expanded its HD content ingest workflow capabilities by investing in the PlayBox Neo Suite - a leading multi-channel multi-server UHD/HD/S...

12/05/2026

Jigsaw24 Appoints Tom Laker and Ashish Chauhan to Support...

Jigsaw24 is strengthening its media team with the appointment of Tom Laker as Client Director and Ashish Chauhan as Project Manager. These strategic hires bring...

12/05/2026

Pebble brings future-ready playout innovation to Broadcas...

Broadcast playout leader showcases hybrid IP infrastructure and workflow automation with Videoland deployment as regional benchmark...

12/05/2026

dzjinius to Showcase All-in-one Production Management Pla...

dzjinius, the all-in-one production management platform for the media and entertainment industry, will showcase its centralised approach to production workflows...

12/05/2026

G&D and CT Square Launch New Joint Venture in India

Share Copy link Facebook X Linkedin Bluesky Email...

12/05/2026

Congress Urged to Protect Live Sports on Broadcast TV

Share Copy link Facebook X Linkedin Bluesky Email...

12/05/2026

Roku to Stream Inaugural Enhanced Games in North America

Share Copy link Facebook X Linkedin Bluesky Email...

12/05/2026

Austrian Broadcaster Selects Lawo, SLG Broadcast for Studio Upgrade

Share Copy link Facebook X Linkedin Bluesky Email...

12/05/2026

NUGEN Audio Debuts Enhanced DialogCheck at MPTS 2026

NUGEN Audio will debut Version 1.1 of DialogCheck, its intelligent dialog intelligibility and compliance tool, at the 2026 Media Production & Technology Show (S...

12/05/2026

Disguise Powers Interactive LED Castle for Laura Pausini

The reactive visuals can adapt to any stage or screen setup and comprise 50 layers of Notch content Today, Disguise announced that its high performance GX 3 m...

12/05/2026

DoPchoice Intros Light-Shaping Accessories for ARRI Omnib...

Snapgrid , Snapbag & Airglow Expand Creative Control for the ARRI Modular LED BarFollowing the launch of the ARRI Omnibar, DoPchoice introduces a dedicated li...

12/05/2026

Macarena Garca and Carlos Cuevas star in 'El Acercamiento de la Mujer Cactus y el Hombre Globo'

Back to All News Macarena Garc a and Carlos Cuevas star in El Acercamiento de l...

12/05/2026

Netflix Unveils Documentary on Norway's 26-Year Journey to This Year's World Cup

Back to All News Netflix Unveils Documentary on Norway's 26-Year Journey to...

12/05/2026

The Netflix Effect

Back to All News The Netflix Effect Ted Sarandos co-CEO Social Impact 12 May 2026 Global Link copied to clipboard Download all assets Ten years ago, Ne...

12/05/2026

News Test

This is my news content...

12/05/2026

NVIDIA and SAP Bring Trust to Specialized Agents

From finance and procurement to supply chain and manufacturing, specialized AI agents are moving into the enterprise systems where business decisions are made, ...

11/05/2026

Ross Production Services 48-Foot HyperMax-1 Truck Quickly in Demand

New production unit features not only wealth of Ross gear but also Sony cameras, Canon lenses, and a Calrec Argo S audio board...

11/05/2026

Solid State Logic Launches TCA Tour Portable Audio Production System

Solid State Logic (SSL) has announced TCA Tour, a portable fly-away audio production system built from System T components for broadcast, touring, and live prod...

11/05/2026

Riedel Communications Named Official Connectivity Integration Provider for Glasgow 2026 Commonwealth Games

Riedel Communications has announced it will serve as Official Connectivity Integ...

11/05/2026

G&D and NETGEAR AV Launch KVM-over-IP Plugin for Automated Network Configuration

Guntermann and Drunck (G&D) and NETGEAR AV have announced a plugin that automates network configuration for G&D KVM-over-IP deployments on NETGEAR AV Line infra...

11/05/2026

The Famous Group and Elite Edge Announce Unified Ownership

The Famous Group (TFG) and Elite Edge, a production studio specializing in live-action production, show opens, set design, and fabrication for sports and live e...

11/05/2026

SVG All-Stars: Odair Auger, Tech Project Manager, NBCUniversal Telemundo Enterprises

The native of S o Paulo, Brazil, will play a crucial role in the broadcaster'...

11/05/2026

Cobalt Digital to Showcase IPMX/ST 2110 Ecosystem at BroadcastAsia 2026

Cobalt Digital will exhibit its IPMX/ST 2110 product lineup at BroadcastAsia 2026 (Stand 5D2-4), anchored by the COBALT blueCORE family of standalone signal pro...

11/05/2026

Interra Systems to Demonstrate QC, Monitoring, and Captioning Solutions at BroadcastAsia 2026

Interra Systems will exhibit at BroadcastAsia 2026 (Stand 5C1-10), demonstrating...

11/05/2026

T-Mobile Deploys 5G and AI Tools Across 2026 PGA Championship

T-Mobile is serving as a technology partner for the 2026 PGA Championship at Aronimink Golf Club in Newtown Square, Pennsylvania, deploying 5G connectivity and ...

11/05/2026

Vizrt Named Official Technical Supplier of Eurovision Song Contest 2026

Vizrt has announced it has been named an Official Technical Supplier of the Eurovision Song Contest 2026, in partnership with host broadcaster ORF. The 70th edi...

11/05/2026

WNBA and AWS Announce Multi-Year Partnership

The WNBA and Amazon Web Services (AWS) have announced a multi-year partnership making AWS the Official Cloud and Cloud AI Partner of the WNBA. AWS is also joini...

11/05/2026

NAB 2026: kronehit Awards Lawo and SLG Broadcast Contract for Full Studio Modernization

Austrian private broadcaster kronehit publicly awarded SLG Broadcast AG and Lawo...

11/05/2026

Behind The Mic: PGA Championship Changing Weekday Announcer Lineup for 2026 Tournament

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

11/05/2026

Eurovision at 70: The Biggest Hits, Artists, and Trends From the Iconic Song Competition

As Eurovision fans gear up to celebrate the 70th anniversary of the iconic song ...

11/05/2026

Pelo Spotify, artistas brasileiros geraram aproximadamente R$ 2 bilhes em royalties em 2025

Pela primeira vez na hist ria, o Brasil figura entre os oito maiores mercados de...

11/05/2026

Bastl Instruments showcase the Kalimba

New desktop instrument focused on tactile performance Bastl Instruments have announced the Kalimba, a new desktop instrument that combines physical modellin...

11/05/2026

1010music release the blackbox 2

Compact sampling workstation gains new features 1010music have announced the blackbox 2, a new version of their compact standalone sampler designed for DAWl...

11/05/2026

KOMA Elektronik Monoplex Eurorack sequencer

Performance-focused sequencer with microtonal control Berlin-based KOMA Elektronik have announced Monoplex, a new 42HP Eurorack sequencer designed for hands...

11/05/2026

IK Multimedia launch the Tonex One+

Boasts wireless control from mobile devices The latest iteration of IK Multimedia's compact amp and effects modelling pedal expands on the capabilities ...

11/05/2026

Transfigured Orchestra Vol 3: Cinema Brass from Sonora Cinematic

Spans traditional orchestral and experimental sounds Sonora Cinematic have recently released the third instalment in their Transfigured Orchestra series, de...

11/05/2026

SUPERBOOTH 2026 Video Show Reports

Our exhibition coverage Watch all our SUPERBOOTH 2026 video coverage in one place. Check back to this page regularly as we will be updating with more video ...

11/05/2026

You're not meant to look at an Eclipse, but you won't be able to take your eyes off Delta's Eurovision staging

You're not meant to look at an Eclipse, but you won't be able to take yo...