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

20/10/2026

ESPN Is Bringing Its Funday Football' Animated Alternate Broadcast Series to Super Bowl LXI, and This Time It's Star Wars' Themed

Sony's Beyond Sports technology will power real-time animation of the game, ...

20/10/2026

NBA App Adds Game Pulse, Ai-Based Chat Feature to Keep Fans Tuned In

The NBA is putting on a full-court press when it comes to digital offerings this year, and that includes some great new features on the NBA App as well as a new...

20/10/2026

Op-Ed: AI Is Making It Cheaper To Build. Sports Needs To Make It Cheaper To Learn

Testing what works is an important part of developing successful fan engagement....

20/10/2026

CBS Sports Amplifies Coverage of U.S. Open Cup Final With Fan Cam in Supporters Section, Onsite Studio Programming

One fan in The Nordecke will wear the device via headset on Wednesday night Spo...

20/10/2026

NBA on NBC Production Team Ready To Build on Year 1 Success, Expands Use of Graphics for Analysis on Tap

Regular-season game coverage will continue to be a mix of REMI and onsite produc...

20/10/2026

Grass Valley Adds Bridge Technologies to Media eXchange Layer Initiative

Grass Valley has added Bridge Technologies to the company's Media eXchange Layer (MXL) initiative, demonstrating how this has supported the containerization...

20/10/2026

Gravity Media Drives Lifted Entertainment's Im A Celebrity... The Wild Frontier, Through Rapid-Deployment IP Production

Gravity Media has rapidly deployed complete IP-based broadcast infrastructure fo...

20/10/2026

Ateme, Viamedia Provide Access to Programmatic TV Advertising to Independent and Regional Operators

Ateme has announced a strategic partnership with Viamedia, the ad tech company b...

20/10/2026

AES Show 2026: Industry Panel Examines Live Entertainment Delivery in Dolby Atmos

As concerts and other live performances reach audiences through global streaming...

20/10/2026

Media Links Powers Live Broadcast Contribution at the All-Asia Games 2026

Media Links' Xscend platform and MDP3020 IP media gateways supported live broadcast contribution for the All-Asia Games, that recently took place in Japan. ...

20/10/2026

Op-Ed: One Sprint Season, Two Season Launches. How MLS Creative Teams Can Prepare for 2027

For Major League Soccer creative teams, 2027 is going to be unlike any year they...

20/10/2026

NHL Constructs Massive Manitoba Cabin Setting for 2026 NHL Heritage Classic on Oct. 25

The National Hockey League (NHL) has given a first look at its planned transform...

20/10/2026

FloSports, National Lacrosse League Begin Exclusive Multiyear Global Streaming Partnership

FloSports and the National Lacrosse League (NLL) have entered into a multiyear m...

20/10/2026

AMWA Takes Home Technology & Engineering Emmy Award for Development of NMOS Discovery, Registration and Connection

The Advanced Media Workflow Association (AMWA) has received a 2026 Technology & ...

20/10/2026

Pearl TV Makes Major Progress Toward Affordable NEXTGEN TV Converter Boxes

Pearl TV has made significant progress in its industry-wide initiative to make NEXTGEN TV converter boxes more affordable and accessible to consumers, marking a...

20/10/2026

37th SPORTEL Awards Honor Best in Content, Sports Productions

The 37th edition of SPORTEL Awards took place on Monday, Oct. 19 at the Grimaldi Forum Monaco, under the High Patronage of H.S.H. Prince Albert II of Monaco. Ch...

20/10/2026

Sistemas de Video Comunicacin S.A. Starts Partnership With Amagi for Media Tech Modernization in South America

Amagi has announced a strategic partnership with Sistemas de Video Comunicaci n ...

20/10/2026

Eurosport, TNT Sports Continue Coverage of Tour de France and La Vuelta a Espaa in Europe

The home of cycling coverage is secure as Eurosport and TNT Sports today extend ...

20/10/2026

Give Me the Backstory: Get to Know Itab Azzam and Jack MacInnes, the Directors of One in a Million

By Ramona Flume One of the most exciting things about the Sundance Film Festiva...

20/10/2026

SUNDANCE INSTITUTE NAMES TRACY BRADY AS CHIEF MARKETING, BRAND AND COMMUNICATIONS OFFICER

Veteran Entertainment and Brand Executive to Lead Global Communications Strategy...

20/10/2026

UJAM release Beatmaker & Usynth Bounce

Inspired by late-90s & early-2000s R&B, hip-hop & club music UJAM have just introduced two new virtual instruments that bring together a versatile selection...

20/10/2026

Groove Synthesis release 3rd Wave Terminal

Synth gains free editor & librarian application Back at Superbooth 2026, Groove Synthesis gave us a sneak preview of a desktop software application that off...

20/10/2026

Calrec appoints Video Progetti as Italian partner

With more than 30 years in the Italian broadcast market, Video Progetti will offer the complete Calrec range, giving broadcasters the freedom to choose and scal...

20/10/2026

Pearl TV Issues Progress Report on Low-Cost 3.0 Converters in Advance of NAB Show New York

Share Copy link Facebook X Linkedin Bluesky Email...

20/10/2026

USSI Global Ups Ted Korte to Chief Technology Officer

Share Copy link Facebook X Linkedin Bluesky Email...

20/10/2026

The Weather Company Unveils Weather Story Assist

Share Copy link Facebook X Linkedin Bluesky Email...

20/10/2026

Calrec appoints Video Progetti as Italian distribution pa...

Calrec has appointed Video Progetti, the Rome- and Milan-based broadcast distributor and AV system integrator, as its distribution partner for Italy. Media comp...

20/10/2026

FOR-A and Canon team up for a unified approach to PTZ pro...

FOR-A has collaborated with Canon to integrate PTZ camera control into the software-defined MixBoard production switcher. The resulting seamless operations wer...

20/10/2026

KRK Monitors Help The Beat Garden Grow a Sound That is Al...

Great music rarely happens in isolation. It emerges when artists, producers, and songwriters exchange ideas, challenge one another, and find unexpected creative...

20/10/2026

BeckTV, Beam Dynamics and Providius Connect Broadcast Sys...

Collaboration gives broadcast teams a faster path from network alerts to the affected equipment, system dependencies and support information BeckTV, Beam Dyna...

20/10/2026

NHK Super Hi-Vision Cameras Join Journey to the Red Planet

Share Copy link Facebook X Linkedin Bluesky Email...

20/10/2026

Kokusai Denki to Debut New Broadcast Camera Viewfinder at 2026 NAB Show New York

Share Copy link Facebook X Linkedin Bluesky Email...

20/10/2026

PrimeTime Lighting Systems Unveils Duo Stream Plug-and-Play Lighting

Share Copy link Facebook X Linkedin Bluesky Email...

20/10/2026

OWC Makes OWC Dock Ejector 2.1 Available for General Release

Share Copy link Facebook X Linkedin Bluesky Email...

20/10/2026

Amagi Expands its South American Presence

Share Copy link Facebook X Linkedin Bluesky Email...

20/10/2026

University of Washington Opens Four-Control-Room IP Produ...

University of Washington Intercollegiate Athletics has brought its new Sundodger Studios production facility on air, with Grass Valley cameras and production sw...

20/10/2026

Miri Technologies to Showcase Whats New and Whats Next fo...

Live demos will include upgrades for the X510 bonding router, self-serve management for NetConnect data plans and a technology preview of future developments ...

20/10/2026

Jigsaw24 Appoints Alex Battrick as Pre-Sales Solution Con...

Jigsaw24 has appointed Alex Battrick as Pre-Sales Solution Consultant, strengthening its technical expertise as the company expands its offering across live pro...

20/10/2026

COW Jobs: Toronto Freelance Crew Call - Your Story - open, ongoing

COW Jobs: Toronto Freelance Crew Call - Your Story - open, ongoing Brie Clayton October 19, 2026 0 Comments Toronto Freelance Crew Call - Your Story (...

20/10/2026

Give your photos a second chance with Open Eyes in Lightroom on mobile

Give your photos a second chance with Open Eyes in Lightroom on mobile Shambhavi Kadam October 19, 2026 0 Comments You know the frustration. Everyone ...

20/10/2026

Paperwolf Studio launches eight creative OpenFX plugins for DaVinci Resolve

Paperwolf Studio launches eight creative OpenFX plugins for DaVinci Resolve Brie Clayton October 19, 2026 0 Comments Datamosh, slit-scan, camcorder lo...

20/10/2026

MLBs Regional Broadcast Rights Worth $1.6B Despite RSN Disruption

Share Copy link Facebook X Linkedin Bluesky Email...

20/10/2026

PSSI Ups Tracy Michaels to Vice President of Engineering

Share Copy link Facebook X Linkedin Bluesky Email...

20/10/2026

Hearst Television Adds Chris Plourde as VP, Strategy and Distribution

Share Copy link Facebook X Linkedin Bluesky Email...

20/10/2026

Scripps Research bestows inaugural Distinguished Alumni Awards

LA JOLLA, CA-The Scripps Research Alumni Network has announced the two divisional winners of its inaugural awards program, created to honor institute alumni for...

20/10/2026

2026 UNTAPPED Development Lab participants announced

2026 UNTAPPED Development Lab participants announced 20 October 2026 Top (L-R): Becki Bouchier, Carly Brand, Leslie Hornung. Bottom (L-R): Joseph Meldrum, Elle...

20/10/2026

Boston Conservatory Center Stage Presents Romantic Musical Comedy She Loves Me

Boston Conservatory Center Stage Presents Romantic Musical Comedy She Loves Me Conservatory musical theater students will perform the charming production, set...

20/10/2026

Rachel McFarlanes American Dialogue Premieres at Carnegie Hall

Rachel McFarlanes American Dialogue Premieres at Carnegie Hall The alum composer and violinists commissioned work is part of Sphinx Virtuosis nationwide tour ...

20/10/2026

FOR-A and Canon team up for a unified approach to PTZ production

Collaboration delivers comprehensive camera control and switching in a single intuitive interface...