VRChat.Files (vrchat v1.20.0)

View Source

API calls for all endpoints tagged Files.

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.

Get File Version Analysis Get the performance analysis for the uploaded assets of an avatar

Get File Version Analysis Security Get the security performance analysis for the uploaded assets of an avatar

Get File Version Analysis Standard Get the standard performance analysis for the uploaded assets of an avatar

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.

Upload gallery image Upload a gallery image

Upload icon Upload an icon

Upload gallery image, icon, emoji or sticker Upload an image, which can be an icon, gallery image, sticker or emoji

Functions

create_file(connection, opts \\ [])

@spec create_file(
  Tesla.Env.client(),
  keyword()
) :: {:ok, VRChat.Model.File.t()} | {:error, Tesla.Env.t()}

Create File Creates a new File object

Parameters

  • connection (VRChat.Connection): Connection to server
  • opts (keyword): Optional parameters
    • :body (CreateFileRequest):

Returns

  • {:ok, VRChat.Model.File.t} on success
  • {:error, Tesla.Env.t} on failure

create_file_version(connection, file_id, opts \\ [])

@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

  • connection (VRChat.Connection): Connection to server
  • file_id (String.t): Must be a valid file ID.
  • opts (keyword): Optional parameters
    • :body (CreateFileVersionRequest):

Returns

  • {:ok, VRChat.Model.File.t} on success
  • {:error, Tesla.Env.t} on failure

delete_file(connection, file_id, opts \\ [])

@spec delete_file(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, VRChat.Model.Error.t()}
  | {:ok, VRChat.Model.File.t()}
  | {:error, Tesla.Env.t()}

Delete File Deletes a File object.

Parameters

  • connection (VRChat.Connection): Connection to server
  • file_id (String.t): Must be a valid file ID.
  • opts (keyword): Optional parameters

Returns

  • {:ok, VRChat.Model.File.t} on success
  • {:error, Tesla.Env.t} on failure

delete_file_version(connection, file_id, version_id, opts \\ [])

@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

  • connection (VRChat.Connection): Connection to server
  • file_id (String.t): Must be a valid file ID.
  • version_id (integer()): Version ID of the asset.
  • opts (keyword): Optional parameters

Returns

  • {:ok, VRChat.Model.File.t} on success
  • {:error, Tesla.Env.t} on failure

download_file_version(connection, file_id, version_id, opts \\ [])

@spec download_file_version(Tesla.Env.client(), String.t(), integer(), keyword()) ::
  {:ok, VRChat.Model.Error.t()} | {:ok, String.t()} | {: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

  • connection (VRChat.Connection): Connection to server
  • file_id (String.t): Must be a valid file ID.
  • version_id (integer()): Version ID of the asset.
  • opts (keyword): Optional parameters

Returns

  • {:ok, String.t} on success
  • {:error, Tesla.Env.t} on failure

finish_file_data_upload(connection, file_id, version_id, file_type, opts \\ [])

@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

  • connection (VRChat.Connection): Connection to server
  • file_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

  • {:ok, VRChat.Model.File.t} on success
  • {:error, Tesla.Env.t} on failure

get_file(connection, file_id, opts \\ [])

@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

  • connection (VRChat.Connection): Connection to server
  • file_id (String.t): Must be a valid file ID.
  • opts (keyword): Optional parameters

Returns

  • {:ok, VRChat.Model.File.t} on success
  • {:error, Tesla.Env.t} on failure

get_file_analysis(connection, file_id, version_id, opts \\ [])

@spec get_file_analysis(Tesla.Env.client(), String.t(), integer(), keyword()) ::
  {:ok, VRChat.Model.Error.t()}
  | {:ok, VRChat.Model.FileAnalysis.t()}
  | {:error, Tesla.Env.t()}

Get File Version Analysis Get the performance analysis for the uploaded assets of an avatar

Parameters

  • connection (VRChat.Connection): Connection to server
  • file_id (String.t): Must be a valid file ID.
  • version_id (integer()): Version ID of the asset.
  • opts (keyword): Optional parameters

Returns

  • {:ok, VRChat.Model.FileAnalysis.t} on success
  • {:error, Tesla.Env.t} on failure

get_file_analysis_security(connection, file_id, version_id, opts \\ [])

@spec get_file_analysis_security(Tesla.Env.client(), String.t(), integer(), keyword()) ::
  {:ok, VRChat.Model.Error.t()}
  | {:ok, VRChat.Model.FileAnalysis.t()}
  | {:error, Tesla.Env.t()}

Get File Version Analysis Security Get the security performance analysis for the uploaded assets of an avatar

Parameters

  • connection (VRChat.Connection): Connection to server
  • file_id (String.t): Must be a valid file ID.
  • version_id (integer()): Version ID of the asset.
  • opts (keyword): Optional parameters

Returns

  • {:ok, VRChat.Model.FileAnalysis.t} on success
  • {:error, Tesla.Env.t} on failure

get_file_analysis_standard(connection, file_id, version_id, opts \\ [])

@spec get_file_analysis_standard(Tesla.Env.client(), String.t(), integer(), keyword()) ::
  {:ok, VRChat.Model.Error.t()}
  | {:ok, VRChat.Model.FileAnalysis.t()}
  | {:error, Tesla.Env.t()}

Get File Version Analysis Standard Get the standard performance analysis for the uploaded assets of an avatar

Parameters

  • connection (VRChat.Connection): Connection to server
  • file_id (String.t): Must be a valid file ID.
  • version_id (integer()): Version ID of the asset.
  • opts (keyword): Optional parameters

Returns

  • {:ok, VRChat.Model.FileAnalysis.t} on success
  • {:error, Tesla.Env.t} on failure

get_file_data_upload_status(connection, file_id, version_id, file_type, opts \\ [])

@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

  • connection (VRChat.Connection): Connection to server
  • file_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

  • {:ok, VRChat.Model.FileVersionUploadStatus.t} on success
  • {:error, Tesla.Env.t} on failure

get_files(connection, opts \\ [])

@spec get_files(
  Tesla.Env.client(),
  keyword()
) :: {:ok, [VRChat.Model.File.t()]} | {:error, Tesla.Env.t()}

List Files Returns a list of files

Parameters

  • connection (VRChat.Connection): Connection to server
  • opts (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

  • {:ok, [%File{}, ...]} on success
  • {:error, Tesla.Env.t} on failure

start_file_data_upload(connection, file_id, version_id, file_type, opts \\ [])

@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

  • connection (VRChat.Connection): Connection to server
  • file_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

  • {:ok, VRChat.Model.FileUploadUrl.t} on success
  • {:error, Tesla.Env.t} on failure

upload_icon(connection, file, opts \\ [])

@spec upload_icon(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, VRChat.Model.File.t()} | {:error, Tesla.Env.t()}

Upload icon Upload an icon

Parameters

  • connection (VRChat.Connection): Connection to server
  • file (String.t): The binary blob of the png file.
  • opts (keyword): Optional parameters

Returns

  • {:ok, VRChat.Model.File.t} on success
  • {:error, Tesla.Env.t} on failure

upload_image(connection, file, tag, opts \\ [])

@spec upload_image(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, VRChat.Model.File.t()} | {:error, Tesla.Env.t()}

Upload gallery image, icon, emoji or sticker Upload an image, which can be an icon, gallery image, sticker or emoji

Parameters

  • connection (VRChat.Connection): Connection to server
  • file (String.t): The binary blob of the png file.
  • tag (String.t): Needs to be either icon, gallery, sticker, emoji, or emojianimated
  • opts (keyword): Optional parameters
    • :frames (integer()): Required for emojianimated. Total number of frames to be animated (2-64)
    • :framesOverTime (integer()): Required for emojianimated. Animation frames per second (1-64)
    • :animationStyle (String.t): Animation style for sticker, required for emoji.
    • :maskTag (String.t): Mask of the sticker, optional for emoji.

Returns

  • {:ok, VRChat.Model.File.t} on success
  • {:error, Tesla.Env.t} on failure