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

25/09/2026

Digital Anarchy Releases Newest Version of its Real-Time Skin Retouching Tool for Video

Digital Anarchy Releases Newest Version of its Real-Time Skin Retouching Tool fo...

25/09/2026

Blackmagic Design Used on More Than 50 Summer Films in 2026

Blackmagic Design Used on More Than 50 Summer Films in 2026 Brie Clayton September 25, 2026 0 Comments Hero image: Disclosure Day Blackmagic Design p...

25/09/2026

How I Automated Social Media Resizing in After Effects - Free Script

How I Automated Social Media Resizing in After Effects - Free Script Graham Quince September 25, 2026 0 Comments If your text keeps getting cut off on...

25/09/2026

IBC2026 celebrates collaborative breakthroughs as it anno...

IBC has unveiled the winners of the prestigious IBC2026 Innovation Awards at an event held at the RAI Amsterdam on Sunday 13 September, honouring collaborative ...

25/09/2026

IBC2026 brings global media industry together to turn inn...

IBC2026 brought the global media, entertainment and technology community together for four days of business, innovation and collaboration at the RAI Amsterdam. ...

25/09/2026

Lightware Helps Integrators Overcome MacBook Neo USB Topo...

Lightware testing has revealed that each USB-C port on Apple's new MacBook Neo consumes three of the seven USB tiers available under the USB specification, ...

25/09/2026

Lightware Expands Education Support With New Products and...

Lightware is supporting educational institutions in building modern learning environments by combining professional training with education-focused AV technolog...

25/09/2026

Study: Only 10% of Young Adults Watched Local TV News Last Week

Share Copy link Facebook X Linkedin Bluesky Email...

25/09/2026

Optimum, A+E Global Media Sign New Distribution Agreement

Share Copy link Facebook X Linkedin Bluesky Email...

25/09/2026

MPA, Unions Back 'Motion Picture, Television, and Entertainment Revitalization Act

Share Copy link Facebook X Linkedin Bluesky Email...

25/09/2026

NAB Show New York Announces More Speakers and Programming Highlights

Share Copy link Facebook X Linkedin Bluesky Email...

25/09/2026

Comcast NBCU, NBCUniversal Local Award $2.5 Million to Nonprofits

Share Copy link Facebook X Linkedin Bluesky Email...

25/09/2026

Orange Belgium Strengthens Its Consumer and B2B TV Servic...

Long-Standing Customer Renews Multiyear Contract for VO's Secure Video Player, Content Security, and Device Monitoring Solutions Viaccess-Orca (VO), a glob...

25/09/2026

Automate Video Progress Bars in After Effects - No Keyframes!

Automate Video Progress Bars in After Effects - No Keyframes! Graham Quince September 24, 2026 0 Comments Learn how to create an automated video playb...

25/09/2026

Last chance to apply to be part of this year's Late Late Toy Show

Want to be part of this year's Late Late Toy Show? Final call for applications in search for this year's stars The most wonderful night of the year is...

24/09/2026

Broadcast Management Group Assists Virginia Public Media With Move to New HQ in Richmond

Broadcast Management Group (BMG) is supporting Virginia Public Media (VPM), the ...

24/09/2026

Two Red Digital Cinema Cameras Receive GhostFrame Pro Certification

RED Digital Cinema's RED V-RAPTOR [X] and RED V-RAPTOR XL [X] cameras with the Phantom Track feature are the first cameras to receive GhostFrame Pro Certifi...

24/09/2026

FOX Sports Adds 4K Live Stream on Tubi to List of Available Options for Cowboys-Eagles on Thanksgiving Day

Bringing together the full family of networks, FOX Sports is also adding Tubi, F...

24/09/2026

Virginia Techs Lane Stadium Invests in Gameday Experience with New Daktronics LED Display, Audio Solutions

Virginia Polytechnic Institute and State University (Virginia Tech) has unveiled...

24/09/2026

SVG AI Innovation Lab Blog Tracks How AI Is Reshaping Live Sports Production

The blog collects SVG's reporting on AI across U.S. and European sports broadcasting Since SVG launched the AI Innovation Lab in April to advance the devel...

24/09/2026

SVG TranSPORT Keynote Conversation: How FOX Built a Transcontinental Transmission Backbone for the FIFA World Cup

SVG's annual TranSPORT conference, which will be held on Tuesday, Oct. 20 in...

24/09/2026

FloSports is Using AI To Build a New Generation of Live Production Tools to Bolster the Streamer's Internal Operations

The self-built Master Control Room has cut streaming operations incident-respo...

24/09/2026

Ortana Links AudioShake, ScorePlay for Live and Archive Audio Cleanup

Ortana Media Group, the software systems integrator behind the Cubix workflow platform, has connected AudioShake's audio separation models to ScorePlay thro...

24/09/2026

AudioShake Debuts Multi-Speaker 2.0 for Separating Overlapping Voices

AudioShake has released Multi-Speaker 2.0, the company's newest Multi-Speaker model, which removes 75% more noise and offers 32% better separation of overla...

24/09/2026

Op-Ed: Planning Media Day When the Calendar Isn't Certain - How MLB Clubs Can Prepare for 2027 Now

By Jon Morgan, Founder and Executive Producer, Ryval Studios For Major League B...

24/09/2026

Spectrum SportsNet Reveals Los Angeles Lakers Broadcast, Programming Schedule for the 2026-27 Season

Spectrum SportsNet has revealed its comprehensive programming and live game broa...

24/09/2026

Charlotte Hornets Ink Broadcast Deals With Gray Media, Sinclair to Bring Games to More Fans Across the Carolinas

The Charlotte Hornets has unveiled new broadcast partnerships with Gray Media an...

24/09/2026

Detroit Pistons Name DAZN as Exclusive DTC Streaming Platform

DAZN will be the exclusive direct-to-consumer streaming partner for the Detroit Pistons beginning with the 2026-27 season. Subscriptions are available at DAZN.c...

24/09/2026

Minnesota Wild Games Become Available to Spectrum Customers

The National Hockey League (NHL) has made an agreement with Spectrum that will allow Spectrum TV customers in the Minnesota Wild local broadcast territory to wa...

24/09/2026

Carolina Hurricanes, Spectrum Sign Multi-Year Agreement for Hurricanes Hockey Network Distribution

The Carolina Hurricanes has reached a multi-year distribution agreement to provi...

24/09/2026

Regional Games of the St. Louis Blues To Be Exclusively Broadcasted on Blue Note+

The St. Louis Blues has introduced Blue Note as the name of the new, exclusive ...

24/09/2026

Columbus Blue Jackets Games Head to Spectrum TV

Blue Jackets Hockey Network, the television home for Blue Jackets hockey, is coming to Spectrum TV under a new carriage agreement between the National Hockey Le...

24/09/2026

Waves introduce Tracks Live 2.0

The next generation of multitrack recording for live sound The latest version of Waves' dedicated live multitrack recording software delivers an array ...

24/09/2026

Polyend introduce the Loop

An idea machine for musicians Described as an idea machine for musicians , the latest addition to Polyend's growing collection of guitar pedals combin...

24/09/2026

Synchro Arts unveil VocAlign 7

Alignment tool gains multitrack layout Synchro Arts have just launched the latest version of their renowned time-alignment plug-in, and it's said to be ...

24/09/2026

Expressive E update the Osmose

Synth gains DAW Control & Ctrl-e integration Expressive E have just released a major firmware update that brings some interesting new features to the Osmose...

24/09/2026

Rohde & Schwarz expands its system amplifier portfolio with the R&SSAM200 for applications up to 53 GHz

Rohde & Schwarz expands its system amplifier portfolio with the R&S SAM200 for a...

24/09/2026

Hitachi Launches Startup Challenge, Calling on Innovators Worldwide to Shape the Future of Mobility and Manufacturing Solutions

September 24, 2026 The Hitachi Startup Challenge FY26 invites innovative startu...

24/09/2026

NHK Technologies, Inc. Chooses Calrec for Sports Production

Download Now! To receive a short case study showcasing NHK Technologies, Inc. (NT) s audio setup, please enter the following details: -- First Name* Fir...

24/09/2026

Manifold Technologies Appoints Ryhaan Williams as CCO for North America

Manifold Technologies Appoints Ryhaan Williams as CCO for North America Brie Clayton September 24, 2026 0 Comments Brings three decades of broadcast e...

24/09/2026

UNIFACHA Expands Educational Program with DaVinci Resolve Studio

UNIFACHA Expands Educational Program with DaVinci Resolve Studio Brie Clayton September 24, 2026 0 Comments Brazilian university empowers next generat...

24/09/2026

NABA To Convene Cyber University 2.0 To Address Cybersecurity Strategies

Share Copy link Facebook X Linkedin Bluesky Email...

24/09/2026

Big Blue Marble Makes the Origin of Austrian Parliament V...

Viewers watching videos from the Austrian Parliament online will soon find it easier to verify the authenticity of the content. Big Blue Marble, an internationa...

24/09/2026

nsign and Sony collaborate to simplify digital signage de...

nsign, the digital signage SaaS platform built around its Simplify Complexity principle, is now officially certified for BRAVIA Professional Displays from Son...

24/09/2026

Viaplay Selects Encompass Altitude Scheduling to Transfor...

Encompass Digital Media today announced the successful migration of multiple Viaplay free-to-air channels, including TV3, TV6, TV8 and TV10, to its Altitude Sch...

24/09/2026

Standalone Streaming Services Continue to Decline in the U.S.

Share Copy link Facebook X Linkedin Bluesky Email...

24/09/2026

Hollyland Unveils LARK M3 Wireless Audio System

Share Copy link Facebook X Linkedin Bluesky Email...