Images

Retrieve choice image by size

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

Retrieve the JSON description or the binary of the requested choice format.

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

Request

Path Parameters

image_id
string, required

Unique ID for the image to retrieve.

size
string, required
Valid values:defaultthumbnailsupersizesupermobilesupersizefitsupermobilefit

Image size to retrieve.

default is scaled to fit within a width of 230px and a height of 230px.

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

supersize is scaled so that the smallest image side equals the largest of either 310px wide or 233px in height and then cropped.

supermobile is scaled so that the smallest image side equals the largest of either 238px wide or 164px in height and then cropped.

supersizefit is scaled to fit within a width of 310px and a height of 233px.

supermobilefit is scaled to fit within a width of 238px and a height of 164px.

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"
}