Skip to content

Latest commit

 

History

History
1007 lines (804 loc) · 33.6 KB

FilesApi.md

File metadata and controls

1007 lines (804 loc) · 33.6 KB

VRChat.API.Api.FilesApi

All URIs are relative to https://vrchat.com/api/1

Method HTTP request Description
CreateFile POST /file Create File
CreateFileVersion POST /file/{fileId} Create File Version
DeleteFile DELETE /file/{fileId} Delete File
DeleteFileVersion DELETE /file/{fileId}/{versionId} Delete File Version
DownloadFileVersion GET /file/{fileId}/{versionId} Download File Version
FinishFileDataUpload PUT /file/{fileId}/{versionId}/{fileType}/finish Finish FileData Upload
GetFile GET /file/{fileId} Show File
GetFileDataUploadStatus GET /file/{fileId}/{versionId}/{fileType}/status Check FileData Upload Status
GetFiles GET /files List Files
StartFileDataUpload PUT /file/{fileId}/{versionId}/{fileType}/start Start FileData Upload

CreateFile

File CreateFile (CreateFileRequest createFileRequest = null)

Create File

Creates a new File object

Example

using System.Collections.Generic;
using System.Diagnostics;
using VRChat.API.Api;
using VRChat.API.Client;
using VRChat.API.Model;

namespace Example
{
    public class CreateFileExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://vrchat.com/api/1";
            // Configure API key authorization: authCookie
            config.AddApiKey("auth", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("auth", "Bearer");

            var apiInstance = new FilesApi(config);
            var createFileRequest = new CreateFileRequest(); // CreateFileRequest |  (optional) 

            try
            {
                // Create File
                File result = apiInstance.CreateFile(createFileRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FilesApi.CreateFile: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the CreateFileWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create File
    ApiResponse<File> response = apiInstance.CreateFileWithHttpInfo(createFileRequest);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FilesApi.CreateFileWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
createFileRequest CreateFileRequest [optional]

Return type

File

Authorization

authCookie

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Returns a single File object. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreateFileVersion

File CreateFileVersion (string fileId, CreateFileVersionRequest createFileVersionRequest = null)

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.

Example

using System.Collections.Generic;
using System.Diagnostics;
using VRChat.API.Api;
using VRChat.API.Client;
using VRChat.API.Model;

namespace Example
{
    public class CreateFileVersionExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://vrchat.com/api/1";
            // Configure API key authorization: authCookie
            config.AddApiKey("auth", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("auth", "Bearer");

            var apiInstance = new FilesApi(config);
            var fileId = file_00000000-0000-0000-0000-000000000000;  // string | Must be a valid file ID.
            var createFileVersionRequest = new CreateFileVersionRequest(); // CreateFileVersionRequest |  (optional) 

            try
            {
                // Create File Version
                File result = apiInstance.CreateFileVersion(fileId, createFileVersionRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FilesApi.CreateFileVersion: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the CreateFileVersionWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Create File Version
    ApiResponse<File> response = apiInstance.CreateFileVersionWithHttpInfo(fileId, createFileVersionRequest);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FilesApi.CreateFileVersionWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
fileId string Must be a valid file ID.
createFileVersionRequest CreateFileVersionRequest [optional]

Return type

File

Authorization

authCookie

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Returns a single File object. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteFile

File DeleteFile (string fileId)

Delete File

Deletes a File object.

Example

using System.Collections.Generic;
using System.Diagnostics;
using VRChat.API.Api;
using VRChat.API.Client;
using VRChat.API.Model;

namespace Example
{
    public class DeleteFileExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://vrchat.com/api/1";
            // Configure API key authorization: authCookie
            config.AddApiKey("auth", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("auth", "Bearer");

            var apiInstance = new FilesApi(config);
            var fileId = file_00000000-0000-0000-0000-000000000000;  // string | Must be a valid file ID.

            try
            {
                // Delete File
                File result = apiInstance.DeleteFile(fileId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FilesApi.DeleteFile: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DeleteFileWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Delete File
    ApiResponse<File> response = apiInstance.DeleteFileWithHttpInfo(fileId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FilesApi.DeleteFileWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
fileId string Must be a valid file ID.

Return type

File

Authorization

authCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Returns a single File object. -
404 Error response when trying to delete a non-existent file. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteFileVersion

File DeleteFileVersion (string fileId, int versionId)

Delete File Version

Delete a specific version of a file. You can only delete the latest version.

Example

using System.Collections.Generic;
using System.Diagnostics;
using VRChat.API.Api;
using VRChat.API.Client;
using VRChat.API.Model;

namespace Example
{
    public class DeleteFileVersionExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://vrchat.com/api/1";
            // Configure API key authorization: authCookie
            config.AddApiKey("auth", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("auth", "Bearer");

            var apiInstance = new FilesApi(config);
            var fileId = file_00000000-0000-0000-0000-000000000000;  // string | Must be a valid file ID.
            var versionId = 1;  // int | Version ID of the asset.

            try
            {
                // Delete File Version
                File result = apiInstance.DeleteFileVersion(fileId, versionId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FilesApi.DeleteFileVersion: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DeleteFileVersionWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Delete File Version
    ApiResponse<File> response = apiInstance.DeleteFileVersionWithHttpInfo(fileId, versionId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FilesApi.DeleteFileVersionWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
fileId string Must be a valid file ID.
versionId int Version ID of the asset.

Return type

File

Authorization

authCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Returns a single File object. -
400 Error response when trying to delete the initial version of a file. Delete the main File object instead. -
500 Error response when trying to delete any version of a file that is not the last one. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DownloadFileVersion

void DownloadFileVersion (string fileId, int versionId)

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.

Example

using System.Collections.Generic;
using System.Diagnostics;
using VRChat.API.Api;
using VRChat.API.Client;
using VRChat.API.Model;

namespace Example
{
    public class DownloadFileVersionExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://vrchat.com/api/1";
            // Configure API key authorization: authCookie
            config.AddApiKey("auth", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("auth", "Bearer");

            var apiInstance = new FilesApi(config);
            var fileId = file_00000000-0000-0000-0000-000000000000;  // string | Must be a valid file ID.
            var versionId = 1;  // int | Version ID of the asset.

            try
            {
                // Download File Version
                apiInstance.DownloadFileVersion(fileId, versionId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FilesApi.DownloadFileVersion: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the DownloadFileVersionWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Download File Version
    apiInstance.DownloadFileVersionWithHttpInfo(fileId, versionId);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FilesApi.DownloadFileVersionWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
fileId string Must be a valid file ID.
versionId int Version ID of the asset.

Return type

void (empty response body)

Authorization

authCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Raw file -
404 Error response when trying to show information about a non-existent file. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FinishFileDataUpload

File FinishFileDataUpload (string fileId, int versionId, string fileType, FinishFileDataUploadRequest finishFileDataUploadRequest = null)

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.

Example

using System.Collections.Generic;
using System.Diagnostics;
using VRChat.API.Api;
using VRChat.API.Client;
using VRChat.API.Model;

namespace Example
{
    public class FinishFileDataUploadExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://vrchat.com/api/1";
            // Configure API key authorization: authCookie
            config.AddApiKey("auth", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("auth", "Bearer");

            var apiInstance = new FilesApi(config);
            var fileId = file_00000000-0000-0000-0000-000000000000;  // string | Must be a valid file ID.
            var versionId = 1;  // int | Version ID of the asset.
            var fileType = file;  // string | Type of file.
            var finishFileDataUploadRequest = new FinishFileDataUploadRequest(); // FinishFileDataUploadRequest | Please see documentation on ETag's: [https://teppen.io/2018/06/23/aws_s3_etags/](https://teppen.io/2018/06/23/aws_s3_etags/)  ETag's should NOT be present when uploading a `signature`. (optional) 

            try
            {
                // Finish FileData Upload
                File result = apiInstance.FinishFileDataUpload(fileId, versionId, fileType, finishFileDataUploadRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FilesApi.FinishFileDataUpload: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the FinishFileDataUploadWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Finish FileData Upload
    ApiResponse<File> response = apiInstance.FinishFileDataUploadWithHttpInfo(fileId, versionId, fileType, finishFileDataUploadRequest);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FilesApi.FinishFileDataUploadWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
fileId string Must be a valid file ID.
versionId int Version ID of the asset.
fileType string Type of file.
finishFileDataUploadRequest FinishFileDataUploadRequest Please see documentation on ETag's: https://teppen.io/2018/06/23/aws_s3_etags/ ETag's should NOT be present when uploading a `signature`. [optional]

Return type

File

Authorization

authCookie

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Returns a single File object. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetFile

File GetFile (string fileId)

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.

Example

using System.Collections.Generic;
using System.Diagnostics;
using VRChat.API.Api;
using VRChat.API.Client;
using VRChat.API.Model;

namespace Example
{
    public class GetFileExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://vrchat.com/api/1";
            // Configure API key authorization: authCookie
            config.AddApiKey("auth", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("auth", "Bearer");

            var apiInstance = new FilesApi(config);
            var fileId = file_00000000-0000-0000-0000-000000000000;  // string | Must be a valid file ID.

            try
            {
                // Show File
                File result = apiInstance.GetFile(fileId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FilesApi.GetFile: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetFileWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Show File
    ApiResponse<File> response = apiInstance.GetFileWithHttpInfo(fileId);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FilesApi.GetFileWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
fileId string Must be a valid file ID.

Return type

File

Authorization

authCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Returns a single File object. -
404 Error response when trying to show information about a non-existent file. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetFileDataUploadStatus

FileVersionUploadStatus GetFileDataUploadStatus (string fileId, int versionId, string fileType)

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.

Example

using System.Collections.Generic;
using System.Diagnostics;
using VRChat.API.Api;
using VRChat.API.Client;
using VRChat.API.Model;

namespace Example
{
    public class GetFileDataUploadStatusExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://vrchat.com/api/1";
            // Configure API key authorization: authCookie
            config.AddApiKey("auth", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("auth", "Bearer");

            var apiInstance = new FilesApi(config);
            var fileId = file_00000000-0000-0000-0000-000000000000;  // string | Must be a valid file ID.
            var versionId = 1;  // int | Version ID of the asset.
            var fileType = file;  // string | Type of file.

            try
            {
                // Check FileData Upload Status
                FileVersionUploadStatus result = apiInstance.GetFileDataUploadStatus(fileId, versionId, fileType);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FilesApi.GetFileDataUploadStatus: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetFileDataUploadStatusWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Check FileData Upload Status
    ApiResponse<FileVersionUploadStatus> response = apiInstance.GetFileDataUploadStatusWithHttpInfo(fileId, versionId, fileType);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FilesApi.GetFileDataUploadStatusWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
fileId string Must be a valid file ID.
versionId int Version ID of the asset.
fileType string Type of file.

Return type

FileVersionUploadStatus

Authorization

authCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Current FileVersion upload status. Contains the uploadId needed for uploading, as well as the already uploaded parts. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetFiles

List<File> GetFiles (string tag = null, string userId = null, int? n = null, int? offset = null)

List Files

Returns a list of files

Example

using System.Collections.Generic;
using System.Diagnostics;
using VRChat.API.Api;
using VRChat.API.Client;
using VRChat.API.Model;

namespace Example
{
    public class GetFilesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://vrchat.com/api/1";
            // Configure API key authorization: authCookie
            config.AddApiKey("auth", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("auth", "Bearer");

            var apiInstance = new FilesApi(config);
            var tag = "tag_example";  // string | Tag, for example \"icon\" or \"gallery\", not included by default. (optional) 
            var userId = "userId_example";  // string | UserID, will always generate a 500 permission error. (optional) 
            var n = 60;  // int? | The number of objects to return. (optional)  (default to 60)
            var offset = 56;  // int? | A zero-based offset from the default object sorting from where search results start. (optional) 

            try
            {
                // List Files
                List<File> result = apiInstance.GetFiles(tag, userId, n, offset);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FilesApi.GetFiles: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetFilesWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // List Files
    ApiResponse<List<File>> response = apiInstance.GetFilesWithHttpInfo(tag, userId, n, offset);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FilesApi.GetFilesWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
tag string Tag, for example &quot;icon&quot; or &quot;gallery&quot;, not included by default. [optional]
userId string UserID, will always generate a 500 permission error. [optional]
n int? The number of objects to return. [optional] [default to 60]
offset int? A zero-based offset from the default object sorting from where search results start. [optional]

Return type

List<File>

Authorization

authCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Returns a list of File objects. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

StartFileDataUpload

FileUploadURL StartFileDataUpload (string fileId, int versionId, string fileType, int? partNumber = null)

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.

Example

using System.Collections.Generic;
using System.Diagnostics;
using VRChat.API.Api;
using VRChat.API.Client;
using VRChat.API.Model;

namespace Example
{
    public class StartFileDataUploadExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://vrchat.com/api/1";
            // Configure API key authorization: authCookie
            config.AddApiKey("auth", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("auth", "Bearer");

            var apiInstance = new FilesApi(config);
            var fileId = file_00000000-0000-0000-0000-000000000000;  // string | Must be a valid file ID.
            var versionId = 1;  // int | Version ID of the asset.
            var fileType = file;  // string | Type of file.
            var partNumber = 1;  // int? | The part number to start uploading. If not provided, the first part will be started. (optional) 

            try
            {
                // Start FileData Upload
                FileUploadURL result = apiInstance.StartFileDataUpload(fileId, versionId, fileType, partNumber);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling FilesApi.StartFileDataUpload: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the StartFileDataUploadWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Start FileData Upload
    ApiResponse<FileUploadURL> response = apiInstance.StartFileDataUploadWithHttpInfo(fileId, versionId, fileType, partNumber);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling FilesApi.StartFileDataUploadWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
fileId string Must be a valid file ID.
versionId int Version ID of the asset.
fileType string Type of file.
partNumber int? The part number to start uploading. If not provided, the first part will be started. [optional]

Return type

FileUploadURL

Authorization

authCookie

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 See [https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html](AWS REST docs - PUT Object) -
400 Error response when trying to start an upload against a FileVersion that is already marked as `complete`. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]