Skip to main content

Files

The Digital Product Passport Files API allows you to manage the lifecycle of DPP Files, including creating, viewing, updating, and deleting DPP Files.

A DPP files allows you to upload file, with name and description, to the DPP object.

Upload DPP Files

1. Create DPP File

POST /models/:modelId/dpps/:dppId/upload-file

Request Body

{
"dpp_type": "uuid",
"model_id": "uuid",
"template_id": "uuid",
"code": "string",
"version": "string",
"name": "string",
"description": "string",
"company_id": "uuid"
}

Response

StatusDescription
200 OKFile uploaded successfully and the corresponding record created.
400 Bad RequestNo file provided or error parsing request body.
500 Internal Server ErrorFailed to upload the file or unexpected error occurred during creation.

Response Object

{
"message": "DPP created successfully",
"ok": true,
"dpp": {
"id": "uuid",
"template_id": "uuid",
"code": "string",
"created_at": "string",
"updated_at": "string",
"name": "string",
"description": "string",
"company_id": "uuid",
"model_id": "uuid",
"type": "string",
"search_id": "string",
"images": [
{
"id": "uuid",
"created_at": "string",
"model_id": "uuid",
"template_id": "uuid",
"image": "string",
"type": "string",
"uuid": "uuid"
}
]
}
}

2. view DPP Files

GET /view-dpp-files/:dppId

Response

StatusDescription
200 OKSuccessfully retrieved the list of DPP files with their signed URLs.
500 Internal Server ErrorFailed to fetch the DPP files or generate their signed URLs.

Response Object

{
{
"message": "DPP created successfully",
"ok": true,
"dpp": {
"id": "string",
"template_id": "string",
"code": "string",
"created_at": "string",
"updated_at": "string",
"name": "string",
"description": "string",
"company_id": "string",
"model_id": "string",
"type": "string",
"search_id": "string",
"images": [
{
"id": "string",
"created_at": "string",
"model_id": "string",
"template_id": "string",
"image": "string",
"type": "string",
"uuid": "string"
}
]
}
}
}

3. view DPP File

GET /models/:modelId/view-dpp-file/:dppId/file/:fileId

Response

StatusDescription
200 OKSuccessfully retrieved the DPP file with its signed URL
406 Not AcceptableThe specified DPP file was not found.
500 Internal Server ErrorFailed to fetch the DPP file or generate its signed URL.

Response Object

{
{
"message": "DPP created successfully",
"ok": true,
"dpp": {
"id": "string",
"template_id": "string",
"code": "string",
"created_at": "string",
"updated_at": "string",
"name": "string",
"description": "string",
"company_id": "string",
"model_id": "string",
"type": "string",
"search_id": "string",
"images": [
{
"id": "string",
"created_at": "string",
"model_id": "string",
"template_id": "string",
"image": "string",
"type": "string",
"uuid": "string"
}
]
}
}
}

4. Update DPP Files

PUT /models/:modelId/update-dpp-file/:dppId/file/:fileId

Request Body

{
"dpp_type": "string",
"model_id": "string",
"code": "string",
"version": "string",
"name": "string",
"description": "string",
"company_id": "string",
"user_id": "string"
}

Response

StatusDescription
200 OKFile updated successfully with new information and signed URL.
400 Bad RequestError parsing request body or missing required fields.
406 Not AcceptableThe specified file or DPP was not found.
500 Internal Server ErrorFailed to update the file or unexpected error occurred during the update.

Response Object

{
{
"message": "DPP updatet successfully",
"ok": true,
"dpp": {
"id": "string",
"template_id": "string",
"code": "string",
"created_at": "string",
"updated_at": "string",
"name": "string",
"description": "string",
"company_id": "string",
"model_id": "string",
"type": "string",
"search_id": "string",
}
}
}

5. Delete DPP Files

DELETE /models/:modelId/delete-dpp-file/:dppId/file/:fileId

Response

StatusDescription
200 OKFile deleted successfully from the database and storage.
406 Not AcceptableThe specified file or DPP was not found.
500 Internal Server ErrorFailed to delete the file or unexpected error occurred during the deletion.

Request Body

{
"dpp_type": "string",
"model_id": "string",
"code": "string",
"version": "string",
"name": "string",
"description": "string",
"company_id": "string",
"user_id": "string"
}

Response Object

{
{
"message": "DPP created successfully",
"ok": true,
"dpp": {
"id": "string",
"template_id": "string",
"code": "string",
"created_at": "string",
"updated_at": "string",
"name": "string",
"description": "string",
"company_id": "string",
"model_id": "string",
"type": "string",
"search_id": "string",
"images": [
{
"id": "string",
"created_at": "string",
"model_id": "string",
"template_id": "string",
"image": "string",
"type": "string",
"uuid": "string"
}
]
}
}
}