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

19/12/2025

FCC's Brendan Carr Stands Up for His Policies at Senate Hearing

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

19/12/2025

Nexstar Brand Studio Launches with 'My American Story Campaign'

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

19/12/2025

Nashville To Host 2026 AES Show

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

19/12/2025

NAB Launches Effort to Keep Live Sports on Broadcast Channels

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

19/12/2025

FCC Votes to Adopt New Rules for LPTV Stations

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

19/12/2025

Hearst Television Ups Mike Kronenfeld to VP, National Sales

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

19/12/2025

Ricardo Coke-Thomas Named Chair of Theater for Boston Conservatory at Berklee

Ricardo Coke-Thomas Named Chair of Theater for Boston Conservatory at Berklee The distinguished theater educator, director, and performer will join the Conser...

19/12/2025

December 18, 2025

Nanoparticle vaccine strategy could protect against Ebola and other deadly filoviruses Scripps Research scientists turn nanoparticles into virus showcases to ...

18/12/2025

SVG Campus Shot Callers: Kurt Sutton, Director of Broadcast Operations, Clemson University

SVG Campus Shot Callers: Kurt Sutton, Director of Broadcast Operations, Clemson ...

18/12/2025

Follow the Money Episode 2: Inside the Sports Media Biz with Sam McCleery and Steve Hellmuth

Follow the Money Episode 2: Inside the Sports Media Biz with Sam McCleery and St...

18/12/2025

SVG Sit-Down: Google Cloud's Anshul Kapoor on the Future of Generative Production' in Live Sports

SVG Sit-Down: Google Cloud's Anshul Kapoor on the Future of Generative Prod...

18/12/2025

The 2025 SVG Summit Draws Record Crowd for 20th-Annual Sports-Production Industry Homecoming in NYC

The 2025 SVG Summit Draws Record Crowd for 20th-Annual Sports-Production Industr...

18/12/2025

SBS's sports schedule sizzles in January with Dakar Rally, Kooyong Classic and Mapei Cadel Evans Great Ocean Road Race

SBS's sports schedule sizzles in January with Dakar Rally, Kooyong Classic a...

18/12/2025

Montreal's Bell Centre elevates fan experience with Argo S

Canada's largest indoor arena has transformed its live production capabilities with a full ST 2110 infrastructure and Calrec's compact Argo S console. S...

18/12/2025

The Gauge: Mexico November 2025

During November, streaming's share of TV viewing in Mexico settled at 24.2%, an increase of 0.5 share points from the previous month. Disclaimer: YUMI TV,...

18/12/2025

The Gauge: Poland | November 2025

November continued the upward trend in television viewership. The significantly colder weather and a rich programming lineup encouraged viewers to spend more ti...

18/12/2025

Gracenote helps TV platforms go beyond the game and deliver more connected, visually rich sports hub experiences

As viewers turn to sports highlights, recaps and documentary programming, expand...

18/12/2025

NAB Once Again Urges FCC to Eliminate Ownership Rules

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

18/12/2025

Carr Stands Up for His Policies in Senate Hearing

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

18/12/2025

The HELM and ARRI announce strategic partnership to redef...

The HELM, a global expert in cinematic live broadcast and high-end production workflows, has entered a strategic partnership with ARRI, the renowned designer an...

18/12/2025

Cadena Melodia Upgrades to DHD SX2 Audio Production Conso...

Cadena Melod a de Colombia (Cadena Melod a), a long-established Colombian radio network, has chosen DHD audio SX2 production consoles for integration into the m...

18/12/2025

Czech TV Elevates Video Streaming with Harmonic

Harmonic (NASDAQ: HLIT) today announced that Czech Television (Czech TV), the public broadcaster of the Czech Republic, has teamed up with Harmonic to modernize...

18/12/2025

Broadcast Solutions Group acquires PMT Professional Motio...

Broadcast Solutions Group, a leading system integrator and provider of innovative solutions for the broadcast and media industry, has announced the acquisition ...

18/12/2025

Keepit named a Leader in IDC MarketScape for Worldwide Sa...

Keepit, the SaaS data protection company, announced today that it has been named a Leader in the IDC MarketScape: Worldwide SaaS Data Protection 2025-2026 Vendo...

18/12/2025

Limecraft 2025 Version 8 adds User Controlled Notificatio...

Limecraft today announced the release of Limecraft 2025.8, the eighth and final major platform update of the year. This release strengthens daily workflows acro...

18/12/2025

creativespace Expands Footprint in the House of Worship M...

DigitalGlue is very grateful, especially at this time of the year, that its creative.space platform has expanded its footprint within the House of Worship marke...

18/12/2025

TAG Video Systems Celebrates Multiple APAC Award Wins for...

TAG Video Systems is proud to share that the company has recently received multiple industry recognitions across the Asia-Pacific region, reflecting its ongoing...

18/12/2025

NDI and Zoom team up to bring seamless connectivity to me...

NDI, the leading video connectivity standard for AV-over-IP, and Zoom, the AI-first collaboration platform, announce a strategic collaboration to integrate the ...

18/12/2025

YES and Synamedia extended deal backs Partner TV launch

Leading video software provider, Synamedia, today announced that it is extending its long-standing relationship with YES, the pay-TV subsidiary of the largest I...

18/12/2025

Riedel Builds Global Communication and Commentary Network...

Riedel Communications today announced it provided a fully integrated communications and commentary solution for the 15th National Games of China, supporting 56 ...

18/12/2025

Clear-Com Arcadia Central Station Links Toledo Walleye an...

When both the Toledo Walleye and Toledo Mud Hens play at home on the same night, communication between their respective production teams is essential. To stream...

18/12/2025

TMT Insights Focus Platform Recognized with TV Tech Best...

TMT Insights' new upstream media supply chain platform, Focus, was selected as a winner in the 2025 Media & Entertainment: Best in Market Awards in the TV T...

18/12/2025

Clear-Com Named Official Intercom Partner for NAMMs 125th...

Clear-Com is proud to announce its continued role as the official intercom supplier for the Yamaha Grand Plaza Stage at The 2026 NAMM Show, taking place Januar...

18/12/2025

CES: NBCU Unveils New Cross-Platform Ad Tech Solutions, Capabilities

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

18/12/2025

2026 NAB Show Opens Registration, Unveils Major Program Enhancements

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

18/12/2025

YouTube Wins Global Rights to Stream the Oscars

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

18/12/2025

PGA TOUR Studios Teams up with SES for Hybrid Content Distribution

Long-term agreement includes the SES SCORE platform and hybrid distribution worldwide to deliver more than 5,000 hours of golf tournaments annually featuring th...

18/12/2025

NVIDIA, US Government to Boost AI Infrastructure and R&D Investments Through Landmark Genesis Mission

NVIDIA will join the U.S. Department of Energy's (DOE) Genesis Mission as a ...

18/12/2025

Master Clock Management with Segment Rulesets in WO Automation for Radio

Talk formats require careful clock management and system tools to ensure audio content aligns as intended. WO Automation for Radio's Segment Rulesets provid...

18/12/2025

Reflecting on 2025: A Year of Transformation and Growth

By Toni Coonce, CEO, WideOrbit As 2025 comes to a close, I find myself reflecting on how much WideOrbit has evolved, not only in products and solutions but also...

18/12/2025

VEON Upgraded to Nasdaq Global Select Market, Enhancing Investor Visibility

18 Dec 2025 VEON Upgraded to Nasdaq Global Select Market, Enhancing Investor Visibility Dubai, December 18, 2025 - VEON Ltd. (Nasdaq: VEON), a global digital o...

18/12/2025

Tribeca X Launches Inaugural Advisory Council, Teases 2026 Awards Jury, and Announces New Global Programming

December 18th, 2025 Tribeca X Launches Inaugural Advisory Council, Teases 202...

18/12/2025

Tribeca Becomes First Major Film Festival to Open Submissions to Social Media Creators

December 18th, 2025 As Tribeca Celebrates Its 25th Anniversary, Festival Expa...

18/12/2025

Sky Sports remains the exclusive home of the Masters Tournament, with more live coverage than ever before

Thursday 18 December 2025 Sky Sports remains the exclusive home of the Masters ...

18/12/2025

Teaser for Can This Love Be Translated' Previews a Heartwarming Romance To Open 2026

Back to All News Teaser for Can This Love Be Translated' Previews a Heartw...

18/12/2025

2025-11-18

Using the additive process of 3D printing, layer after layer gets printed until an object is as close to the final shape needed as possible. Historically, machi...

18/12/2025

RT Supporting the Arts 2025 Review | January 2026 Events

In 2025, RT proudly supported 185 arts and cultural events across the island of Ireland, reflecting significant growth since the scheme was re-launched in 2014...

18/12/2025

The RT Sport Young Sportsperson of the Year Nominees 2025 Revealed

RT Sports Awards 2025 live on RT One and RT Player at 8:05pm on Saturday 20 December On Saturday 20 December live on RT One and RT Player at the earlier t...

18/12/2025

RT lyric fm celebrates the Winter Solstice with a special Ambient Orbit live broadcast

RT lyric fm presents a very special Winter Solstice edition of Ambient Orbit, l...

18/12/2025

Now Generally Available, NVIDIA RTX PRO 5000 72GB Blackwell GPU Expands Memory Options for Desktop Agentic AI

Top-notch options for AI at the desktops of developers, engineers and designers ...