Getty Images API SDK - .NET
C#
Clone or download
Latest commit 17b1016 Jun 18, 2018
Permalink
Failed to load latest commit information.
GettyImages.Api
UnitTests
.gitignore Convert to .NET Standard Feb 9, 2018
.travis.yml Update dotnet version May 24, 2018
GettyImages.Api.sln Convert to .NET Standard Feb 9, 2018
LICENSE Initial commit of SDK files Oct 1, 2014
README.md Add help and support information Apr 13, 2018
nuget-add-ref.png
package-icon.jpg Update package info Feb 23, 2018

README.md

Getty Images API SDK - .NET

build status NuGet version NuGet Open Hub

Introduction

This SDK makes using the Getty Images API easy. It handles credential management, makes HTTP requests and is written with a fluent style in mind. For more info about the API, see the Documentation.

  • Functionality for all endpoints.

Help & Support

Getting started

Using the Nuget Package

The SDK is published to the public Nuget package repository.

Open the package manager and add the package to your project: Add nuget package reference

Examples

The SDK supports async operations.

var client = ApiClient.GetApiClientWithClientCredentials("my_api_key", "my_api_secret");
var searchResult = await client.SearchImagesEditorial()
    .WithEditorialSegment(EditorialSegment.News)
    .WithPhrase("all vocabulary")
    .WithSortOrder(SortOrder.Newest)
    .ExecuteAsync();

foreach (var image in searchResult.images)
{
    Console.WriteLine("Title: {0} \r\nId: {1}", image.title, image.id);
}

The SDK can also be used synchonously, such as when running in a console application:

var client = ApiClient.GetApiClientWithClientCredentials("my_api_key", "my_api_secret");
var searchResult = client.SearchImagesEditorial()
    .WithEditorialSegment(EditorialSegment.News)
    .WithPhrase("all vocabulary")
    .WithSortOrder(SortOrder.Newest)
    .ExecuteAsync()
    .Result;

foreach (var image in searchResult.images)
{
    Console.WriteLine("Title: {0} \r\nId: {1}", image.title, image.id);
}

Results are returned as dynamic. Visit the API Interactive Documentation to learn more about available parameters and to see what the response object look like.

Building From Source Code

This is only necessary if you would like to contribute to the project. Otherwise, use the Nuget Package

Assumptions

Clone the repository

Open a console window (Command Prompt, PowerShell or Bash) and issue the following commands to clone the Git repository:

git clone git@github.com:gettyimages/gettyimages-api_dotnet.git
cd gettyimages-api_dotnet

Build

dotnet restore
dotnet build
dotnet test UnitTests/