Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Add image endpoints #408

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions openapi/components/codeSamples/files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 6 additions & 0 deletions openapi/components/paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
90 changes: 90 additions & 0 deletions openapi/components/paths/files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions openapi/components/schemas/File.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
description: ''
properties:
animationStyle:
type: string
example: bats
maskTag:
type: string
example: square
extension:
example: .unitypackage
minLength: 1
Expand Down