File Uploads

The upload API is how you can add files to Image Relay. Files are uploaded to Image Relay through the creation of upload jobs, and then individual files are sent up in chunks.

To upload a file, first you create an Upload Job with the following information about the file you are uploading:

folder_idID of the folder where the file will be uploaded
file_type_idID of the File Type to be associated with this file. See the File Types endpoints for more information
filesArray of files being uploaded. Each file is represented as an object containing a "name" & "size". For example: "files": [{"name": "myfile.txt", "size": 12345}]

The response will contain an ID for your Upload Job as well as an Asset ID for each file.

You then will break up your file(s) into chunks of 5 MB or less and use the Upload File Chunks endpoint to upload those chunks by providing the Upload Job ID & Asset ID for each chunk. The POST body of your request will be the binary data for each chunk.