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

09/10/2026

Dolby Expands Dolby OptiView Platform with New Capabilities at IBC 2026

September 10 2026, 06:00 (PDT) Dolby Expands Dolby OptiView Platform with New Capabilities at IBC 2026 New Sports Intelligence helps providers better unders...

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

26/09/2026

ESPN Operations, Production Teams Plan for Every Scenario as WNBA Playoffs Tip Off

With short turnaround between game selections, ESPN's operations team is pla...

26/09/2026

Prime Video Scales Up for First WNBA Postseason, Adding Cameras, Analysts, Coach Mics, and NBA Mobile Units

Prime Video will use GCV's Bird and Magic mobile units for its inaugural WNB...

26/09/2026

NBC Sports Tips Off First WNBA Postseason in 20+ Years Using Sunday Night Basketball as a Production Baseline

Studio show moves on-site as network models playoff coverage on its NBA flagship...

26/09/2026

Ratings Roundup: Cowboys-Commanders Leads NFL Week 2 With 27.2 Million, College GameDay Posts Best Week 3 Ever

Ratings Roundup is a rundown of recent ratings news and is derived from press re...

26/09/2026

From Sketch to Strut, Unzipped Returns to the Sundance Film Festival at 30

Douglas Keeve attends the 2025 Sundance Film Festival screening of Unzipped at the Egyptian Theatre. (Photo by Andrew H. Walker/Shutterstock for Sundance Film...

26/09/2026

Native Instruments update Maschine

Launched alongside three new expansion packs In celebration of their 30th anniversary, Native Instruments have released a major update for their Maschine 3 ...

26/09/2026

YouTube Embraces Microdramas with Features for Episodic Shorts

Share Copy link Facebook X Linkedin Bluesky Email...

26/09/2026

Civil Rights Groups Urge Sen. Cruz to Delay Thumann Severs FCC Confirmation

Share Copy link Facebook X Linkedin Bluesky Email...

25/09/2026

SVG GameDay, Ep. 32: National Hockey Leagues John Bochiaro - Leading the Leagues In-Venue Efforts

In-venue and creative video staffers at the professional and collegiate level ha...

25/09/2026

HBS Taps Ronald den Hollander as CEO

Infront has named Ronald den Hollander as CEO of its Host Broadcast Services (HBS) subsidiary, effective 1 October 2026. The appointment follows the previously ...

25/09/2026

NABA to Host Cyber University 2.0 Cybersecurity Summit in New York

The North American Broadcasters Association (NABA) will hold Cyber University 2.0, a full-day cybersecurity summit for the broadcast and media industries, on Tu...

25/09/2026

Alpha Networks and Ateme Deliver Low-Latency Video Platform for International Sporting Event

Alpha Networks and Ateme have delivered a joint video platform for the digital d...

25/09/2026

Viaplay Migrates Free-to-Air Channels to Encompass Altitude Scheduling

Encompass Digital Media has announced the migration of multiple Viaplay free-to-air channels - TV3, TV6, TV8, and TV10 - to its Altitude Scheduling platform. Al...

25/09/2026

NAB Show New York 2026 Set for October 21-22 at Javits Center

NAB Show New York 2026 will take place October 21-22 at the Jacob K. Javits Convention Center in New York City. Registration is open at nabshow.com/newyork. Th...

25/09/2026

NHL Network to Air NHL Tonight, NHL Now, NHL Tonight: First Shift, and On The Fly During 2026-27 Season

NHL Network has announced its studio programming lineup for the 2026-27 regular ...

25/09/2026

First Baptist Nashville Installs Clear-Com Arcadia Central Station

Clear-Com has announced that First Baptist Nashville has upgraded its production communications with a Clear-Com intercom system as part of a sanctuary technolo...

25/09/2026

Broadcast Management Group Upgrades to EVS XT-VIA Platform at Cloud Control Center

Broadcast Management Group (BMG) has deployed EVS XT-VIA live video production s...

25/09/2026

BBright Adds dotCentral as U.S. Sales and Support Partner

BBright, a Hexaglobe Group company, has announced that dotCentral has joined as a sales and support partner in the United States. BBright's portfolio cover...

25/09/2026

MeyerPro Deploys ROE Visual Graphite GP 2.6 for Acumatica Summit 2026

MeyerPro delivered audio, video, broadcast, and LED production for the Acumatica Summit 2026 at the Seattle Convention Center's Summit Building, January 25-...

25/09/2026

PWHL to Hold Inaugural All-Star Weekend in Toronto on March 7

The Professional Women's Hockey League has announced its inaugural All-Star Weekend, to be held Saturday, March 7, 2026, at Scotiabank Arena in Toronto. The...

25/09/2026

Presidents Cup Makes Leap to 1080p HDR as NBC Sports, PGA TOUR Step Up Coverage

The 2026 Presidents Cup is underway at Medinah Country Club outside of Chicago with Team USA and an International Team of men's golfers facing off for four ...

25/09/2026

SVG Remote Production Forum Goes Inside WBDs Techwood Facility, Maps the Next Phase of REMI Production

Warner Bros. Discovery's Atlanta hub hosted a day of discussion on REMI prod...

25/09/2026

Antares release AutoTune Advanced

Algorithm update & new DVA vibrato-detection engine A new flagship version of Antares' iconic pitch-correction software has arrived, and along with a co...

25/09/2026

Two notes to launch the Captor X Pro

New flagship unit to arrive in early 2027 Two notes Audio Engineering have revealed that a new and improved version of their hugely popular reactive load bo...

25/09/2026

Finalist 2 from Tim Exile

AI-free mixing tool gets an upgrade Launched in October 2025, Tim Exiles Finalist is an algorithmic mixing tool that's been designed for those who don&#...

25/09/2026

Rohde & Schwarz Mobile Test Summit 2026 puts the spotlight on 6G - registrations open

Rohde & Schwarz Mobile Test Summit 2026 puts the spotlight on 6G - registrations...

25/09/2026

IBC 2026: When Intelligence Became the Industry's New Competitive Advantage

In our latest blog, Tim Pearson reflects on IBC 2026 and considers the main learnings against an industry that saw AI finally coming out of the labs and into pr...

25/09/2026

Digital Anarchy Releases Newest Version of its Real-Time Skin Retouching Tool for Video

Digital Anarchy Releases Newest Version of its Real-Time Skin Retouching Tool fo...

25/09/2026

Blackmagic Design Used on More Than 50 Summer Films in 2026

Blackmagic Design Used on More Than 50 Summer Films in 2026 Brie Clayton September 25, 2026 0 Comments Hero image: Disclosure Day Blackmagic Design p...

25/09/2026

How I Automated Social Media Resizing in After Effects - Free Script

How I Automated Social Media Resizing in After Effects - Free Script Graham Quince September 25, 2026 0 Comments If your text keeps getting cut off on...

25/09/2026

IBC2026 celebrates collaborative breakthroughs as it anno...

IBC has unveiled the winners of the prestigious IBC2026 Innovation Awards at an event held at the RAI Amsterdam on Sunday 13 September, honouring collaborative ...

25/09/2026

IBC2026 brings global media industry together to turn inn...

IBC2026 brought the global media, entertainment and technology community together for four days of business, innovation and collaboration at the RAI Amsterdam. ...

25/09/2026

Lightware Helps Integrators Overcome MacBook Neo USB Topo...

Lightware testing has revealed that each USB-C port on Apple's new MacBook Neo consumes three of the seven USB tiers available under the USB specification, ...

25/09/2026

Lightware Expands Education Support With New Products and...

Lightware is supporting educational institutions in building modern learning environments by combining professional training with education-focused AV technolog...

25/09/2026

Study: Only 10% of Young Adults Watched Local TV News Last Week

Share Copy link Facebook X Linkedin Bluesky Email...

25/09/2026

Optimum, A+E Global Media Sign New Distribution Agreement

Share Copy link Facebook X Linkedin Bluesky Email...

25/09/2026

MPA, Unions Back 'Motion Picture, Television, and Entertainment Revitalization Act

Share Copy link Facebook X Linkedin Bluesky Email...

25/09/2026

NAB Show New York Announces More Speakers and Programming Highlights

Share Copy link Facebook X Linkedin Bluesky Email...

25/09/2026

Comcast NBCU, NBCUniversal Local Award $2.5 Million to Nonprofits

Share Copy link Facebook X Linkedin Bluesky Email...

25/09/2026

Orange Belgium Strengthens Its Consumer and B2B TV Servic...

Long-Standing Customer Renews Multiyear Contract for VO's Secure Video Player, Content Security, and Device Monitoring Solutions Viaccess-Orca (VO), a glob...

25/09/2026

Automate Video Progress Bars in After Effects - No Keyframes!

Automate Video Progress Bars in After Effects - No Keyframes! Graham Quince September 24, 2026 0 Comments Learn how to create an automated video playb...

25/09/2026

How to watch an unmissable weekend of womens football on Sky Sports and NOW

Friday 25 September 2026 How to watch an unmissable weekend of women's football on Sky Sports and NOW Sky Sports and NOW will broadcast seven live games f...

25/09/2026

YAGA trailer released, coming exclusively to Sky and NOW on 31 October in the UK and Ireland

Friday 25 September 2026 YAGA trailer released, coming exclusively to Sky and N...

25/09/2026

'Watch this space: a new strategic direction for UK media'.

Watch this space: a new strategic direction for UK media. Arqiva has submitted its response to the Governments Green Paper on the future of television distribut...

25/09/2026

Last chance to apply to be part of this year's Late Late Toy Show

Want to be part of this year's Late Late Toy Show? Final call for applications in search for this year's stars The most wonderful night of the year is...

24/09/2026

Broadcast Management Group Assists Virginia Public Media With Move to New HQ in Richmond

Broadcast Management Group (BMG) is supporting Virginia Public Media (VPM), the ...

24/09/2026

Two Red Digital Cinema Cameras Receive GhostFrame Pro Certification

RED Digital Cinema's RED V-RAPTOR [X] and RED V-RAPTOR XL [X] cameras with the Phantom Track feature are the first cameras to receive GhostFrame Pro Certifi...