Entity.GetImage

Summary

Returns the image data for an entity.

Signatures

Web Service Method Signature
Stream GetImage(string apiKey, string site, string slug, int width, int height)
REST Signature
/rest/entity/{slug}/Image?apiKey={apiKey}&site={site}&width={width}&height={height}

Return Value

The image for the entity. When requested via the REST API the image data is returned in the HTTP response stream as a JPEG encoded image. When requested via the web services, a stream is returned from which the image data can be read.

Arguments

apiKey

Your API key. For more information see here.

site

The site the API should be executed against, e.g. www.ditto.net.

slug

The slug for the entity to get the image for.

width (Optional)

The width in pixels to resize the image to.

If this argument is omitted or set to 0, it defaults to 80.

The minimum allowed value is 10 and the maximum is 300.

height (Optional)

The height in pixels to resize the image to.

If this value is omitted, it defaults to the width - if width is omitted, the default width of 80 is used.

The minimum allowed value is 10 and the maximum is 300.

REST Example

http://api.ditto.net/rest/entity/Films_Blade-Runner/Image?apiKey=xxxx&site=www.ditto.net&width=100