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

09/10/2026

Dolby Expands Dolby OptiView Platform with New Capabilities at IBC 2026

September 10 2026, 06:00 (PDT) Dolby Expands Dolby OptiView Platform with New Capabilities at IBC 2026 New Sports Intelligence helps providers better unders...

07/10/2026

Dalet Flex LTS Delivers Smarter Media Operations from Ingest to Distribution

Dalet, a leading technology and service provider for media-rich organizations, today announced the latest Long-Term Supported (LTS) release of Dalet Flex. Build...

16/09/2026

Nielsen Marketing Cloud Launches Data-Enrichment Capabilities

Share Copy link Facebook X Linkedin Bluesky Email...

16/09/2026

IBC2026 Draws 41,225 Attendees From 170 Countries

Share Copy link Facebook X Linkedin Bluesky Email...

16/09/2026

Prime Video Introduces On-Demand News Clips

Share Copy link Facebook X Linkedin Bluesky Email...

16/09/2026

Screen Australia funds games projects in every state and territory as Screen Currency 2026 points to sector growth

Screen Australia funds games projects in every state and territory as Screen Cur...

15/09/2026

IBC 2026: Pixitmedia by DataCore to Showcase Cloud and Connected Production Workflows

At IBC2026, Pixitmedia by DataCore will showcase its latest capabilities designe...

15/09/2026

IBC 2026: Quantum Introduces Autonomous Data Management, Dramatically Reducing Storage Costs While Increasing Efficiency and Availability

Quantum Corp. today announced the release of Quantum Autonomous Data Management ...

15/09/2026

PGA Tour Taps Mike Mahar as Chief Technology Officer to Drive Digital, Data, AI Strategy

Former Wyndham Hotels & Resorts technology executive will focus on fan engagemen...

15/09/2026

Creator Sports Network and FAN.live Launch 3D NFL Watch Party for Creators

Creator Sports Network (CSN) and FAN.live have announced a partnership giving CSN's network of more than 2,000 vetted creators access to live 3D NFL broadca...

15/09/2026

IBC 2026 In Review: Our Complete Collection of Video Interviews with Industry Thought Leaders

SVG and SVG Europewere all over the IBC 2026 show floor out in Amsterdam, bringi...

15/09/2026

Rise Announces 2026 Awards Shortlist

Rise WIB has announced the shortlist for the Rise Awards 2026, returning to Troxy in London on Tuesday, November 17. The awards recognize outstanding women, adv...

15/09/2026

Major League Table Tennis Announces 2026-27 Media Distribution Lineup

Major League Table Tennis (MLTT) has announced its media distribution lineup for the 2026-27 season, beginning September 11. Every match will stream live on the...

15/09/2026

Willow Sports to Air 700 Hours of Free Asian Games Coverage for U.S. and Canadian Viewers

Willow Sports has announced it will serve as the exclusive U.S. and Canadian hom...

15/09/2026

Gravity Media to Broadcast MXGP of Australia Championship Finale

Gravity Media has announced it will provide outside broadcast production and technical services for the MXGP of Australia, the finale of the 2026 FIM World Moto...

15/09/2026

Scott Coker and Peter Y. Levin Launch Ki MMA Global MMA Promotion

Co-founders Scott Coker and Peter Y. Levin have unveiled Ki MMA, a new global mixed martial arts promotion launching in the first quarter of 2027. The announcem...

15/09/2026

Sony Announces FE 400mm F4.5 GM OSS and FE 600mm F6.3 GM OSS Super-Telephoto Lenses

Sony Electronics has announced two new G Master super-telephoto prime lenses for...

15/09/2026

Former NEP Group Exec Saeed Izadi Opens The Matrix, Next-Gen Remote Production Center in Singapore

GlobeCast provides facility for AI-power automated production core...

15/09/2026

Gravity Media Set to Deliver 2026 FIM World Motorcross Championship

Gravity Media, a leading global provider of production and content, and media services and facilities, is empowering Tourism and Events Northern Territory (NT) ...

15/09/2026

Audient unveil flagship Horizon interfaces

New Thunderbolt audio interfaces aimed at pro studios Audient's latest announcement sees the company introduce three new high-end audio interfaces desig...

15/09/2026

Sennheiser launch the Spectera SKM handheld

Completes core wireless system line-up The latest addition to Sennheiser's Spectera range is now shipping, completing the core elements of the company&#...

15/09/2026

Schwabe Digital reveal HiFAL 2

High-frequency dynamics plug-in upgraded Schwabe Digital have just released a major free update for their acclaimed high-frequency dynamics processing plug-...

15/09/2026

LUNA 3.0 & UAD Spark Studio from Universal Audio

DAW update launched alongside all-in-one subscription bundle The latest version of Universal Audio's DAW software has just arrived, and has been release...

15/09/2026

Rupert Neve Designs introduce three plug-ins

Three popular hardware units go virtual Rupert Neve Designs are entering the software market in style, with not one, but three of their sought-after hardwar...

15/09/2026

Argo M Powers Cloudbass' Next Generation OB Fleet

When longstanding OB specialist Cloudbass made the decision to expand its fleet to accommodate remote production facilities for a leading UK sports broadcaster&...

15/09/2026

Study: 3 in 4 U.S. TV Viewers Use Smartphones While Watching TV

Share Copy link Facebook X Linkedin Bluesky Email...

15/09/2026

Agent TiVo Will Help Track Down Your Show

Share Copy link Facebook X Linkedin Bluesky Email...

15/09/2026

Nielsen Marketing Cloud Launches Data Enrichment Capabilities

Share Copy link Facebook X Linkedin Bluesky Email...

15/09/2026

Six Berklee Alumni Win at 2026 Emmy Awards

Six Berklee Alumni Win at 2026 Emmy Awards The recipients were recognized for their contributions to Widow's Bay, Beef, South Park, and Bad Bunny's Su...

15/09/2026

OWC Announces Acquisition of OpenDrives, Expanding Software-Defined Video and Rich Media Storage Management Capabilities

OWC Announces Acquisition of OpenDrives, Expanding Software-Defined Video and Ri...

15/09/2026

Podcast The Vertical Buzz Shot with Blackmagic Pocket Cinema Camera 6K Pro

Podcast The Vertical Buzz Shot with Blackmagic Pocket Cinema Camera 6K Pro Brie Clayton September 14, 2026 0 Comments Production team builds premium p...

15/09/2026

Grass Valley Launches AVORA at IBC2026

Grass Valley Launches AVORA at IBC2026 Brie Clayton September 14, 2026 0 Comments New standalone solution gives production teams everything they need ...

15/09/2026

Brandon Woody Joins Berklee Student Ensemble for Signature Series Concert

Brandon Woody Joins Berklee Student Ensemble for Signature Series Concert The acclaimed trumpeter, composer, and bandleader will lead a Berklee student ensemb...

15/09/2026

IBC2026 Announces IBC Innovation Award Winners

Share Copy link Facebook X Linkedin Bluesky Email...

15/09/2026

IEEE BTS to Host Broadcast Technology Forum at NAB Headquarters

Share Copy link Facebook X Linkedin Bluesky Email...

15/09/2026

Huw Mills Joins Technetix as SVP, Global Operations

Share Copy link Facebook X Linkedin Bluesky Email...

15/09/2026

TiVo Introduces Agent TiVo

Share Copy link Facebook X Linkedin Bluesky Email...

15/09/2026

Study: Younger Fans Are Watching More Sports Than Ever

Share Copy link Facebook X Linkedin Bluesky Email...

15/09/2026

NFL Melbourne Game Scores 18.5 Million U.S. Viewers on Netflix

Share Copy link Facebook X Linkedin Bluesky Email...

15/09/2026

Applications open for Future Leaders Delegation to BitSummit 2027

Applications open for Future Leaders Delegation to BitSummit 2027 15 September 2026 Applications are open for Screen Australia's annual Future Leaders Dele...

15/09/2026

From Megawatts to Tokens: How NVIDIA Maximizes AI Factory Production

On a sweltering August evening in Silicon Valley, as the sun dropped and air conditioning loads spiked, Silicon Valley Power sent a signal to an AI factory to a...

15/09/2026

Now We Can Know Everything and Do Anything,' Jensen Huang Says at Dreamforce

Know everything. Do anything. That was the message NVIDIA founder and CEO Jensen Huang brought to Salesforce Dreamforce Tuesday, joining CEO Marc Benioff onsta...

15/09/2026

University of Manchester Uses NVIDIA Earth-2 to Forecast Air Pollution Across the UK

Air pollution is a serious public health risk, contributing to an estimated 30,0...

15/09/2026

Red Seat Ventures' Supercast Launches Live Streaming, Bringing Real-Time Video and Community to Subscribers

Red Seat Ventures' Supercast Launches Live Streaming, Bringing Real-Time Vid...

15/09/2026

Arqiva recognised with Armed Forces Covenant Silver Award

Arqiva recognised with Armed Forces Covenant Silver AwardPresented to organisations that demonstrate outstanding support for the Armed Forces community -- Sh...

14/09/2026

ESPNs MNF Gets in Tune With Apple Music, Adds Ludacris to In the Air Tonight Open

Lil Baby's Dead Fresh kicks off ESPN's Week 1 Monday Night Football, ...

14/09/2026

ESPN's Monday Night Football Begins Its Super Bowl Run With Year 2 of Flagship, New Tech, and 4K HDR Distribution

With Super Bowl LXI waiting in Los Angeles, ESPN will use the regular season to ...

14/09/2026

Give Me the Backstory: Get to Know Padraic McKinley, the Director of The Weight

By Bailey Pennick One of the most exciting things about the Sundance Film Festival is having a front-row seat for the bright future of independent filmmaking. ...