Upload a File

post

/api/file/Files

Uploads a new file in the Unified Assurance file storage.
The minimum required properties in the request body are:
  • FileTypeID
  • ExpireTime
  • OwnerUserID
  • OwnerUserGroupID
  • UploadFile

Request

There are no request parameters for this operation.

Supported Media Types
Request Body - application/json ()
Root Schema : schema
Match All
Show Source
Nested Schema : schema
Type: object
Show Source
  • Allowed Values: [ "Never", "2023-02-28 05:02:00" ]
    Expire time of file. Can be used to create a cleanup policy of expired files. It should be of format "yyyy-mm-dd hh:mm:ss" or "Never".
    Example: Never
  • The ID of the file type. The following default integer values will be mapped to a string in the FileType property automatically:
    • 1: Other
    • 2: Image
    • 3: Report
    • 4: Sound
    Any additional custom file types are mapped to values 1000 and up.
    This should, but does not have to, match the type indicated by the file's extension.
    Example: 2
  • The MIME type of the file. If you specify this parameter, it is used as specified, even if it does not match the type indicated by the file's extension. If you do not specify this property, it will be automatically detected based on the file's extension.
    Example: image/png
  • The user group owner of the file.
    Example: 1
  • The ID of the user that owns the file. This can never be an externally-authenticated transient user. 0 means it is public to all users in the owning group.
    Example: 0
  • Upload File contents. Filename is determined from Content-Disposition filename. Fake upload (add file already on server), by populating with $_FILES fields.
  • Viewers
    Selection of user groups that have read-only access to file.
Nested Schema : Viewers
Type: array
Selection of user groups that have read-only access to file.
Show Source
Example:
[
    {
        "UserGroupID":"0",
        "UserGroupName":"[Public to All Groups]"
    }
]
Nested Schema : items
Type: object
Show Source
Back to Top

Response

Supported Media Types

200 Response

Successful operation
Body ()
Root Schema : schema
Match All
Show Source
Nested Schema : SuccessfulAddOperation
Type: object
The response body for a successful add operation.
Show Source
Nested Schema : type
Type: object
Show Source
Nested Schema : data
Type: array
The properties of the new file.
Show Source
Nested Schema : fileFilesRead
Type: object
Show Source
  • If file is expired or not. If the value is 1, then the file expiration time has exceeded.
    Example: 0
  • Allowed Values: [ "Never", "2023-02-28 05:02:00" ]
    Expire time of file. Can be used to create a cleanup policy of expired files.
    Example: Never
  • Allowed Values: [ "Never", "28 Feb 2023 05:02:00" ]
    Expire Time after formatting
    Example: Never
  • Type of extension for the file.
    Example: png
  • Unique identifier for the file.
    Example: 1000
  • Name of the uploaded file, determined from Content-Disposition filename.
    Example: AccessPoint.png
  • The type of the file.
    Example: Image
  • The ID of the file type. The following default integer values are mapped to a string in the FileType property:
    • 1: Other
    • 2: Image
    • 3: Report
    • 4: Sound
    Any additional custom file types are mapped to values 1000 and up.
    This may, but does not have to, match the type indicated by the file's extension.
    Example: 2
  • The MIME type of the file.
    Example: image/png
  • Owner for the file.
    Example: Group: Administrators
  • The user group owner of the file.
    Example: 1
  • The ID of the user that owns the file. This can never be an externally-authenticated transient user. 0 means it is public to all users in the owning group.
    Example: 0
  • Viewers
    Selection of user groups that have read-only access to file.
Nested Schema : Viewers
Type: array
Selection of user groups that have read-only access to file.
Show Source
Example:
[
    {
        "UserGroupID":"0",
        "UserGroupName":"[Public to All Groups]"
    }
]
Nested Schema : items
Type: object
Show Source

Default Response

Failed operation
Body ()
Root Schema : schema
Type: object
Show Source
Nested Schema : errors
Type: array
The list of errors reported. Validation errors will be keyed by record field.
Show Source
Nested Schema : items
Type: object
An error.
Back to Top