diff --git a/openapi/components/codeSamples/files.yaml b/openapi/components/codeSamples/files.yaml index 8ede989b..6b48f300 100644 --- a/openapi/components/codeSamples/files.yaml +++ b/openapi/components/codeSamples/files.yaml @@ -79,3 +79,25 @@ source: >- curl -X GET "https://api.vrchat.cloud/api/1/analysis/{fileId}/{versionId}/standard" \ -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 a8f39dba..4e55bffe 100644 --- a/openapi/components/paths.yaml +++ b/openapi/components/paths.yaml @@ -108,6 +108,12 @@ $ref: "./paths/files.yaml#/paths/~1analysis~1{fileId}~1{versionId}~1security" "/analysis/{fileId}/{versionId}/standard": $ref: "./paths/files.yaml#/paths/~1analysis~1{fileId}~1{versionId}~1standard" +"/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 3d5d46fd..b5c32c33 100644 --- a/openapi/components/paths/files.yaml +++ b/openapi/components/paths/files.yaml @@ -294,6 +294,96 @@ paths: security: - authCookie: [] description: Get the standard performance analysis for the uploaded assets of an avatar + '/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 4701755f..fef2351e 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