diff --git a/openapi/components/codeSamples/files.yaml b/openapi/components/codeSamples/files.yaml index d91f280..3682b6c 100644 --- a/openapi/components/codeSamples/files.yaml +++ b/openapi/components/codeSamples/files.yaml @@ -61,3 +61,25 @@ source: >- curl -X GET "https://vrchat.com/api/1/file/{fileId}/{versionId}/{fileType}/status" \ -b "auth={authCookie}" +/icon: + post: + - lang: cURL + source: >- + curl -X POST "https://api.vrchat.cloud/api/1/icon" \ + -b "auth={authCookie}" \ + -F "file=@/path/to/image.png" +/gallery: + post: + - lang: cURL + source: >- + curl -X POST "https://api.vrchat.cloud/api/1/gallery" \ + -b "auth={authCookie}" \ + -F "file=@/path/to/image.png" +/file/image: + post: + - lang: cURL + source: >- + curl -X POST "https://api.vrchat.cloud/api/1/file/image" \ + -b "auth={authCookie}" \ + -F "file=@/path/to/image.png" \ + -F "tag=icon" diff --git a/openapi/components/paths.yaml b/openapi/components/paths.yaml index 9ffaee7..2e5eb40 100644 --- a/openapi/components/paths.yaml +++ b/openapi/components/paths.yaml @@ -80,6 +80,12 @@ $ref: "./paths/files.yaml#/paths/~1file~1{fileId}~1{versionId}~1{fileType}~1start" "/file/{fileId}/{versionId}/{fileType}/status": $ref: "./paths/files.yaml#/paths/~1file~1{fileId}~1{versionId}~1{fileType}~1status" +"/file/image": + $ref: "./paths/files.yaml#/paths/~1file~1image" +"/icon": + $ref: "./paths/files.yaml#/paths/~1icon" +"/gallery": + $ref: "./paths/files.yaml#/paths/~1gallery" # friends diff --git a/openapi/components/paths/files.yaml b/openapi/components/paths/files.yaml index 7a0130b..f413b11 100644 --- a/openapi/components/paths/files.yaml +++ b/openapi/components/paths/files.yaml @@ -231,6 +231,96 @@ paths: security: - authCookie: [] description: 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. + '/file/image': + post: + summary: Upload gallery image, icon, emoji or sticker + tags: + - files + x-codeSamples: + $ref: "../codeSamples/files.yaml#/~1file~1image/post" + responses: + '200': + $ref: ../responses/files/FileResponse.yaml + operationId: uploadImage + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + description: The binary blob of the png file. + tag: + type: string + description: Needs to be either icon, gallery, sticker or emoji + animationStyle: + type: string + example: bats + description: Animation style for sticker, required for emoji. + maskTag: + type: string + example: square + description: Mask of the sticker, optional for emoji. + required: + - file + - tag + security: + - authCookie: [] + description: Upload an image, which can be an icon, gallery image, sticker or emoji + '/icon': + post: + summary: Upload icon + tags: + - files + x-codeSamples: + $ref: "../codeSamples/files.yaml#/~1icon/post" + responses: + '200': + $ref: ../responses/files/FileResponse.yaml + operationId: uploadIcon + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + description: The binary blob of the png file. + required: + - file + security: + - authCookie: [ ] + description: Upload an icon + '/gallery': + post: + summary: Upload gallery image + tags: + - files + x-codeSamples: + $ref: "../codeSamples/files.yaml#/~1gallery/post" + responses: + '200': + $ref: ../responses/files/FileResponse.yaml + operationId: uploadGalleryImage + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + description: The binary blob of the png file. + required: + - file + security: + - authCookie: [ ] + description: Upload a gallery image tags: $ref: ../tags.yaml components: diff --git a/openapi/components/schemas/File.yaml b/openapi/components/schemas/File.yaml index 4701755..fef2351 100644 --- a/openapi/components/schemas/File.yaml +++ b/openapi/components/schemas/File.yaml @@ -1,5 +1,11 @@ description: '' properties: + animationStyle: + type: string + example: bats + maskTag: + type: string + example: square extension: example: .unitypackage minLength: 1