The ioGates File API
Create, retrieve, and manage files within ioGates, including setting file attributes, and managing comments, with detailed insights into authorization, file creation, and retrieval processes.
The ioGates File API offers a powerful suite of tools for managing files, from creation to retrieval, alongside managing file-specific comments. This API allows for detailed control over file attributes and provides a structured approach to file management within the ioGates ecosystem.
Create File
URL: /api/file
Method: POST
Request Headers
Authorisation: A Bearer token is required, which is obtained from the auth token API.
Example:
Authorisation: Bearer 123-BodrEJHrC43KejPcM0nzTl05gUMi3i8ruzGN
Response Body
The response 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 they are 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 folder to place the file. |
| size | Optional. The size may be given to 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 are shown in the ioGates MetaData menu and on shares.
Get File
URL: /api/file/{id}
Method: GET
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
URL: /api/file/{id}/comments
Method: GET
Request Headers
Authorisation: A Bearer token is required, which is obtained from the auth token API.
Example:
Authorisation: 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. |