api:file:list
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 | Minimum VIEWER | |
| 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. |
|
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. |
Note that properties holding no value may be omitted from the object.
Example - normal
{ "offset": 0, "limit": 50, "total": 3, "files": [ { "_id": "5ab3c06e0f16d11100f4cd08", "filename": "index", "size": 12207, "filetype": "html", "fileid": "2a6fa770d8111df3274e6545", "employee": "5a9fa770d8211df3274e6545", "customer": "54e5f28c741290fc0203b05a", "type": "DOC", "date": "2018-03-22T14:40:46.286Z", "lastUpdated": "2021-04-22T16:40:46.286Z", "accessLevel": "CUSTOMER", "url": "https://doc.telecomx.dk/5ab3c06e0f16d11100f4cd08.html" }, { "_id": "5ab383590f4200100097a410", "filename": "New Text Document", "size": 308, "filetype": "txt", "fileid": "1a6fa770d8111df3274e6545" "employee": "5a9fa770d8211df3274e6545", "customer": "54e5f28c741290fc0203b05a", "type": "DOC", "date": "2018-03-22T10:20:09.019Z", "lastUpdated": "2021-04-22T16:40:46.286Z", "accessLevel": "CUSTOMER", "url": "https://doc.telecomx.dk/5ab383590f4200100097a410.txt" }, { "_id": "5ab37cf957ca1b0f003ebde4", "filename": "20180310_160619", "size": 3259013, "filetype": "jpg", "fileid": "5a6fa770d8111df3274e6545" "employee": "5a9fa770d8211df3274e6545", "customer": "54e5f28c741290fc0203b05a", "type": "IMAGE", "date": "2018-03-22T09:52:57.099Z", "lastUpdated": "2021-04-22T16:40:46.286Z", "accessLevel": "EMPLOYEE", "url": "https://image.telecomx.dk/5ab37cf957ca1b0f003ebde4.jpg" } ] }
Errors
| Error code | Message | Description |
|---|---|---|
| 500 | internal_error | <Unspecified> |
api/file/list.txt · Last modified: 2025/04/22 11:25 by Per Møller