Images

Retrieve background by size

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

Retrieve the JSON description or the binary of the requested background 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

Image size to retrieve.

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

tablet is scaled to fit within a width of 1024px and a height of 768px.

mobile is scaled to fit within a width of 460px and a height of 320px.

thumbnail is scaled to fit within a width of 80px and a height of 50px.

NOTE: Images used for typeform backgrounds are scaled and cropped from a top-left alignment to make sure they fill the screen properly.

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