User Tools

Site Tools


api:file:update

API : File Update

Introduction

Update metadata on a file, not the file itself, it can only be deleted.

Request

URL https://api.telecomx.dk/file/ID
Method POST
Access level Minimum VIEWER
Param ID Id of the document (24 hex-char string)
Body accessLevel String Determines who can access the file. “ALL”, “CUSTOMER”, “EMPLOYEE”, “RESELLER”.
description String [optional] State of the employee: ENABLED (default), DISABLED (cannot login), DELETED.

Request body example

{
  "description": "My index.html",
  "accessLevel": "ALL"
}

Response

The response will be the updated document metadata, if no errors occurred.

Document 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”

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

Example

{
    "_id": "5ab3c06e0f16d11100f4cd08",
     "filename": "index",
     "size": 12207,
     "filetype": "html",
     "fileId": "cab3c06e0f16d11100f4cd08",
     "employee": "5a9fa770d8211df3274e6545",
     "customer": "54e5f28c741290fc0203b05a",
     "type": "DOC",
     "date": "2018-03-22T14:40:46.286Z",
     "lastUpdated": "2021-04-22T16:40:46.286Z",
     "accessLevel": "ALL"
     "description": "My index.html"
}

Errors

Error code Message Description
400 document Missing parameters
400 employee Filetype can not be changed!
403 access_denied Insufficient access level
404 not_found Document not found
500 internal_error <unspecified>
api/file/update.txt · Last modified: 2025/11/04 09:51 by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki