Table of Contents

API : File List

Introduction

This request will return the list of files on a customer.

Request

URL https://api.telecomx.dk/file
Method GET
Access level VIEWER and up. Listing another customer requires read access to that customer.
Query offset [optional] Index of the first file to return, default 0.
limit [optional] The number of file to return, default 100, min 1, max 500.
folder [optional] Folder ObjectID. This can be used to only list files and folders inside the given folder.
filter [optional] To filter the file, this can be used. Filename field of the documents will be searched.
allFolders [optional] Lists files no matter which folder they are in. Ignores “folder” query parameter.
customer [optional] Id of the customer to list files for. Defaults to the caller's own customer. Requires read access to that customer.
type [optional] Only return files of this type (folders are always included): PORTING, INTERNET, AUDIO, IMAGE, DOC, FOLDER or OTHER. Case-insensitive; unknown values are ignored.
filetype [optional] Only return files with this file type (e.g. pdf, mp3), plus folders.

Query examples

https://api.telecomx.dk/file
https://api.telecomx.dk/file?filter=abc&offset=10&limit=25

Response

JSON object
offset Index of the first file returned.
limit Number of files to return. Note that the actual number of files returned may be lower.
total Number of files that can be returned when offset and limit is not considered. This is to be used for paging through the data.
files Array of files, see definition below
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 for accessing the file. Authentication must be added manually.
customerName String Name of the customer the file belongs to.

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 from the parent reseller have employee removed. Documents marked sensitive are only visible to admins.

Example - normal

{
  "offset": 0,
  "limit": 50,
  "total": 2,
  "files": [
    {
      "_id": "650000000000000000000801",
      "filename": "manual",
      "size": 12207,
      "filetype": "pdf",
      "fileId": "650000000000000000000901",
      "employee": "650000000000000000000a01",
      "customer": "650000000000000000000101",
      "customerName": "Example Company",
      "type": "DOC",
      "date": "2025-03-22T14:40:46.286Z",
      "lastUpdated": "2025-04-22T16:40:46.286Z",
      "accessLevel": "CUSTOMER",
      "url": "https://doc.telecomx.dk/650000000000000000000901.pdf"
    },
    {
      "_id": "650000000000000000000802",
      "filename": "Quarterly reports",
      "type": "FOLDER",
      "employee": "650000000000000000000a01",
      "customer": "650000000000000000000101",
      "customerName": "Example Company",
      "accessLevel": "CUSTOMER",
      "date": "2025-03-22T10:20:09.019Z",
      "lastUpdated": "2025-04-22T16:40:46.286Z"
    }
  ]
}

Errors

Error code Message Description
404 customer Customer not found
403 access_denied Insufficient access level
500 internal_error <Unspecified>