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

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

06/09/2026

Dolby and MagentaTV Bring Fans Closer to the FIFA World Cup 2026 in Germany with Dolby Vision and Dolby Atmos

June 9 2026, 23:00 (PDT) Dolby and MagentaTV Bring Fans Closer to the FIFA Worl...

12/08/2026

Op-Ed: The Versioning Playbook - How Rights Holders are Getting More From Live Events

Traditional live sports production has focused on creating the best possible pro...

12/08/2026

IBC 2026: FOR-A to Demonstrate Production and Processing Solutions

FOR-A will showcase a range of broadcast and production products at IBC2026 (Stand 2.B53, Amsterdam RAI, September 11-14), including software-based switching, A...

12/08/2026

IBC 2026: AMWA and EBU to Demo NMOS BCP-008 Multi-Vendor IP Status Reporting

The Advanced Media Workflow Association (AMWA) and EBU will host live demonstrations of NMOS BCP-008 Minimum Status Reporting at IBC2026 (September 11-14) on th...

12/08/2026

IBC 2026: Dalet Launches Solution Suites for Media Production and Archive Management

Dalet has announced Dalet Solution Suites, a portfolio of cloud-native solutions...

12/08/2026

Net Insight Enables Centralized Remote Production of Blinkfestivalen 2026 for NRK

Net Insight has announced that DMC Production Norway has selected its Open Live ...

12/08/2026

Zixi Appoints Alyson Stewart as Senior Director of Sales

Zixi has appointed Alyson Stewart as Senior Director of Sales. Stewart will be responsible for direct sales and partnerships, with a focus on broadcasters, medi...

12/08/2026

LiveU Powers Host Broadcast Operations at 2026 Glasgow Games

LiveU's LU900Q intelligent production unit was deployed as part of the host broadcast operation for the Games in Glasgow (July 23-August 2, 2026). Host broa...

12/08/2026

Disney+ and ESPN Acquire Multi-Year Formula E Rights Beginning 2026/27 Season

Disney , ESPN, and Formula E have announced a multi-year deal bringing all Formula E races to Disney and ESPN in the U.S. and to Disney in most international...

12/08/2026

PSSI Launches X-LIVE Managed Service for Live Event Transmission

PSSI has launched X-LIVE, a managed service offering dedicated engineering resources and Appear encoding infrastructure for live event signal processing and tra...

12/08/2026

MoonPay X Games League Draws 18.3 Million Viewers in Inaugural Summer Season

The inaugural MoonPay X Games League Summer Season reached 18.3 million unique live viewers across three stops on ABC and ESPN, a 78.5% increase compared to the...

12/08/2026

IBC 2026: BBright Adds RIST Support to IP-Gateway

BBright will showcase an expanded IP-Gateway at IBC2026, adding support for all RIST profiles to its existing support for MPEG Transport Stream over IP with SMP...

12/08/2026

IBC 2026: BBright Adds EBU OGraf Graphics Support to UHD and ST 2110 Playout Platform

BBright will demonstrate EBU OGraf animated graphics support in its software-bas...

12/08/2026

Interra Systems to Showcase QC and Monitoring Solutions at SET Expo 2026

Interra Systems will demonstrate its ORION, BATON, BATON Captions, and VEGA solutions at SET Expo 2026 (August 17-20, Distrito Anhembi, S o Paulo) at partner Li...

12/08/2026

DPA Microphones Appoints Raul Contreras as West Coast Regional Sales Manager

DPA Microphones has appointed Raul Contreras as West Coast Regional Sales Manager. In the role, Contreras will oversee sales and customer relationships througho...

12/08/2026

Save the Date: SVG LIVE! Returns to LA Nov. 10 to Spotlight Sports & Entertainment Production

Live spectacles ranging from the Super Bowl and FIFA World Cup to the Oscars and...

12/08/2026

Love, Separation, and the Cost of Comfort in How to Divorce During the War

Writer-Director Andrius Bla evi ius and crew attend the premiere of How to Divorce During the War at The Ray Theatre on January 26, 2026, in Park City, UT. (P...

12/08/2026

SSL 360 gets a major update

Enhanced DAW & plug-in control for the UC1, UF8 and UF1 The software that powers SSL's range of control surfaces has just received a major update that d...

12/08/2026

Triton Audio launch the Tilt EQ

In-line preamp features one-knob EQ In addition to their range of in-line preamps, Triton Audio recently managed to squeeze a compressor into an enclosure t...

12/08/2026

AudioRoute from Arvital Audio

Captures system audio with or without a DAW Depending on your setup, capturing system audio in a DAW can be a tedious process, so much so that Arvital Audio...

12/08/2026

2026 NATIONAL NAIDOC AWARDS TO BROADCAST ON NITV LIVE AND DIRECT FROM MPARNTWE

2026 NATIONAL NAIDOC AWARDS TO BROADCAST ON NITV LIVE AND DIRECT FROM MPARNTWE 12 August, 2026 Media releases First Nations excellence will be celebrated l...

12/08/2026

More than six million sports fans stay with SBS for Tour de France and Tour de France Femmes Avec Zwift

More than six million sports fans stay with SBS for Tour de France and Tour de F...

12/08/2026

Nielsen Introduces Groundbreaking Streaming Ad Measurement in Brazil

Nielsen is cementing Digital Ad Intel as the new go-to currency for digital ad intelligence in Brazil-now with streaming monitoring in the mix. S o Paulo, Augu...

12/08/2026

LPTV Advocates Petition FCC for Voluntary 5G Broadcasts

Share Copy link Facebook X Linkedin Bluesky Email...

12/08/2026

Tubi Media Group Inks Content Discovery Deal with Gracenote

Share Copy link Facebook X Linkedin Bluesky Email...

12/08/2026

Matrox Video Showcases IP-Based and Software-Defined Tech...

As Matrox Video celebrates 50 years of trusted innovation, the company will showcase its portfolio of interoperable IP technologies and software-defined innovat...

12/08/2026

SMPTE Showcases AI and Open Media Workflows and Industry...

SMPTE, the home of media professionals, technologists and engineers, today announced a program of expert-led sessions, professional workshops and networking eve...

12/08/2026

Berklee Announces Full Details for Inaugural Block Party, a Music Festival Next to Fenway Park

Berklee Announces Full Details for Inaugural Block Party, a Music Festival Next ...

12/08/2026

ACLU Requests ABC Station Probe Documents from FCC

Share Copy link Facebook X Linkedin Bluesky Email...

12/08/2026

Roger Keating To Retire from Hearst Television

Share Copy link Facebook X Linkedin Bluesky Email...

12/08/2026

Netflix Closes U.S. Upfronts, Nearly Doubles Ad Commitments

Share Copy link Facebook X Linkedin Bluesky Email...

12/08/2026

CBS Pittsburgh Debuts New AR/VR News Studio

Share Copy link Facebook X Linkedin Bluesky Email...

12/08/2026

Matthews Intros T-Go Extreme Rigging Solutions

Matthews Studio Equipment introduces T-Go Mounting Solutions extreme camera rigging systems, engineered for the most demanding environments in motion picture pr...

12/08/2026

Anton Bauers EDEN Becomes Only Mobile Power Station in it...

Anton/Bauer, a Videndum brand and the industry leader in mobile power solutions for broadcast and cinematic production, announces that the EDEN Mobile Power Sta...

12/08/2026

TAG Video Systems Cuts Hardware Costs for Customers with...

TAG Video Systems, the global leader in software-based IP monitoring and multiviewer solutions, today announced a memory usage optimization that lowers the tota...

12/08/2026

Unified Streaming Launches Trusted Media - C2PA in Dynami...

Unified Streaming announces Trusted Media, a new solution that enables broadcasters, streaming platforms, and premium content owners to attach verifiable authen...

12/08/2026

Tedial Powers the AI-Driven Media Supply Chain at IBC 202...

Combining intelligent automation, composable business services and user-centric experiences The media industry is entering a new phase where AI intelligence is...

12/08/2026

DPA Microphones Appoints Raul Contreras as West Coast Reg...

DPA Microphones welcomes Raul Contreras as its new West Coast Regional Sales Manager. In this role, Contreras will oversee sales and customer relationships thro...

12/08/2026

Weather is Not a Factor for Marshall Electronics New CV57...

Marshall Electronics' first all-weather, all-IP 4K POV camera, the CV574-WP, makes its European debut at IBC 2026 (Stand 10.C11). Built for the elements, th...

12/08/2026

A double off-switch helps cells respond to stress

LA JOLLA, CA-Scientists at Scripps Research have discovered that two seemingly unrelated cellular enzymes become locked together during times of stress, simulta...

12/08/2026

New Bookshop opening in London that offers new identities, not books, with free cover stories for all

NEW BOOKSHOP OPENING IN LONDON THAT OFFERS NEW IDENTITIES, NOT BOOKS, WITH FREE ...

12/08/2026

Live from London, its Saturday night! Saturday Night Live UK returns on 12 September

Brand-new trailer unveiled as Sky announces SNL UK ticket ballot will open on 14...

12/08/2026

Sky Sports agrees deal to show Laver Cup from Londons O2

Wednesday 12 August 2026 Sky Sports agrees deal to show Laver Cup from London's O2 Sky Sports has agreed a deal with Trident8 to show all three days of th...

12/08/2026

Pre-order the new Google Pixel 11 range from today and save up to 937 on Sky Mobile

Wednesday 12 August 2026 Pre-order the new Google Pixel 11 range from today and...

12/08/2026

NVIDIA CEO Tops Glassdoor's 2026 List of Best CEOs

NVIDIA founder and CEO Jensen Huang is ranked No. 1 on Glassdoor's Best CEOs list for 2026. In the just-released ranking, recognition is earned directly fr...

11/08/2026

Apple To Bring Friday Night Baseball Live to Apple Immersive on Vision Pro Beginning Aug. 28

Weekly immersive broadcasts will feature 8K 3D video, a 180-degree field of view...

11/08/2026

Looking for a New Cameraperson? ProductionHUB Guide Lays Out Considerations, Pitfalls

By Briana Brady, Social Media Manager, Production Hub Sports content is having ...

11/08/2026

SVG Sit-Down: Backlight CEO Kathleen Barrett on Building Media Infrastructure for a Global, AI-Driven Sports Landscape

She addresses why media organizations need more than asset storage, how sports t...