Skip to content

Files

POST /api/file/temp

Upload a file to temporary storage. The returned tempFileName can be referenced when creating an entity via POST /api/entity.

Request

multipart/form-data with a single file field.

Response

{
"tempFileName": string // reference key for the temporary file
}

POST /api/file

Upload a file and attach it to an entity.

Request

application/x-www-form-urlencoded (multipart form)

  • SubjectClass Entity class the file belongs to
  • SubjectID Entity ID the file belongs to
  • Type File type (e.g. AttachedFile)
  • File The file to upload

Response

A JSON object describing the created file entity.

GET /api/file/{id}

Request

Path parameters

  • id File ID

Response

The file content with appropriate Content-Type and Content-Disposition headers.

GET /api/file/public/{id}

Anonymous. Download a file that has been marked as publicly accessible.

Request

Path parameters

  • id File ID

GET /api/file/{id}/meta

Request

Path parameters

  • id File ID

Response

A JSON object with file metadata:

{
"id": string,
"name": string,
"mediaType": string,
"size": number,
"subjectClass": string,
"subjectID": string,
"type": string,
"createdBy": string,
"createdUtc": string
}

GET /api/file/{eClass}/{id}

Get all files attached to an entity.

Request

Path parameters

  • eClass Entity class
  • id Entity ID

Response

A JSON array of file metadata objects.

DELETE /api/file/{id}

Request

Path parameters

  • id File ID

Body

An audit event object with at least a report key:

{
"report": string, // reason for deletion (required)
"content": string // optional additional content
}