Skip to content

Get Bulk Piece Media

GET
/media

Returns media (envelope images, content scans) for multiple pieces in a single request.

Send your API key in the x-api-key header. See Authentication.

piece_id
required
string

Comma-separated list of piece IDs to retrieve media for. Required. String of comma-separated integers.

Success

object
total

Total number of items across all pages.

integer
15
per_page

Number of items per page.

integer
100
current_page

The current page number (1-based).

integer
1
last_page

The last available page number.

integer
1
from

The index of the first item on this page (1-based).

integer
1
to

The index of the last item on this page (1-based).

integer
15
data
Array
object
id
string
1_1_2_0_0
url
string
content_type
string
image/jpg
tags
Array<string>
[
"color",
"large",
"enclosure",
"front"
]
url_valid_until
string format: date-time
file_size_in_bytes
integer
piece_id
integer | null
14460059
scan_id
integer | null
page_count
integer | null
1
sequence_number
integer | null
Example
{
"current_page": 1,
"data": [
{
"content_type": "image/jpg",
"id": "1_1_2_0_0",
"tags": [
"color",
"large",
"enclosure",
"front"
],
"url": "https://media.earthclassmail.com/...",
"url_valid_until": "2019-05-03T15:38:35Z",
"page_count": 1,
"piece_id": 14460059
},
{
"content_type": "image/jpg",
"id": "1_1_2_0_3",
"tags": [
"color",
"medium",
"enclosure",
"front"
],
"url": "https://media.earthclassmail.com/...",
"url_valid_until": "2019-05-03T15:38:35Z",
"page_count": 1,
"piece_id": 14460059
},
{
"content_type": "image/jpg",
"id": "1_1_2_0_5",
"tags": [
"color",
"small",
"enclosure",
"front"
],
"url": "https://media.earthclassmail.com/...",
"url_valid_until": "2019-05-03T15:38:35Z",
"page_count": 1,
"piece_id": 14460059
},
{
"content_type": "image/png",
"id": "1_1_3_0_0",
"tags": [
"bitonal",
"large",
"enclosure",
"front"
],
"url": "https://media.earthclassmail.com/...",
"url_valid_until": "2019-05-03T15:38:35Z",
"page_count": 1,
"piece_id": 14460059
}
],
"from": 1,
"last_page": 1,
"per_page": 100,
"to": 4,
"total": 4
}

The x-api-key header is missing or the key is not valid, or the caller can’t access an ID in the request. IDs that don’t exist return the same response as IDs the caller can’t access.

Error envelope returned with 4xx and 5xx responses.

object
error
object
code

Usually the HTTP status code. It can differ; a request to an unknown path returns HTTP 400 with code 500.

integer
401
message

Human-readable description of the error.

string
type

The kind of error, for example Authorization or REST.

string
REST
fields

Returned only with 422 responses. It may give more details about what failed validation, as lists of messages keyed by the name of the input.

object
key
additional properties
Array<string>
Examples
{
"error": {
"code": 401,
"message": "The request does not include a valid access token. Please provide a valid access token.",
"type": "Authorization"
}
}