v1

latestOpenAPI 3.0.0Open Government Licence v3.02026-07-239817.3 KB
image

post/images/{image_id}/downloads

Path parameters

image_idstring required

A unique id for an image metadata entry

Request body

idstring required

the variant

heightinteger

Image height, in number of pixels

palettestring

Colour palette of the variant

typestring

Type of download corresponding to this variant

widthinteger

Image width, in number of pixels

state'pending' | 'importing' required

The state of this download variant. On creation the only allowed states are pending or importing.

import_startedstring required

Timestamp representation for the importing process start, formatted according to RFC3339

Example request

{
  "id": "original",
  "height": 1080,
  "palette": "bw",
  "type": "png",
  "width": 1920,
  "state": "importing",
  "import_started": "2020-04-26T08:05:52Z"
}

Response

Successfully created download variant.

idstring required

the variant

heightinteger

Image height, in number of pixels

hrefstring

Full URL pointing to the image in download service

palettestring

Colour palette of the variant

privatestring

S3 Private bucket name

publicboolean

Determines if this image variant is public (i.e. it can be accessed under static.ons.gov.uk)

sizeinteger

File size in number of bytes

typestring

Type of download corresponding to this variant

widthinteger

Image width, in number of pixels

state'pending' | 'importing' | 'imported' | 'published' | 'completed' | 'failed-import' | 'failed-publish' required

The state of this download variant. The high level image will change its state to imported only when all variants are in imported state.

errorstring

Any error information, if there was an error with this image variant

import_startedstring required

Timestamp representation for the importing process start, formatted according to RFC3339

import_completedstring

Timestamp representation for the importing process completion, formatted according to RFC3339

publish_startedstring

Timestamp representation for the publishing process start, formatted according to RFC3339

publish_completedstring

Timestamp representation for the publishing process completion, formatted according to RFC3339

Example response

{
  "id": "original",
  "height": 1080,
  "href": "http://download.ons.gov.uk/images/042e216a-7822-4fa0-a3d6-e3f5248ffc35/image-name.png",
  "palette": "bw",
  "private": "my-private-bucket",
  "public": true,
  "size": 1024000,
  "type": "png",
  "width": 1920,
  "links": {
    "self": "http://localhost:10000/images/042e216a-7822-4fa0-a3d6-e3f5248ffc35/downloads/original",
    "image": "http://localhost:10000/images/042e216a-7822-4fa0-a3d6-e3f5248ffc35"
  },
  "state": "published",
  "error": "import process failed",
  "import_started": "2020-04-26T08:05:52Z",
  "import_completed": "2020-04-26T08:07:32+00:00",
  "publish_started": "2020-04-26T09:51:03-00:00",
  "publish_completed": "2020-04-26T10:01:28Z"
}