Table of Contents

API : File Get

Introduction

This request will return a single file.

Request

URL https://api.telecomx.dk/file/ID
Method GET
Access level VIEWER and up, subject to the file's accessLevel: ALL = everyone, EMPLOYEE = only the uploader, CUSTOMER = same customer or its parent reseller, RESELLER = the file's customer or its resellers. RESELLER_ADMIN and up always have access.
Param ID Id of the file (24 hex-char string)

Query examples

https://api.telecomx.dk/file/1234567890ABCDEF12345678

Response

File object (JSON)
_id ObjectID Id
filename String Filename
fileId ObjectID Id used to reference to file on file server
size Integer Size of the file in bytes
filetype String Filetype: png, jpg, gif, xls, xlsx, doc, docx, pdf, ppt, pptx, txt, csv
folder ObjectId Reference to the folder which contains this file
employee ObjectID Id of employee who added the file
customer ObjectID Id of the customer the file was added to
type String Type of file: PORTING, INTERNET, AUDIO, IMAGE, DOC, FOLDER, OTHER
width Integer If image, then this is the width in pixels
height Integer If image, then this is the height in pixels
description String Optional description for the file, e.g. 'Porting of 81808888'
date ISODate Date and time when the file was added
lastUpdated ISODate Date and time when the file was last updated/edited
accessLevel Enum Determines who can access the file. “ALL”, “CUSTOMER”, “EMPLOYEE”, “RESELLER”
url String URL to access the file from, if the file is stored on type DOC, IMAGE or AUDIO. Remember to add ?token=<token> if file is protected.

Note that properties holding no value may be omitted from the object.

For files belonging to another customer: ALL-level files have customer and employee removed, and RESELLER-level files have employee removed.

Example - normal

{
  "_id": "650000000000000000000801",
  "filename": "manual.pdf",
  "size": 12207,
  "filetype": "pdf",
  "fileId": "650000000000000000000901",
  "employee": "650000000000000000000a01",
  "customer": "650000000000000000000101",
  "type": "DOC",
  "date": "2025-03-22T14:40:46.286Z",
  "lastUpdated": "2025-04-22T16:40:46.286Z",
  "accessLevel": "CUSTOMER",
  "url": "https://doc.telecomx.dk/650000000000000000000901/manual.pdf"
}

Errors

Error code Message Description
422 id File id is invalid
404 id Not found
403 access_denied Insufficient access level
500 internal_error <Unspecified>