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

13/11/2025

L3Harris Successfully Tests Second RS-25 Engine for Artemis V

NASA and L3Harris conducted a full-duration RS-25 hot fire test Nov. 12 on the Fred Haise Test Stand at Stennis Space Center near Bay St. Louis, Mississippi, ma...

13/11/2025

Record-Breaking Live Broadcast Achieved with Clear-Com at the ADAC RAVENOL 24h Race at...

eds3_5_jq(document).ready(function($) { $(#eds_sliderM519).chameleonSlider_2_1({...

13/11/2025

Major Study Finds Many Mistakes in AI-Generated News Summaries

A groundbreaking new study by the BBC and the European Broadcasting Union (EBU) has found serious problems with news summaries generated by AI assistants....

13/11/2025

SES, Relativity Space Expand Multi-Launch Agreement for Terran R

Luxembourg and Long Beach, CA, 12 November 2025 - SES, a leading space solutions company, announced today an extended multi-year, multi-launch services agreemen...

13/11/2025

Field & Stream, Outdoor America Launch Field & Stream TV

NASHVILLE, Tenn. Field & Stream and Outdoor America have formed a strategic partnership to launch Field & Stream TV, rebranding Outdoor America's free ad-su...

13/11/2025

Silicondust Becomes An ATSC 3.0 Certificate Authority

PHOENIX, Ariz. Silicondust has announced it is now an ATSC 3.0 Certificate Authority for NextGen TV and said that it is offering an Online Certificate Status Pr...

13/11/2025

Nielsen Names Peter Naylor Its First Chief Client Officer

NEW YORK Nielsen has announced that Peter Naylor, an ad sales executive who has worked at some of the largest media companies in the world, will be its first ch...

13/11/2025

CBS Philadelphia's Jim Donovan to Retire in December

PHILADELPHIA After more than 20 years at CBS Philadelphia and an award-winning career spanning nearly four decades, Jim Donovan, anchor of CBS News Philadelphia...

13/11/2025

Frontline Announces 2025-26 Local Journalism Initiative Partners

BOSTON Frontline, PBS's investigative documentary series produced at GBH in Boston, has announced the newest class of partners for its Local Journalism Init...

13/11/2025

Major Study Finds High Levels of Mistakes in AI-Generated News Summaries

A groundbreaking new study by the BBC and the European Broadcasting Union (EBU) has found serious problems with news summaries generated by AI assistants....

13/11/2025

Gabriel Byrne, Carrie Crowley and Russell Howard among the guests on this week's Late Late Show

Legendary actor and proud Irishman Gabriel Byrne will be in studio this week to ...

13/11/2025

International Soccer takes centre stage on a jam-packed four days of live, free-to-air Sport across RT

Tonight's crucial Republic of Ireland World Cup qualifier v Portugal at the ...

13/11/2025

Karen Byrne, Andrew Ryan and Roddy Collins drop in for episode four of The 2 Johnnies Late Night Lock In

In the fourth episode of The 2 Johnnies Late Night Lock In the lads are joined b...

13/11/2025

GeForce NOW Enlists Call of Duty: Black Ops 7' for the Cloud

Chaos has entered the chat. It's GFN Thursday, and things are getting intense with the launch of Call of Duty: Black Ops 7, streaming at launch this week on...

12/11/2025

Wangu Kanuri: Finalist Young Journalist of the Year 2025

For me, no story is too small if it speaks to the ordinary Kenyan, says Wangu Kanuri, a multimedia journalist and contributor to the Nation Media Group working...

12/11/2025

Tracy Bonareri Onchoke: Finalist Young Journalist of the Year 2025

Tracy Bonareri Onchoke is an investigative journalist from Kenya who strives to tell stories that amplify voices pushed to the margins' in her reports for ...

12/11/2025

Godwin Asediba: Finalist Young Journalist of the Year 2025

Godwin Asediba who is an investigative journalist, producer and news anchor with TV3 and 3FM in Ghana, has received death threats for his work exposing injustic...

12/11/2025

SVG TranSPORT 2025: All Sessions Now Available to Watch on SVG PLAY

SVG TranSPORT 2025: All Sessions Now Available to Watch on SVG PLAYEvent addressed the latest in live sports video contribution and distribution technologyBy SV...

12/11/2025

2026 Sundance Film Festival Annual Event Celebrating Sundance Institute: A Tribute to Founder Robert Redford

L-R: Ed Harris, Gyula Gazdag Inaugural Robert Redford Luminary Award to Honor E...

12/11/2025

Give Me the Backstory: Get to Know Alireza Khatami, the Director of The Things You Kill

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

12/11/2025

Morgan Wallen Reflects on His Biggest Hits in New Billions Club: The Series' Episode

In 2023, Morgan Wallen made history when Last Night became the first solo coun...

12/11/2025

Calrec delivers future-focused production for Whisper Cymru

Calrec delivers future-focused production for Whisper Cymru at Wales's first-ever dedicated remote production hub Supporting a growing roster of live sports...

12/11/2025

Blue Lucy Renews Multi-Year Partnership with VSI Group

LONDON, England November 11, 2025 - Blue Lucy, a leading provider of media management and workflow automation solutions, is pleased to announce the renewal o...

12/11/2025

Clear-Com Deployed for Record-Breaking Live Broadcast

ALAMEDA, Calif. Clear-Com says its communications gear was recently deployed for the ADAC RAVENOL 24h Race at Germany's N rburgring circuit, which set a rec...

12/11/2025

Mediagenix Joins AWS ISV Accelerate Program

BRUSSELS Mediagenix has announced that it has joined the Amazon Web Services (AWS) Independent Software Vendor (ISV) Accelerate Program (ISV). This acceptance f...

12/11/2025

Alfalite Partners with Adistec to Expand Presence in the Americas

HUELVA, Spain Alfalite, Europe's only LED screen manufacturer, has announced a strategic partnership with Adistec Corp, a leading distributor of infrastruct...

12/11/2025

Stingray to Acquire TuneIn for up to $175 Million

MONTREAL Stingray Group Inc. has announced that it has entered into a definitive agreement to acquire TuneIn Holdings, Inc. ( 'TuneIn''), a pioneer ...

12/11/2025

Vubiquity Earns AWS Media and Entertainment Competency St...

Vubiquity, an Amdocs company and global leader in technology-led media services, today announced it has achieved the Amazon Web Services (AWS) Media & Entertain...

12/11/2025

SES and AMN Expand Rural Connectivity across Cte d'Ivoire with Major Network Upgrade

Over 200 upgraded sites now delivering 2G and 3G mobile data services to more th...

12/11/2025

DirecTV Launches New CTV Political Ad Platform

NEW YORK and WASHINGTON DirecTV Advertising has launched DirecTV Elect, a new digital platform powered by AI that is specifically designed for political adverti...

12/11/2025

Carr Weighs in on Disney, YouTube Dispute

WASHINGTON Federal Communications Commission Chair Brendan Carr has weighed in on the blackout of ABC, ESPN and other Disney programming on YouTube TV with a po...

12/11/2025

VEON Wins Corporate Governance Awards for Kyivstar Listing and Technology Leadership in Corporate Governance

12 Nov 2025 VEON Wins Corporate Governance Awards for Kyivstar Listing and Tech...

12/11/2025

Sky unveils first of its kind clean power system for film and TV production

Wednesday 12 November 2025 Sky unveils first of its kind clean power system for film and TV production Sky has today unveiled a major new clean energy system ...

12/11/2025

'The Accident 2' Welcomes Brbara de Regil to the Cast and Premieres Official Trailer

Back to All News The Accident 2 Welcomes B rbara de Regil to the Cast and Premi...

12/11/2025

International standards bodies release climate action policy paper at COP30

Wednesday 12th November - Bel m, Brazil - Today, leading organizations IEC, ISO and ULSE, initiators of the Standards Pavilion at UNFCCC COP30, published a join...

12/11/2025

Preferred Business Partner of the German Bundesverband E-Commerce und Versandhandel Deutschland e.V. (bevh)

Arvato Systems Becomes Preferred Business Partner of the German Bundesverband E-...

12/11/2025

Celebrating 21 Years of the RT Choice Music Prize

RT Choice Music Prize In association with IMRO and IRMA 2 0 2 6 K E Y D A T E S Irish Album of the Year 2025 Shortlist 19th January Irish Song of the ...

12/11/2025

NVIDIA Wins Every MLPerf Training v5.1 Benchmark

In the age of AI reasoning, training smarter, more capable models is critical to scaling intelligence. Delivering the massive performance to meet this new age r...

12/11/2025

RT Investigates reveals Court Interpreter in overturned FGM case worked on over 240 other Irish court cases

Parents jailed for over two years after bringing their daughter to hospital for ...

12/11/2025

Faster Than a Click: Hyperlink Agent Search Now Available on NVIDIA RTX PCs

Large language model (LLM)-based AI assistants are powerful productivity tools, but without the right context and information, they can struggle to provide nuan...

11/11/2025

SVG Sit-Down: How Pixellot's Automated-Production-Tech Stack Is Evolving in the AI Era

SVG Sit-Down: How Pixellot's Automated-Production-Tech Stack Is Evolving in ...

11/11/2025

Introducing SVG's New Platinum White Papers' Platform

Introducing SVG's New Platinum White Papers' PlatformTop technology providers detail how they are innovating in sports productionBy SVG Staff Tuesday...

11/11/2025

SVG All-Stars: Vanessa Lindsey, Senior Director, Technical and Remote Operations and Crewing, TNT Sports

SVG All-Stars: Vanessa Lindsey, Senior Director, Technical and Remote Operations...

11/11/2025

Lesson Plan: How Big Ten Network's StudentU Produces Broadcast Pros - and 2,000+ Live Games a Year

Lesson Plan: How Big Ten Network's StudentU Produces Broadcast Pros - and 2,...

11/11/2025

Peacock Performance View Feature Now Available for All NBA Games on Peacock

Peacock Performance View Feature Now Available for All NBA Games on PeacockBy Jason Dachman, Editorial Director, U.S. Tuesday, November 11, 2025 - 2:10 pm P...

11/11/2025

Spotify and NMPA Announce Agreement to Expand Direct-Licensing Audiovisual Opportunities for Independent Publishers

Today, Spotify and the National Music Publishers' Association (NMPA) launche...

11/11/2025

SGL Carbon site in Willich celebrates 30 years of Expertise in High-Tech Prepregs

This year, SGL Carbons Willich site is celebrating a special anniversary. For 30...

11/11/2025

New Nielsen Rural Survey reveals the changing media habits of Filipinos outside major cities

Rural connectivity rising fast Traditional media still matters Rural Filipinos...