Images

Retrieve image by size

get
https://api.typeform.com/images/{image_id}/image/{size}

Retrieve the JSON description or the binary of the requested image.

Use the Accept header to specify the response format. If you use application/json, the JSON representation of the resource will be returned. Otherwise, the image as a binary will be returned (if the MIME type matches with the stored image).

Request

Path Parameters

image_id
string, required

Unique ID for the image to retrieve.

size
string, required
Valid values:defaultmobilethumbnail

Image size to retrieve.

default is scaled to a width of 800px.

mobile is scaled to a width of 460px.

thumbnail is scaled so that the smallest image side equals the largest of either 80px wide or 50px in height and then cropped.

Response

Status

200 OK

Schema

Image resource with associated metadata.

id
string

Unique ID for the image.

src
string

URL for the image.

file_name
string

File name for the image (specified when image is created).

width
integer

Width of the image in pixels.

height
integer

Height of the image in pixels.

media_type
string
Valid values:image/gifimage/jpegimage/png

The MIME type of the image.

has_alpha
boolean

True if image has alpha channel (some degree of transparency). Otherwise, false.

avg_color
string

Average color of the image in hexadecimal format.

Example

{
  "id": "XcXx",
  "src": "https://api.typeform.com/images/{image_id}/background/{size}",
  "file_name": "newimage.gif",
  "width": 100,
  "height": 100,
  "media_type": "image/gif",
  "has_alpha": true,
  "avg_color": "ff00ff"
}