Skip to content

Files v3

Operations for uploaded files. Files are ingested via upload and processed asynchronously, e.g. to assign them to products. Each file keeps a log of processing messages.


Endpoints


GET /resource/v3/files

Retrieve a list of files

Description

Retrieve a list of files. The result can be filtered using the query parameters below, which support the resource queries syntax.

Examples:

  • /resource/v3/files?status=on_hold
  • /resource/v3/files?file_name=9783638101417.epub
  • /resource/v3/files?error__contains=ftp
  • /resource/v3/files?q=epub

Input parameters

Query parameters

Parameter Type Default Nullable Description
created integer No Filter by upload timestamp (Unix time). Supports all lookup operators, e.g. '__gt', '__lt', '__gte' (s. [resource queries syntax](../resource_queries)).
error string No Filter by error message. Supports all lookup operators, e.g. '__contains', '__isnull' (s. [resource queries syntax](../resource_queries)).
file_name string No Filter by file name. Supports all lookup operators, e.g. '__contains', '__startswith' (s. [resource queries syntax](../resource_queries)).
mime_type string No Filter by MIME type. Supports all lookup operators, e.g. '__contains', '__startswith' (s. [resource queries syntax](../resource_queries)).
module string No Filter by module. Only the equality operator is supported. The module determines which asset processor will pick up the upload. If not set, the module is autodetected. Possible values are: * `onix` Onix 2.1 or Onix 3.x. * `jats` JATS files. * `bib` Bibtex files. * `asset` all other assets, e.g. PDFs, Epubs or JPGs.
processed boolean No Filter by processing state. Only the equality operator is supported.
product_id integer No Filter by associated product ID. Supports all lookup operators, e.g. '__in', '__gt' (s. [resource queries syntax](../resource_queries)).
q string No General search across multiple file fields. Performs a case-insensitive substring match against the `file_name`, `mime_type`, `status`, `module` and `error` fields, returning files where any of them contains the given term. Lookup operators (e.g. '__contains', '__startswith') are not supported.
status string No Filter by processing status. Only the equality operator is supported. One of: new, on_hold, finished, error, skipped.

Responses

{
    "_links": {},
    "_pagination": {},
    "items": [
        {
            "_id": 1,
            "_uuid": "cf64d52d-497b-4898-930f-8a74afcb479c",
            "_version": "3.0",
            "_links": {},
            "created": 1784279805,
            "error": "Could not assign product",
            "file_name": "9783967890334_epub_OP_korr.epub",
            "file_size": 1752680,
            "href": "https://api.openpublishing.com/rpc/v2/uploads/get/1",
            "labels": [],
            "mime_type": "application/epub+zip",
            "module": "asset",
            "processed": false,
            "products": [],
            "properties": {},
            "realm": {
                "_id": 23,
                "_uuid": "string",
                "_links": {},
                "name": "xyzpublishing",
                "screenname": "XYZ Publishing"
            },
            "sha1": "17c1415da57c11cd2fdbd94edbbd3eeae7fcbc32",
            "status": "on_hold",
            "type": null
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "_links": {
            "type": "object"
        },
        "_pagination": {
            "type": "object"
        },
        "items": {
            "type": "array",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "_id": {
                        "type": "integer",
                        "description": "Unique identifier for the file",
                        "example": 1
                    },
                    "_uuid": {
                        "type": "string",
                        "description": "ID of resource in V4 version of resource",
                        "example": "cf64d52d-497b-4898-930f-8a74afcb479c"
                    },
                    "_version": {
                        "type": "string",
                        "description": "API Version",
                        "example": "3.0"
                    },
                    "_links": {
                        "type": "object",
                        "description": "Related links for the file, including a link to the file's log"
                    },
                    "created": {
                        "type": "integer",
                        "description": "Unix timestamp when the file was uploaded",
                        "example": 1784279805
                    },
                    "error": {
                        "type": "string",
                        "description": "Error message if processing the file failed",
                        "nullable": true,
                        "example": "Could not assign product"
                    },
                    "file_name": {
                        "type": "string",
                        "description": "Original file name of the uploaded file",
                        "example": "9783967890334_epub_OP_korr.epub"
                    },
                    "file_size": {
                        "type": "integer",
                        "description": "Size of the file in bytes",
                        "example": 1752680
                    },
                    "href": {
                        "type": "string",
                        "description": "URL to download the file",
                        "example": "https://api.openpublishing.com/rpc/v2/uploads/get/1"
                    },
                    "labels": {
                        "type": "array",
                        "description": "List of labels assigned to the file",
                        "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "_id": {
                                    "type": "string",
                                    "description": "Unique identifier for the label",
                                    "example": "keyword"
                                },
                                "_version": {
                                    "type": "string",
                                    "description": "API Version",
                                    "example": "3.0"
                                },
                                "_links": {
                                    "type": "object"
                                },
                                "realm": {
                                    "type": "object",
                                    "description": "Reference to realm which owns this object",
                                    "additionalProperties": false,
                                    "properties": {
                                        "_id": {
                                            "type": "integer",
                                            "description": "Realm ID",
                                            "example": 23
                                        },
                                        "_uuid": {
                                            "type": "string",
                                            "description": "ID of resource in V4 version of resource"
                                        },
                                        "_links": {
                                            "type": "object"
                                        },
                                        "name": {
                                            "type": "string",
                                            "description": "Name of the realm",
                                            "example": "xyzpublishing"
                                        },
                                        "screenname": {
                                            "type": "string",
                                            "description": "Screenname of the realm",
                                            "example": "XYZ Publishing"
                                        }
                                    },
                                    "required": [
                                        "_id"
                                    ]
                                },
                                "name": {
                                    "type": "string",
                                    "description": "Name of the label",
                                    "example": "Test label"
                                },
                                "color": {
                                    "type": "string",
                                    "description": "Hex color code without hash",
                                    "nullable": true,
                                    "example": "ff00ff"
                                }
                            },
                            "required": []
                        },
                        "example": []
                    },
                    "mime_type": {
                        "type": "string",
                        "description": "MIME type of the file",
                        "example": "application/epub+zip"
                    },
                    "module": {
                        "type": "string",
                        "description": "Module the file belongs to",
                        "example": "asset"
                    },
                    "processed": {
                        "type": "boolean",
                        "description": "Whether the file has been processed",
                        "example": false
                    },
                    "products": {
                        "type": "array",
                        "description": "List of products the file is associated with",
                        "items": {
                            "type": "object",
                            "description": "Reference to product",
                            "additionalProperties": false,
                            "nullable": true,
                            "properties": {
                                "_id": {
                                    "type": "integer",
                                    "description": "Product ID",
                                    "example": 23
                                },
                                "_uuid": {
                                    "type": "string",
                                    "description": "ID of resource in V4 version of resource"
                                },
                                "_links": {
                                    "type": "object"
                                },
                                "title": {
                                    "type": "string",
                                    "description": "Title of product",
                                    "example": "Alice in Wonderland"
                                },
                                "eans": {
                                    "type": "array",
                                    "description": "List of the EANs of the product"
                                },
                                "cover_url": {
                                    "type": "string",
                                    "description": "URL of cover thumbnail"
                                }
                            },
                            "required": [
                                "_id"
                            ]
                        },
                        "example": []
                    },
                    "properties": {
                        "type": "object",
                        "nullable": true,
                        "description": "Additional properties related to the file. Keys and values are strings.",
                        "additionalProperties": {
                            "type": "string"
                        },
                        "example": {}
                    },
                    "realm": {
                        "type": "object",
                        "description": "Reference to realm which owns this object",
                        "additionalProperties": false,
                        "properties": {
                            "_id": {
                                "type": "integer",
                                "description": "Realm ID",
                                "example": 23
                            },
                            "_uuid": {
                                "type": "string",
                                "description": "ID of resource in V4 version of resource"
                            },
                            "_links": {
                                "type": "object"
                            },
                            "name": {
                                "type": "string",
                                "description": "Name of the realm",
                                "example": "xyzpublishing"
                            },
                            "screenname": {
                                "type": "string",
                                "description": "Screenname of the realm",
                                "example": "XYZ Publishing"
                            }
                        },
                        "required": [
                            "_id"
                        ]
                    },
                    "sha1": {
                        "type": "string",
                        "description": "SHA1 hash of the file for integrity verification",
                        "example": "17c1415da57c11cd2fdbd94edbbd3eeae7fcbc32"
                    },
                    "status": {
                        "type": "string",
                        "description": "Processing status of the file. One of: new, on_hold, finished, error, skipped",
                        "enum": [
                            "new",
                            "on_hold",
                            "finished",
                            "error",
                            "skipped"
                        ],
                        "example": "on_hold"
                    },
                    "type": {
                        "type": "string",
                        "description": "Type of the file",
                        "nullable": true,
                        "example": null
                    }
                },
                "required": [
                    "_id",
                    "file_name",
                    "file_size",
                    "mime_type"
                ]
            }
        }
    },
    "required": [
        "_links",
        "_pagination",
        "items"
    ]
}

POST /resource/v3/files

Upload a file

Description

Upload a new file. Send a multipart/form-data encoded body with the following parameters:

  • file the file itself.
  • type of the file. Arbitrary string to control which importer will import the file, e.g. onix or jats. If not set, the type will be detected automatically.

Request body

{
    "file": "TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQ=",
    "type": "onix"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "object",
    "properties": {
        "file": {
            "type": "string",
            "format": "binary",
            "description": "The file itself."
        },
        "type": {
            "type": "string",
            "description": "Arbitrary string to control which importer will import the file, e.g. `onix` or `jats`. If not set, the type will be detected automatically.",
            "example": "onix"
        }
    },
    "required": [
        "file"
    ]
}

Responses

{
    "_id": 1,
    "_uuid": "cf64d52d-497b-4898-930f-8a74afcb479c",
    "_version": "3.0",
    "_links": {},
    "created": 1784279805,
    "error": "Could not assign product",
    "file_name": "9783967890334_epub_OP_korr.epub",
    "file_size": 1752680,
    "href": "https://api.openpublishing.com/rpc/v2/uploads/get/1",
    "labels": [],
    "mime_type": "application/epub+zip",
    "module": "asset",
    "processed": false,
    "products": [],
    "properties": {},
    "realm": {
        "_id": 23,
        "_uuid": "string",
        "_links": {},
        "name": "xyzpublishing",
        "screenname": "XYZ Publishing"
    },
    "sha1": "17c1415da57c11cd2fdbd94edbbd3eeae7fcbc32",
    "status": "on_hold",
    "type": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "_id": {
            "type": "integer",
            "description": "Unique identifier for the file",
            "example": 1
        },
        "_uuid": {
            "type": "string",
            "description": "ID of resource in V4 version of resource",
            "example": "cf64d52d-497b-4898-930f-8a74afcb479c"
        },
        "_version": {
            "type": "string",
            "description": "API Version",
            "example": "3.0"
        },
        "_links": {
            "type": "object",
            "description": "Related links for the file, including a link to the file's log"
        },
        "created": {
            "type": "integer",
            "description": "Unix timestamp when the file was uploaded",
            "example": 1784279805
        },
        "error": {
            "type": "string",
            "description": "Error message if processing the file failed",
            "nullable": true,
            "example": "Could not assign product"
        },
        "file_name": {
            "type": "string",
            "description": "Original file name of the uploaded file",
            "example": "9783967890334_epub_OP_korr.epub"
        },
        "file_size": {
            "type": "integer",
            "description": "Size of the file in bytes",
            "example": 1752680
        },
        "href": {
            "type": "string",
            "description": "URL to download the file",
            "example": "https://api.openpublishing.com/rpc/v2/uploads/get/1"
        },
        "labels": {
            "type": "array",
            "description": "List of labels assigned to the file",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "_id": {
                        "type": "string",
                        "description": "Unique identifier for the label",
                        "example": "keyword"
                    },
                    "_version": {
                        "type": "string",
                        "description": "API Version",
                        "example": "3.0"
                    },
                    "_links": {
                        "type": "object"
                    },
                    "realm": {
                        "type": "object",
                        "description": "Reference to realm which owns this object",
                        "additionalProperties": false,
                        "properties": {
                            "_id": {
                                "type": "integer",
                                "description": "Realm ID",
                                "example": 23
                            },
                            "_uuid": {
                                "type": "string",
                                "description": "ID of resource in V4 version of resource"
                            },
                            "_links": {
                                "type": "object"
                            },
                            "name": {
                                "type": "string",
                                "description": "Name of the realm",
                                "example": "xyzpublishing"
                            },
                            "screenname": {
                                "type": "string",
                                "description": "Screenname of the realm",
                                "example": "XYZ Publishing"
                            }
                        },
                        "required": [
                            "_id"
                        ]
                    },
                    "name": {
                        "type": "string",
                        "description": "Name of the label",
                        "example": "Test label"
                    },
                    "color": {
                        "type": "string",
                        "description": "Hex color code without hash",
                        "nullable": true,
                        "example": "ff00ff"
                    }
                },
                "required": []
            },
            "example": []
        },
        "mime_type": {
            "type": "string",
            "description": "MIME type of the file",
            "example": "application/epub+zip"
        },
        "module": {
            "type": "string",
            "description": "Module the file belongs to",
            "example": "asset"
        },
        "processed": {
            "type": "boolean",
            "description": "Whether the file has been processed",
            "example": false
        },
        "products": {
            "type": "array",
            "description": "List of products the file is associated with",
            "items": {
                "type": "object",
                "description": "Reference to product",
                "additionalProperties": false,
                "nullable": true,
                "properties": {
                    "_id": {
                        "type": "integer",
                        "description": "Product ID",
                        "example": 23
                    },
                    "_uuid": {
                        "type": "string",
                        "description": "ID of resource in V4 version of resource"
                    },
                    "_links": {
                        "type": "object"
                    },
                    "title": {
                        "type": "string",
                        "description": "Title of product",
                        "example": "Alice in Wonderland"
                    },
                    "eans": {
                        "type": "array",
                        "description": "List of the EANs of the product"
                    },
                    "cover_url": {
                        "type": "string",
                        "description": "URL of cover thumbnail"
                    }
                },
                "required": [
                    "_id"
                ]
            },
            "example": []
        },
        "properties": {
            "type": "object",
            "nullable": true,
            "description": "Additional properties related to the file. Keys and values are strings.",
            "additionalProperties": {
                "type": "string"
            },
            "example": {}
        },
        "realm": {
            "type": "object",
            "description": "Reference to realm which owns this object",
            "additionalProperties": false,
            "properties": {
                "_id": {
                    "type": "integer",
                    "description": "Realm ID",
                    "example": 23
                },
                "_uuid": {
                    "type": "string",
                    "description": "ID of resource in V4 version of resource"
                },
                "_links": {
                    "type": "object"
                },
                "name": {
                    "type": "string",
                    "description": "Name of the realm",
                    "example": "xyzpublishing"
                },
                "screenname": {
                    "type": "string",
                    "description": "Screenname of the realm",
                    "example": "XYZ Publishing"
                }
            },
            "required": [
                "_id"
            ]
        },
        "sha1": {
            "type": "string",
            "description": "SHA1 hash of the file for integrity verification",
            "example": "17c1415da57c11cd2fdbd94edbbd3eeae7fcbc32"
        },
        "status": {
            "type": "string",
            "description": "Processing status of the file. One of: new, on_hold, finished, error, skipped",
            "enum": [
                "new",
                "on_hold",
                "finished",
                "error",
                "skipped"
            ],
            "example": "on_hold"
        },
        "type": {
            "type": "string",
            "description": "Type of the file",
            "nullable": true,
            "example": null
        }
    },
    "required": [
        "_id",
        "file_name",
        "file_size",
        "mime_type"
    ]
}

GET /resource/v3/files/{id}

Retrieve a single file by ID

Input parameters

Path parameters

Parameter Type Default Nullable Description
id string No The unique identifier of the file

Responses

{
    "_id": 1,
    "_uuid": "cf64d52d-497b-4898-930f-8a74afcb479c",
    "_version": "3.0",
    "_links": {},
    "created": 1784279805,
    "error": "Could not assign product",
    "file_name": "9783967890334_epub_OP_korr.epub",
    "file_size": 1752680,
    "href": "https://api.openpublishing.com/rpc/v2/uploads/get/1",
    "labels": [],
    "mime_type": "application/epub+zip",
    "module": "asset",
    "processed": false,
    "products": [],
    "properties": {},
    "realm": {
        "_id": 23,
        "_uuid": "string",
        "_links": {},
        "name": "xyzpublishing",
        "screenname": "XYZ Publishing"
    },
    "sha1": "17c1415da57c11cd2fdbd94edbbd3eeae7fcbc32",
    "status": "on_hold",
    "type": null
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "_id": {
            "type": "integer",
            "description": "Unique identifier for the file",
            "example": 1
        },
        "_uuid": {
            "type": "string",
            "description": "ID of resource in V4 version of resource",
            "example": "cf64d52d-497b-4898-930f-8a74afcb479c"
        },
        "_version": {
            "type": "string",
            "description": "API Version",
            "example": "3.0"
        },
        "_links": {
            "type": "object",
            "description": "Related links for the file, including a link to the file's log"
        },
        "created": {
            "type": "integer",
            "description": "Unix timestamp when the file was uploaded",
            "example": 1784279805
        },
        "error": {
            "type": "string",
            "description": "Error message if processing the file failed",
            "nullable": true,
            "example": "Could not assign product"
        },
        "file_name": {
            "type": "string",
            "description": "Original file name of the uploaded file",
            "example": "9783967890334_epub_OP_korr.epub"
        },
        "file_size": {
            "type": "integer",
            "description": "Size of the file in bytes",
            "example": 1752680
        },
        "href": {
            "type": "string",
            "description": "URL to download the file",
            "example": "https://api.openpublishing.com/rpc/v2/uploads/get/1"
        },
        "labels": {
            "type": "array",
            "description": "List of labels assigned to the file",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "_id": {
                        "type": "string",
                        "description": "Unique identifier for the label",
                        "example": "keyword"
                    },
                    "_version": {
                        "type": "string",
                        "description": "API Version",
                        "example": "3.0"
                    },
                    "_links": {
                        "type": "object"
                    },
                    "realm": {
                        "type": "object",
                        "description": "Reference to realm which owns this object",
                        "additionalProperties": false,
                        "properties": {
                            "_id": {
                                "type": "integer",
                                "description": "Realm ID",
                                "example": 23
                            },
                            "_uuid": {
                                "type": "string",
                                "description": "ID of resource in V4 version of resource"
                            },
                            "_links": {
                                "type": "object"
                            },
                            "name": {
                                "type": "string",
                                "description": "Name of the realm",
                                "example": "xyzpublishing"
                            },
                            "screenname": {
                                "type": "string",
                                "description": "Screenname of the realm",
                                "example": "XYZ Publishing"
                            }
                        },
                        "required": [
                            "_id"
                        ]
                    },
                    "name": {
                        "type": "string",
                        "description": "Name of the label",
                        "example": "Test label"
                    },
                    "color": {
                        "type": "string",
                        "description": "Hex color code without hash",
                        "nullable": true,
                        "example": "ff00ff"
                    }
                },
                "required": []
            },
            "example": []
        },
        "mime_type": {
            "type": "string",
            "description": "MIME type of the file",
            "example": "application/epub+zip"
        },
        "module": {
            "type": "string",
            "description": "Module the file belongs to",
            "example": "asset"
        },
        "processed": {
            "type": "boolean",
            "description": "Whether the file has been processed",
            "example": false
        },
        "products": {
            "type": "array",
            "description": "List of products the file is associated with",
            "items": {
                "type": "object",
                "description": "Reference to product",
                "additionalProperties": false,
                "nullable": true,
                "properties": {
                    "_id": {
                        "type": "integer",
                        "description": "Product ID",
                        "example": 23
                    },
                    "_uuid": {
                        "type": "string",
                        "description": "ID of resource in V4 version of resource"
                    },
                    "_links": {
                        "type": "object"
                    },
                    "title": {
                        "type": "string",
                        "description": "Title of product",
                        "example": "Alice in Wonderland"
                    },
                    "eans": {
                        "type": "array",
                        "description": "List of the EANs of the product"
                    },
                    "cover_url": {
                        "type": "string",
                        "description": "URL of cover thumbnail"
                    }
                },
                "required": [
                    "_id"
                ]
            },
            "example": []
        },
        "properties": {
            "type": "object",
            "nullable": true,
            "description": "Additional properties related to the file. Keys and values are strings.",
            "additionalProperties": {
                "type": "string"
            },
            "example": {}
        },
        "realm": {
            "type": "object",
            "description": "Reference to realm which owns this object",
            "additionalProperties": false,
            "properties": {
                "_id": {
                    "type": "integer",
                    "description": "Realm ID",
                    "example": 23
                },
                "_uuid": {
                    "type": "string",
                    "description": "ID of resource in V4 version of resource"
                },
                "_links": {
                    "type": "object"
                },
                "name": {
                    "type": "string",
                    "description": "Name of the realm",
                    "example": "xyzpublishing"
                },
                "screenname": {
                    "type": "string",
                    "description": "Screenname of the realm",
                    "example": "XYZ Publishing"
                }
            },
            "required": [
                "_id"
            ]
        },
        "sha1": {
            "type": "string",
            "description": "SHA1 hash of the file for integrity verification",
            "example": "17c1415da57c11cd2fdbd94edbbd3eeae7fcbc32"
        },
        "status": {
            "type": "string",
            "description": "Processing status of the file. One of: new, on_hold, finished, error, skipped",
            "enum": [
                "new",
                "on_hold",
                "finished",
                "error",
                "skipped"
            ],
            "example": "on_hold"
        },
        "type": {
            "type": "string",
            "description": "Type of the file",
            "nullable": true,
            "example": null
        }
    },
    "required": [
        "_id",
        "file_name",
        "file_size",
        "mime_type"
    ]
}

{
    "errors": [
        {
            "_id": "string",
            "stack_trace": [
                "string"
            ],
            "message": "string",
            "vars": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "additionalProperties": false,
    "required": [
        "errors"
    ],
    "properties": {
        "errors": {
            "type": "array",
            "description": "List of errors occurred",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "_id",
                    "message",
                    "stack_trace",
                    "vars"
                ],
                "properties": {
                    "_id": {
                        "type": "string",
                        "description": "The identifier of the error"
                    },
                    "stack_trace": {
                        "type": "array",
                        "description": "A stacktrace of the error occurred. Only for testing systems.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "message": {
                        "type": "string",
                        "description": "A translated message of the error"
                    },
                    "vars": {
                        "type": "object",
                        "description": "A dict containing additional values of the context of the error."
                    }
                }
            }
        }
    }
}

DELETE /resource/v3/files/{id}

Delete file by ID

Input parameters

Path parameters

Parameter Type Default Nullable Description
id string No

Responses

{
    "errors": [
        {
            "_id": "string",
            "stack_trace": [
                "string"
            ],
            "message": "string",
            "vars": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "additionalProperties": false,
    "required": [
        "errors"
    ],
    "properties": {
        "errors": {
            "type": "array",
            "description": "List of errors occurred",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "_id",
                    "message",
                    "stack_trace",
                    "vars"
                ],
                "properties": {
                    "_id": {
                        "type": "string",
                        "description": "The identifier of the error"
                    },
                    "stack_trace": {
                        "type": "array",
                        "description": "A stacktrace of the error occurred. Only for testing systems.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "message": {
                        "type": "string",
                        "description": "A translated message of the error"
                    },
                    "vars": {
                        "type": "object",
                        "description": "A dict containing additional values of the context of the error."
                    }
                }
            }
        }
    }
}

GET /resource/v3/files/{file_id}/log

Retrieve the processing log of a file

Description

Retrieve the processing log of a file. The result can be filtered using the query parameters below, which support the resource queries syntax.

Examples:

  • /resource/v3/files/1/log?type=warning
  • /resource/v3/files/1/log?type=error&message__startswith=Cannot%20determine%20EAN

Input parameters

Path parameters

Parameter Type Default Nullable Description
file_id string No The unique identifier of the file

Query parameters

Parameter Type Default Nullable Description
message string No Filter by log message. Supports all lookup operators, e.g. '__contains', '__startswith' (s. [resource queries syntax](../resource_queries)).
type string No Filter by log entry type. Supports all lookup operators, e.g. '__contains', '__startswith' (s. [resource queries syntax](../resource_queries)).

Responses

{
    "_links": {},
    "_pagination": {},
    "items": [
        {
            "_id": 1,
            "created": 1784280720,
            "message": "Cannot determine EAN from filename.",
            "type": "error"
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "_links": {
            "type": "object"
        },
        "_pagination": {
            "type": "object"
        },
        "items": {
            "type": "array",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "description": "A single log entry of a file",
                "properties": {
                    "_id": {
                        "type": "integer",
                        "description": "Unique identifier for the log entry",
                        "example": 1
                    },
                    "created": {
                        "type": "integer",
                        "description": "Unix timestamp when the log entry was created",
                        "example": 1784280720
                    },
                    "message": {
                        "type": "string",
                        "description": "Log message",
                        "example": "Cannot determine EAN from filename."
                    },
                    "type": {
                        "type": "string",
                        "description": "Type of the log entry, e.g. error, warning, info",
                        "example": "error"
                    }
                },
                "required": [
                    "_id",
                    "message",
                    "type"
                ]
            }
        }
    },
    "required": [
        "_links",
        "_pagination",
        "items"
    ]
}

{
    "errors": [
        {
            "_id": "string",
            "stack_trace": [
                "string"
            ],
            "message": "string",
            "vars": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "additionalProperties": false,
    "required": [
        "errors"
    ],
    "properties": {
        "errors": {
            "type": "array",
            "description": "List of errors occurred",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "_id",
                    "message",
                    "stack_trace",
                    "vars"
                ],
                "properties": {
                    "_id": {
                        "type": "string",
                        "description": "The identifier of the error"
                    },
                    "stack_trace": {
                        "type": "array",
                        "description": "A stacktrace of the error occurred. Only for testing systems.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "message": {
                        "type": "string",
                        "description": "A translated message of the error"
                    },
                    "vars": {
                        "type": "object",
                        "description": "A dict containing additional values of the context of the error."
                    }
                }
            }
        }
    }
}

Schemas

File

Name Type Description Example
_id integer

Unique identifier for the file

1
_links object

Related links for the file, including a link to the file's log

_uuid string

ID of resource in V4 version of resource

cf64d52d-497b-4898-930f-8a74afcb479c
_version string

API Version

3.0
created integer

Unix timestamp when the file was uploaded

1784279805
error string| null

Error message if processing the file failed

Could not assign product
file_name string

Original file name of the uploaded file

9783967890334_epub_OP_korr.epub
file_size integer

Size of the file in bytes

1752680
href string

URL to download the file

https://api.openpublishing.com/rpc/v2/uploads/get/1
labels Array<Properties: _id, _version, _links, realm, name, color>

List of labels assigned to the file

[]
labels[]._id string

Unique identifier for the label

keyword
labels[]._version string

API Version

3.0
labels[]._links object
labels[].realm Properties: _id, _uuid, _links, name, screenname

Reference to realm which owns this object

labels[].realm._id integer

Realm ID

23
labels[].realm._uuid string

ID of resource in V4 version of resource

labels[].realm._links object
labels[].realm.name string

Name of the realm

xyzpublishing
labels[].realm.screenname string

Screenname of the realm

XYZ Publishing
labels[].name string

Name of the label

Test label
labels[].color string| null

Hex color code without hash

ff00ff
mime_type string

MIME type of the file

application/epub+zip
module string

Module the file belongs to

asset
processed boolean

Whether the file has been processed

false
products Array<Properties: _id, _uuid, _links, title, eans, cover_url| null>

List of products the file is associated with

[]
products[]._id integer

Product ID

23
products[]._uuid string

ID of resource in V4 version of resource

products[]._links object
products[].title string

Title of product

Alice in Wonderland
products[].eans Array<>

List of the EANs of the product

products[].cover_url string

URL of cover thumbnail

properties object| null

Additional properties related to the file. Keys and values are strings.

{}
realm Properties: _id, _uuid, _links, name, screenname

Reference to realm which owns this object

realm._id integer

Realm ID

23
realm._uuid string

ID of resource in V4 version of resource

realm._links object
realm.name string

Name of the realm

xyzpublishing
realm.screenname string

Screenname of the realm

XYZ Publishing
sha1 string

SHA1 hash of the file for integrity verification

17c1415da57c11cd2fdbd94edbbd3eeae7fcbc32
status string

Processing status of the file. One of: new, on_hold, finished, error, skipped

on_hold
type string| null

Type of the file

File Log Entry

Name Type Description Example
_id integer

Unique identifier for the log entry

1
created integer

Unix timestamp when the log entry was created

1784280720
message string

Log message

Cannot determine EAN from filename.
type string

Type of the log entry, e.g. error, warning, info

error