Add a route to get the item preview

This is the first available preview of an attachment wrt position. If
all attachments have a preview image, the preview of the first
attachment is returned.
This commit is contained in:
Eike Kettner
2020-11-08 14:22:33 +01:00
parent 8cc89fd3b7
commit 757ad31165
5 changed files with 123 additions and 0 deletions

View File

@ -1847,6 +1847,47 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/ItemProposals"
/sec/item/{id}/preview:
head:
tags: [ Attachment ]
summary: Get a preview image of an attachment file.
description: |
Checks if an image file showing a preview of the item is
available. If not available, a 404 is returned. The preview is
currently the an image of the first page of the first
attachment.
security:
- authTokenHeader: []
parameters:
- $ref: "#/components/parameters/id"
responses:
200:
description: Ok
404:
description: NotFound
get:
tags: [ Attachment ]
summary: Get a preview image of an attachment file.
description: |
Gets a image file showing a preview of the item. Usually it is
a small image of the first page of the first attachment. If
not available, a 404 is returned. However, if the query
parameter `withFallback` is `true`, a fallback preview image
is returned. You can also use the `HEAD` method to check for
existence.
security:
- authTokenHeader: []
parameters:
- $ref: "#/components/parameters/id"
- $ref: "#/components/parameters/withFallback"
responses:
200:
description: Ok
content:
application/octet-stream:
schema:
type: string
format: binary
/sec/item/{itemId}/reprocess:
post: