URL: /api/file
Create File
Method: POST
Request Headers
Authorization | A Bearer authorization token, from auth token api. The token must have upload capabilities to create files. Example: Authorization: Bearer 123-BodrEJHrC43KejPcM0nzTl05gUMi3i8ruzGN |
Request Body
The request body is a JSON formatted representation of the file.
name | Required. The name/title of the file. The file name may be a path in which case the folders in the path will be created automatically if not already present. The path is relative to the root for the authorization token. |
type | Required. Use MIME type or the ioGates native types: movie, audio, image, or other. |
attributes |
Optional. List of objects containing a name and a value attribute. [ { name: "Scene", value: 127 }, ... ] |
parent | Optional. Id of the the folder to place the file. |
size | Optional. The size may be given allow for size validation on ioGates. |
md5 | Optional. The MD5 hash of the file for validation. |
Example:
{ name: "My Title",// title type: "movie", // movie, audio, image, other size: 1234, // size in bytes attributes: [ { name: "My Attribute", value: "Some Value"} ],
md5: "2d53a2f20ffc76c89848b6a47c97d5d8" }
Response
{ name: "My Title",// title type: "movie", // movie, audio, image, other attributes: [ { name: "My Attribute", value: "Some Value"} ],
id: 61463,
parent: 61462,
created: "2020-07-07T10:14:21+0200",
description: null,
editable: true, href: "https://web02.iogates.com/api/file/123456",
size: null,
transfer_name: "My Title.",
download: null,
md5: null,
Etag: 0, upload_filename: "56f06ba8311c2" }
- Upload filename is the name that must be used for uploading. This will trigger the logic to add the file to the created virtual file rather than as a new file.
- Attributes shown in ioGates MetaData menu and on shares.
Get File
Method: GET
Resource: /api/file/{id}
Request Headers
Authorization | A Bearer authorization token, from auth token api. Example: Authorization: Bearer 123-BodrEJHrC43KejPcM0nzTl05gUMi3i8ruzGN |
Response
HTTP Status 200
{
name: "My Title",
type: "movie",
attributes: [
{ name: "My Attribute", value: "Some Value"}
],
id: 61463,
parent: 61462,
created: "2019-06-18T16:55:12+0200",
description: null,
editable: true,
href: "https://app.iogates.localhost/api/file/61463",
size: null,
transfer_name: "My Title.mp4",
download: "https://app.iogates.localhost/download-file/59537/0/0/1/0/351-YC20zxKNb7a5PoxtRjazw7A23TpfZ0Kd",
md5: "2d53a2f20ffc76c89848b6a47c97d5d8",
Etag: 1
}
Get File Comments
Method: GET
Resource: /api/file/{id}/comments
Request Headers
Authorization | A Bearer authorization token, from auth token api. Example: Authorization: Bearer 123-BodrEJHrC43KejPcM0nzTl05gUMi3i8ruzGN |
Response
HTTP Status 200
timecode |
Object. Information about the source file. |
timecode.source | String. Source time code in the format "00:00:00:00" (Hours:Minutes:Seconds:Frames) |
timecode.fps | Float. Source frame rate |
timecode.offset | Integer. Offset in milliseconds. This can be used to translate from comment time code to source time code. |
comments | List of comments see Comment API for data format. |
map | An object mapping comment id's to comments list index. |