Product Files Resource
The product files resource provides an endpoint for product asset data upload, retrieval and removal.
URL:
https://api.openpublishing.com/resource/v3/products/[ID]/files
https://api.openpublishing.com/resource/v3/products/[ID]/files/[ID]
Supported methods:
POST
to products/[ID]/files
URL for adding product files in a multipart/form encoded body with the following parameters:
file
the file itselftype
of the file that is being imported, following values are supported:pod_bookblock
: Print-On-Demand book blockebook_pdf
: eBook in PDF formatebook_pdf_cover
: cover for eBook in PDF formatebook_pdf_bastard_title
: bastard title for eBook in PDF formatebook_epub
: eBook in EPUB formatebook_mobi
: eBook in Mobi formatebook_ibook
: eBook in iBook formatcover_marketing
: marketing coverpod_cover_front
: Print-On-Demand front coverpod_cover_back
: Print-On-Demand back coverpod_cover
: Print-On-Demand coverdropbox
: Dropbox fileextract
: extractscreenshot
: screenshotshop_preview
: shop previewaudiobook
: audio booksoftware
: software
labels
distribution tags, should start withdistribution:
prefix.
GET
to products/[ID]/files
for retrieving information about all product files.
Supported query parameters:
- type
: type of file
- labels
: labels to lookup
- mime_type
: MIME type of the file
- file_name
: document file name
- property_epub_version
: EPUB version (e.g. 2 or 3)
GET
to products/[ID]/files/[ID]
for retrieving information about a specific product asset.
DELETE
to products/[ID]/files/[ID]
to delete a product asset.
Example JSON
{
"_id": 2,
"file_name": "example_file_name.epub",
"file_size": 1752680,
"href": "https:\/\/api.openpublishing.com\/rpc\/document_admin_upload?method=download&file_id=2",
"labels": [],
"mime_type": "application/epub+zip",
"properties": {
"epub_version": "3"
},
"sha1": "17c1415da57c11cd2fdbd94edbbd3eeae7fcbc32",
"timestamp": 1656057222,
"type": "ebook_epub",
"validation": null
}