> ## Documentation Index > Fetch the complete documentation index at: https://www.bloxs.io/llms.txt > Use this file to discover all available pages before exploring further. # Add file to a service ticket > Uploads a file and links it to the service ticket. ## OpenAPI ````json POST /api/v1/maintenance/servicetickets/files { "openapi": "3.0.4", "info": { "title": "Maintenance V1", "description": "# Maintenance API Documentation\nWelcome to BETA version of the new Maintenance API - intended for client public testing before the launch of the final version. During this BETA phase, we'll be improving the API based on specific client's feedbacks.\n\n## Authentication \n\nTo access the API, include your API key in the headers. Refer to our authentication documentation for details on obtaining and using your API key. \n\n## Operations \n\nThe API supports operations for the following: \n\n- **Service Tickets**\n\nFor each type, you can: \n\n- **GET**: Retrieve a list or apply filters.", "version": "v1" }, "security": [ {} ], "tags": [ { "name": "Metadata" }, { "name": "ServiceTickets" } ], "paths": { "/api/v1/maintenance/servicetickets/files": { "post": { "tags": [ "ServiceTickets" ], "summary": "Add file to a service ticket", "description": "Uploads a file and links it to the service ticket.", "operationId": "AddFileToServiceTicket", "parameters": [ { "name": "reference", "in": "query", "description": "The internal identifier of the model (i.e. Reference, Code, Name, depends on model).", "schema": { "type": "string" } }, { "name": "externalIdentifier", "in": "query", "description": "The external API identifier of the model.", "schema": { "type": "string" } } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "type": "object", "properties": { "File": { "type": "string", "format": "binary" } } }, "encoding": { "File": { "style": "form" } } }, "application/json": { "schema": { "type": "object", "properties": { "File": { "type": "string", "format": "binary" } } }, "encoding": { "File": { "style": "form" } } } } }, "responses": { "200": { "description": "The file was created" }, "400": { "description": "No file was uploaded" }, "404": { "description": "There was a problem attaching the file to the service ticket", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/APIErrorMessageModel" } } } } }, "x-d360-narrative-url": "

Add file to a service ticket

This endpoint uploads a file and links it to an existing service ticket, for example a photo or supporting document related to the reported issue.

Each file must be uploaded in a separate request.

The ticket is identified by its internal reference, its external identifier, or both.


Request Fields

Field

Type

Required

Description

reference

string

Conditional

Internal identifier of the service ticket to attach the file to, passed as a query parameter. Either reference or externalIdentifier must be provided. If both are given, the ticket must match both values.

externalIdentifier

string

Conditional

External identifier of the service ticket to attach the file to, passed as a query parameter. Either reference or externalIdentifier must be provided. If both are given, the ticket must match both values.

File

string (binary)

Yes

The file to upload, sent as multipart/form-data (or as application/json with the same field name). This is the only field in the request body; reference and externalIdentifier are query parameters, not part of the body.


Response Fields

Field

Type

Required

Description

(response body)

integer (int64)

Yes

The response body is a single integer, the internal identifier generated by Bloxs for the uploaded file, not a JSON object with named fields.

" } } }, "components": { "schemas": { "APIErrorMessageModel": { "type": "object", "properties": { "type": { "type": "string", "nullable": true }, "title": { "type": "string", "nullable": true }, "traceId": { "type": "string", "nullable": true }, "status": { "type": "integer", "format": "int32" }, "errors": { "type": "object", "additionalProperties": { "type": "array", "items": { "type": "string" }, "nullable": true }, "nullable": true } }, "additionalProperties": false } } } } ````