View Source VRChat.Files (vrchat v1.11.1)
API calls for all endpoints tagged Files
.
Link to this section Summary
Functions
Create File Creates a new File object
Create File Version
Creates a new FileVersion. Once a Version has been created, proceed to the /file/{fileId}/{versionId}/file/start
endpoint to start a file upload.
Delete File Deletes a File object.
Delete File Version Delete a specific version of a file. You can only delete the latest version.
Download File Version
Downloads the file with the provided version number. Version Note: Version 0 is always when the file was created. The real data is usually always located in version 1 and up. Extension Note: Files are not guaranteed to have a file extensions. UnityPackage files tends to have it, images through this endpoint do not. You are responsible for appending file extension from the extension
field when neccesary.
Finish FileData Upload
Finish an upload of a FileData. This will mark it as "complete". After uploading the file
for Avatars and Worlds you then have to upload a signature
file.
Show File Shows general information about the "File" object. Each File can have several "Version"'s, and each Version can have multiple real files or "Data" blobs.
Check FileData Upload Status
Retrieves the upload status for file upload. Can currently only be accessed when status
is waiting
. Trying to access it on a file version already uploaded currently times out.
List Files Returns a list of files
Start FileData Upload
Starts an upload of a specific FilePart. This endpoint will return an AWS URL which you can PUT data to. You need to call this and receive a new AWS API URL for each partNumber
. Please see AWS's REST documentation on "PUT Object to S3" on how to upload. Once all parts has been uploaded, proceed to /finish
endpoint. Note: nextPartNumber
seems like it is always ignored. Despite it returning 0, first partNumber is always 1.
Link to this section Functions
@spec create_file( Tesla.Env.client(), keyword() ) :: {:ok, VRChat.Model.File.t()} | {:error, Tesla.Env.t()}
Create File Creates a new File object
parameters
Parameters
connection
(VRChat.Connection): Connection to serveropts
(keyword): Optional parameters:body
(CreateFileRequest):
returns
Returns
{:ok, VRChat.Model.File.t}
on success{:error, Tesla.Env.t}
on failure
@spec create_file_version(Tesla.Env.client(), String.t(), keyword()) :: {:ok, VRChat.Model.File.t()} | {:error, Tesla.Env.t()}
Create File Version
Creates a new FileVersion. Once a Version has been created, proceed to the /file/{fileId}/{versionId}/file/start
endpoint to start a file upload.
parameters
Parameters
connection
(VRChat.Connection): Connection to serverfile_id
(String.t): Must be a valid file ID.opts
(keyword): Optional parameters:body
(CreateFileVersionRequest):
returns
Returns
{:ok, VRChat.Model.File.t}
on success{:error, Tesla.Env.t}
on failure
@spec delete_file(Tesla.Env.client(), String.t(), keyword()) :: {:ok, VRChat.Model.Success.t()} | {:ok, VRChat.Model.Error.t()} | {:error, Tesla.Env.t()}
Delete File Deletes a File object.
parameters
Parameters
connection
(VRChat.Connection): Connection to serverfile_id
(String.t): Must be a valid file ID.opts
(keyword): Optional parameters
returns
Returns
{:ok, VRChat.Model.Success.t}
on success{:error, Tesla.Env.t}
on failure
@spec delete_file_version(Tesla.Env.client(), String.t(), integer(), keyword()) :: {:ok, VRChat.Model.Error.t()} | {:ok, VRChat.Model.File.t()} | {:error, Tesla.Env.t()}
Delete File Version Delete a specific version of a file. You can only delete the latest version.
parameters
Parameters
connection
(VRChat.Connection): Connection to serverfile_id
(String.t): Must be a valid file ID.version_id
(integer()): Version ID of the asset.opts
(keyword): Optional parameters
returns
Returns
{:ok, VRChat.Model.File.t}
on success{:error, Tesla.Env.t}
on failure
download_file_version(connection, file_id, version_id, opts \\ [])
View Source@spec download_file_version(Tesla.Env.client(), String.t(), integer(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t()}
Download File Version
Downloads the file with the provided version number. Version Note: Version 0 is always when the file was created. The real data is usually always located in version 1 and up. Extension Note: Files are not guaranteed to have a file extensions. UnityPackage files tends to have it, images through this endpoint do not. You are responsible for appending file extension from the extension
field when neccesary.
parameters
Parameters
connection
(VRChat.Connection): Connection to serverfile_id
(String.t): Must be a valid file ID.version_id
(integer()): Version ID of the asset.opts
(keyword): Optional parameters
returns
Returns
{:ok, nil}
on success{:error, Tesla.Env.t}
on failure
finish_file_data_upload(connection, file_id, version_id, file_type, opts \\ [])
View Source@spec finish_file_data_upload( Tesla.Env.client(), String.t(), integer(), String.t(), keyword() ) :: {:ok, VRChat.Model.File.t()} | {:error, Tesla.Env.t()}
Finish FileData Upload
Finish an upload of a FileData. This will mark it as "complete". After uploading the file
for Avatars and Worlds you then have to upload a signature
file.
parameters
Parameters
connection
(VRChat.Connection): Connection to serverfile_id
(String.t): Must be a valid file ID.version_id
(integer()): Version ID of the asset.file_type
(String.t): Type of file.opts
(keyword): Optional parameters:body
(FinishFileDataUploadRequest): Please see documentation on ETag's: https://teppen.io/2018/06/23/aws_s3_etags/ ETag's should NOT be present when uploading asignature
.
returns
Returns
{:ok, VRChat.Model.File.t}
on success{:error, Tesla.Env.t}
on failure
@spec get_file(Tesla.Env.client(), String.t(), keyword()) :: {:ok, VRChat.Model.Error.t()} | {:ok, VRChat.Model.File.t()} | {:error, Tesla.Env.t()}
Show File Shows general information about the "File" object. Each File can have several "Version"'s, and each Version can have multiple real files or "Data" blobs.
parameters
Parameters
connection
(VRChat.Connection): Connection to serverfile_id
(String.t): Must be a valid file ID.opts
(keyword): Optional parameters
returns
Returns
{:ok, VRChat.Model.File.t}
on success{:error, Tesla.Env.t}
on failure
get_file_data_upload_status(connection, file_id, version_id, file_type, opts \\ [])
View Source@spec get_file_data_upload_status( Tesla.Env.client(), String.t(), integer(), String.t(), keyword() ) :: {:ok, VRChat.Model.FileVersionUploadStatus.t()} | {:error, Tesla.Env.t()}
Check FileData Upload Status
Retrieves the upload status for file upload. Can currently only be accessed when status
is waiting
. Trying to access it on a file version already uploaded currently times out.
parameters
Parameters
connection
(VRChat.Connection): Connection to serverfile_id
(String.t): Must be a valid file ID.version_id
(integer()): Version ID of the asset.file_type
(String.t): Type of file.opts
(keyword): Optional parameters
returns
Returns
{:ok, VRChat.Model.FileVersionUploadStatus.t}
on success{:error, Tesla.Env.t}
on failure
@spec get_files( Tesla.Env.client(), keyword() ) :: {:ok, [VRChat.Model.File.t()]} | {:error, Tesla.Env.t()}
List Files Returns a list of files
parameters
Parameters
connection
(VRChat.Connection): Connection to serveropts
(keyword): Optional parameters:tag
(String.t): Tag, for example "icon" or "gallery", not included by default.:userId
(String.t): UserID, will always generate a 500 permission error.:n
(integer()): The number of objects to return.:offset
(integer()): A zero-based offset from the default object sorting from where search results start.
returns
Returns
{:ok, [%File{}, ...]}
on success{:error, Tesla.Env.t}
on failure
start_file_data_upload(connection, file_id, version_id, file_type, opts \\ [])
View Source@spec start_file_data_upload( Tesla.Env.client(), String.t(), integer(), String.t(), keyword() ) :: {:ok, VRChat.Model.FileUploadUrl.t()} | {:ok, VRChat.Model.Error.t()} | {:error, Tesla.Env.t()}
Start FileData Upload
Starts an upload of a specific FilePart. This endpoint will return an AWS URL which you can PUT data to. You need to call this and receive a new AWS API URL for each partNumber
. Please see AWS's REST documentation on "PUT Object to S3" on how to upload. Once all parts has been uploaded, proceed to /finish
endpoint. Note: nextPartNumber
seems like it is always ignored. Despite it returning 0, first partNumber is always 1.
parameters
Parameters
connection
(VRChat.Connection): Connection to serverfile_id
(String.t): Must be a valid file ID.version_id
(integer()): Version ID of the asset.file_type
(String.t): Type of file.opts
(keyword): Optional parameters:partNumber
(integer()): The part number to start uploading. If not provided, the first part will be started.
returns
Returns
{:ok, VRChat.Model.FileUploadUrl.t}
on success{:error, Tesla.Env.t}
on failure