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

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

01/05/2026

NBCUniversal's Peacock to Be First Streamer to Integrate Dolby's Full Suite of Premium Picture and Sound Innovations

January 5 2026, 18:30 (PST) NBCUniversal's Peacock to Be First Streamer to ...

01/04/2026

DOLBY AND DOUYIN EMPOWER THE NEXT GENERATON OF CREATORS WITH DOLBY VISION

January 4 2026, 18:00 (PST) DOLBY AND DOUYIN EMPOWER THE NEXT GENERATON OF CREATORS WITH DOLBY VISION Douyin Users Can Now Create And Share Videos With Stun...

10/01/2026

Give Me the Backstory: Get to Know Cherien Dabis, the Filmmaker Behind All That's Left of You ( )

By Bailey Pennick One of the most exciting things about the Sundance Film Festi...

10/01/2026

Golden Week Nominees Night Celebrates a Podcasting Milestone

This year, podcasts are making their Golden Globes debut with a new category honoring the medium's leading shows and creators. To mark the occasion, Spotify...

10/01/2026

ESPN Reports Near-Record Viewing for Start of NBA Season

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

10/01/2026

Connection and Youth Defined: 'The Ramparts of Ice' Brings a Heartwarming Story of Friendship to Netflix this April

Back to All News Connection and Youth Defined: The Ramparts of Ice Brings a Hea...

09/01/2026

Rock-It Sports' Deron Brown & Laura Rowlands on Launching a New Brand, Supplying Logistical Needs for Events in 2026

Rock-It Sports' Deron Brown & Laura Rowlands on Launching a New Brand, Suppl...

09/01/2026

Warner Bros. Discovery's Chris Brown on the Broadcaster's First French Open, Advancing Remote Workflows at Techwood Facility

Warner Bros. Discovery's Chris Brown on the Broadcaster's First French O...

09/01/2026

NFL Playoffs 2026: CBS Sports Travels to Jacksonville With Packed Arsenal of Production Capabilities

NFL Playoffs 2026: CBS Sports Travels to Jacksonville With Packed Arsenal of Pro...

09/01/2026

NFL Playoffs 2026: NBC Sports Is Set To Roll Out New Scorebar, Insert Graphics This Weekend

NFL Playoffs 2026: NBC Sports Is Set To Roll Out New Scorebar, Insert Graphics T...

09/01/2026

NFL Playoffs 2026: Prime Video Production Team Caps Historic Season With Iconic Bears-Packers Primetime Matchup in Chicago

NFL Playoffs 2026: Prime Video Production Team Caps Historic Season With Iconic ...

09/01/2026

NFL Playoffs 2026: FOX Sports Kicks Off Postseason Slate With Two-Game Wild Card Coverage

NFL Playoffs 2026: FOX Sports Kicks Off Postseason Slate With Two-Game Wild Card...

09/01/2026

NFL Playoffs 2026: ESPN's Run Brings Monday Night Football' Flagship Operation Into January

NFL Playoffs 2026: ESPN's Run Brings Monday Night Football' Flagship Op...

09/01/2026

Carr: FCC Looking for Ways to Empower' Local Broadcasters

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

09/01/2026

Panasonic to Introduce Projection, LED and Workflow Offerings at ISE 2026

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

09/01/2026

SMPTE Announces 2026 Leadership

SMPTE , the home of media professionals, technologists, and engineers, today introduced the board officers and regional governors who will serve terms beginning...

09/01/2026

Globecast Appoints Chris Pulis as Group Chief Technology...

Globecast, the leading provider of broadcast, media and entertainment managed services, today announced the appointment of Chris Pulis as Group Chief Technology...

09/01/2026

Hollywood Professional Association Announces Updates to B...

The Hollywood Professional Association (HPA) today announced several updates to its board of directors. As part of HPA s annual governance cycle, new leadership...

09/01/2026

SDVI APPOINTS SIMON ELDRIDGE AS CHIEF OPERATING OFFICER

SDVI, the leading platform provider for cloud-native media supply chains, today announced that Simon Eldridge has been appointed chief operating officer. In thi...

09/01/2026

Cobalt Digital Returns to ISE with Comprehensive Lineup o...

Cobalt Digital, the leading designer and manufacturer of award-winning ST 2110 and SDI signal processing products, and a founding partner in the openGear initi...

09/01/2026

iWedia Strengthens Leadership in ATSC 3-0 with Market-Pro...

iWedia, a global leader in connected TV software solutions, announces that its market-proven ATSC 3.0 software stack is powering the broadcast functionality of ...

09/01/2026

Amino and Xibo Partner to Deliver Next Generation 4K Digi...

Amino, a global leader in enterprise video and digital signage technology, today announced a strategic partnership with Xibo, a leading global digital signage s...

09/01/2026

FIFA Strikes Content Deal with TikTok for 2026 World Cup

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

09/01/2026

HPA Elects New Officers, Board Members for 2026

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

09/01/2026

NFL's 2025-26 Regular Season Is Second-Most-Watched Ever

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

09/01/2026

FCC Sets Tentative Agenda for Jan. 29 Open Meeting

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

09/01/2026

Carr: FCC Looking for Ways to 'Empower' Local Broadcasters

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

09/01/2026

RT delivers another record year in 2025, bringing Ireland together with national moments

RT Player has 157 million streams, up 10% year-on-year An increase on 2024, RT...

09/01/2026

2FM announces line-up of Rising Artists for 2026

RT 2FM has today announced the highly anticipated list of 2FM Rising Artists for 2026, kicking off 2FM Rising week for the eighth year on The Tracy Clifford Sh...

09/01/2026

RT to Host the 2026 RTS Ireland Awards

RT to Host the 2026 RTS Ireland Awards Thursday, 16 April 2026 | Dublin Royal Convention Centre The RTS Ireland Television Awards 2026 | Gradaim RTS 2026 | R...

09/01/2026

NVIDIA Unveils Multi-Agent Intelligent Warehouse and Catalog Enrichment AI Blueprints to Power the Retail Pipeline

Every that was easy shopping moment is made possible by teams working to hit s...

08/01/2026

How disinformation is shaping Sudan's conflict: a new report

An evidence-based analysis on disinformation and information manipulation in Sudan's ongoing conflict is published today. (January 8th 2026). Thomson Found...

08/01/2026

At CFP Semifinals, ESPN Again Flexes Its Operational Muscle With 20+ MegaCast Viewing Options

At CFP Semifinals, ESPN Again Flexes Its Operational Muscle With 20+ MegaCast Vi...

08/01/2026

SVG Students To Watch: Sophie Fowler, University of Oregon

SVG Students To Watch: Sophie Fowler, University of OregonThe Portland product has honed her skills as a producer, director, and TD at Quack VideoBy Brandon Cos...

08/01/2026

Follow the Money, Episode 3: Inside the Sports-Media Biz With Sam McCleery and Ken Aagaard

Follow the Money, Episode 3: Inside the Sports-Media Biz With Sam McCleery and K...

08/01/2026

SVG New Sponsor Spotlight: Qualstar's Jeff Sengpiehl on the Enduring Power and Value of LTO Tape for Video Archiving

SVG New Sponsor Spotlight: Qualstar's Jeff Sengpiehl on the Enduring Power a...

08/01/2026

Legendary February: Production Leaders at NBC Sports Pull Back the Curtain on Olympics, Super Bowl, NBA All-Star Plans

Legendary February: Production Leaders at NBC Sports Pull Back the Curtain on Ol...

08/01/2026

One Year In: How Creators Are Growing Their Shows and Connecting With Audiences Through the Spotify Partner Program

In 2025 we launched the Spotify Partner Program to give creators more ways to tu...

08/01/2026

Spotify Toasts to the Future of Podcasting With Creators at Our New Sycamore Studios

On Wednesday in Los Angeles, Spotify welcomed creators and press to a brunch cel...

08/01/2026

Hollywood Professional Association (HPA) Announces Updates to Board of Directors

The Hollywood Professional Association (HPA) today announced several updates to its Board of Directors. As part of HPA's annual governance cycle, new leader...

08/01/2026

Chyron Releases Virtual Placement 8.0

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

08/01/2026

SMPTE Names Board Officers, Governors for 2026

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

08/01/2026

FCC to Vote on Proposals Expanding Unlicensed Use of 6 GHz Band

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

08/01/2026

RTVE selects Alfalite Neopix for its first broadcast depl...

Spain's national public broadcaster, RTVE, has upgraded one of its main television production facilities in Madrid with the installation of two Alfalite NEO...

08/01/2026

Richard E. Wiley to Step Down as Media Institute's Chairman

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

08/01/2026

Cineverse Acquires Giant Worldwide

Share Share by: Copy link Facebook X Whatsapp Pinterest Flipboard...

08/01/2026

Maxon Introduces Cinebench 2026

Maxon's new release of Cinebench features performance enhancements and adds support for the latest Nvidia and AMD GPUs as well as Apple Silicon. Maxon is t...

08/01/2026

Zixi Accelerates Global Growth with Appointment of Heathe...

Zixi, the industry leader in IP-based video transport and orchestration, today announced the appointment of Heather Mellish as Vice President, Global Sales. In...