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:
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
- application/json
Nested Schema : schema
Type:
Show Source
object
-
ExpireTime: string
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
-
FileTypeID: integer
Unique identifier for the file type. Allowed Values: - 1 => Other - 2 => Image - 3 => Report - 4 => SoundExample:
2
-
MimeType: string
The MIME type of the file.Example:
-
OwnerUserGroupID: integer
The user group owner of the file.Example:
1
-
OwnerUserID: integer
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
-
UploadFile:
Upload File contents. Filename is determined from Content-Disposition filename. Fake upload (add file already on server), by populating with $_FILES fields.
-
Viewers: array
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:
Show Source
object
-
UserGroupID: integer
User Group ID
-
UserGroupName: string
User Group Name
Response
Supported Media Types
- application/json
200 Response
Successful operation
Root Schema : schema
Match All
Show Source
-
object
SuccessfulAddOperation
The response body for a successful add operation.
-
object
type
Nested Schema : SuccessfulAddOperation
Type:
object
The response body for a successful add operation.
Show Source
-
message: string
The response message.Example:
Added record
-
success: boolean
Whether the operation was a success (true) or a failure (false).Example:
true
Nested Schema : type
Type:
Show Source
object
-
data: array
data
The properties of the new file.
-
total: integer
The total number of results regardless of paging.Example:
1
Nested Schema : fileFilesRead
Type:
Show Source
object
-
Expired: integer
If file is expired or not. If the value is 1, then the file expiration time has exceeded.Example:
0
-
ExpireTime: string
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
-
ExpireTimeFormatted: string
Allowed Values:
[ "Never", "28 Feb 2023 05:02:00" ]
Expire Time after formattingExample:Never
-
FileExtension: string
Type of extension for the file.Example:
png
-
FileID: integer
Unique identifier for the file.Example:
1000
-
FileName: string
Name of the uploaded file, determined from Content-Disposition filename.Example:
AccessPoint.png
-
FileType: string
The type of the file.Example:
Image
-
FileTypeID: integer
Unique identifier for the file type. Allowed Values: - 1 => Other - 2 => Image - 3 => Report - 4 => SoundExample:
2
-
MimeType: string
The MIME type of the file.Example:
-
Owner: string
Owner for the file.Example:
Group: Administrators
-
OwnerUserGroupID: integer
The user group owner of the file.Example:
1
-
OwnerUserID: integer
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: array
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:
Show Source
object
-
UserGroupID: integer
User Group ID
-
UserGroupName: string
User Group Name
Default Response
Failed operation
Root Schema : schema
Type:
Show Source
object
-
errors: array
errors
The list of errors reported. Validation errors will be keyed by record field.
-
message: string
The response message.Example:
Exception thrown
-
success: boolean
Whether the operation was a success (true) or a failure (false).Example:
false
Nested Schema : errors
Type:
array
The list of errors reported. Validation errors will be keyed by record field.
Show Source
-
Array of:
object items
An error.
Nested Schema : items
Type:
object
An error.