Skip to content

Commit

Permalink
User- and file-related endpoints (#413)
Browse files Browse the repository at this point in the history
* User- and file-related endpoints

`GET /auth/user/favoritelimits`
`GET /analysis/{fileId}/{versionId}`
`GET /analysis/{fileId}/{versionId}/security`
`GET /analysis/{fileId}/{versionId}/standard`
`GET /users/{userId}/feedback`
`GET /userNotes`
`POST /userNotes`
`GET /userNotes/{userNoteId}`

* Fix mistakes

* Fix double spaces

* Remove extraneous description

* Add contentId filter to feedback

* Update openapi/components/paths/users.yaml

Co-authored-by: Lars Olzem <hackebein@gmail.com>

* Add targetuser to user note

* typo

* relocate `deprecated` property to method instead of path

* Make targetuser optional

---------

Co-authored-by: JelleJurre <76777936+jellejurre@users.noreply.github.com>
Co-authored-by: Lars Olzem <hackebein@gmail.com>
Co-authored-by: jellejurre <jelle@jilles.com>
  • Loading branch information
4 people authored Nov 20, 2024
1 parent ea94d83 commit 30ad99c
Show file tree
Hide file tree
Showing 22 changed files with 547 additions and 3 deletions.
6 changes: 6 additions & 0 deletions openapi/components/codeSamples/favorites.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,9 @@
source: >-
curl -X DELETE "https://vrchat.com/api/1/favorite/group/{favoriteGroupType}/{favoriteGroupName}/{userId}" \
-b "auth={authCookie}"
'/auth/user/favoritelimits':
get:
- lang: cURL
source: >-
curl -X GET "https://vrchat.com/api/1/auth/user/favoritelimits" \
-b "auth={authCookie}"
20 changes: 19 additions & 1 deletion openapi/components/codeSamples/files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,27 @@
source: >-
curl -X PUT "https://vrchat.com/api/1/file/{fileId}/{versionId}/{fileType}/start" \
-b "auth={authCookie}"
/file/{fieldId}/{versionId}/{fileType}/status:
/file/{fileId}/{versionId}/{fileType}/status:
get:
- lang: cURL
source: >-
curl -X GET "https://vrchat.com/api/1/file/{fileId}/{versionId}/{fileType}/status" \
-b "auth={authCookie}"
/analysis/{fileId}/{versionId}:
get:
- lang: cURL
source: >-
curl -X GET "https://vrchat.com/api/1/file/{fileId}/{versionId}" \
-b "auth={authCookie}"
/analysis/{fileId}/{versionId}/security:
get:
- lang: cURL
source: >-
curl -X GET "https://vrchat.com/api/1/file/{fileId}/{versionId}/security" \
-b "auth={authCookie}"
/analysis/{fileId}/{versionId}/standard:
get:
- lang: cURL
source: >-
curl -X GET "https://vrchat.com/api/1/file/{fileId}/{versionId}/standard" \
-b "auth={authCookie}"
27 changes: 26 additions & 1 deletion openapi/components/codeSamples/users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,32 @@
put:
- lang: cURL
source: >-
curl -X GET "https://vrchat.com/api/1/users/{userId}" \
curl -X PUT "https://vrchat.com/api/1/users/{userId}" \
-H "Content-Type: application/json" \
-b "auth={authCookie}" \
--data '{"email": "string", "birthday": "2019-08-24", "acceptedTOSVersion": 0, "tags": ["string"], "status": "active", "statusDescription": "string", "bio": "string", "bioLinks": ["string"], "userIcon": "https://vrchat.com/api/1/file/file_76dc2964-0ce8-41df-b2e7-8edf994fee31/1"}'
'/users/{userId}/feedback':
get:
- lang: cURL
source: >-
curl -X GET "https://vrchat.com/api/1/users/{userId}/feedback?n=100" \
-b "auth={authCookie}"
'/userNotes':
get:
- lang: cURL
source: >-
curl -X GET "https://vrchat.com/api/1/userNotes?n=100" \
-b "auth={authCookie}"
post:
- lang: cURL
source: >-
curl -X POST "https://vrchat.com/api/1/userNotes" \
-H "Content-Type: application/json" \
-b "auth={authCookie}" \
--data '{"targetUserId": "userId", "note": "string"}'
'/userNotes/{userNoteId}':
get:
- lang: cURL
source: >-
curl -X GET "https://vrchat.com/api/1/userNotes/{userNoteId}" \
-b "auth={authCookie}"
14 changes: 14 additions & 0 deletions openapi/components/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ userIdQuery:
schema:
type: string
description: Filter by UserID.
userNoteId:
name: userNoteId
in: path
required: true
schema:
type: string
description: Must be a valid user note ID.
usernameQuery:
name: username
in: query
Expand Down Expand Up @@ -359,6 +366,13 @@ productId:
schema:
type: string
description: Must be a valid product ID.
contentId:
name: contentId
in: query
required: false
schema:
type: boolean
description: Filter for users' previously submitted feedback, e.g., a groupId, useeId, avatarId, etc.
active:
name: active
in: query
Expand Down
14 changes: 14 additions & 0 deletions openapi/components/paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
$ref: "./paths/favorites.yaml#/paths/~1favorite~1groups"
"/favorite/group/{favoriteGroupType}/{favoriteGroupName}/{userId}":
$ref: "./paths/favorites.yaml#/paths/~1favorite~1group~1{favoriteGroupType}~1{favoriteGroupName}~1{userId}"
"/auth/user/favoritelimits":
$ref: "./paths/favorites.yaml#/paths/~1auth~1user~1favoritelimits"

# files

Expand All @@ -92,6 +94,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"
"/analysis/{fileId}/{versionId}":
$ref: "./paths/files.yaml#/paths/~1analysis~1{fileId}~1{versionId}"
"/analysis/{fileId}/{versionId}/security":
$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"

# friends

Expand Down Expand Up @@ -256,6 +264,12 @@
$ref: "./paths/users.yaml#/paths/~1users~1{userId}~1groups~1requested"
"/users/{userId}/groups/represented":
$ref: "./paths/users.yaml#/paths/~1users~1{userId}~1groups~1represented"
"/users/{userId}/feedback":
$ref: "./paths/users.yaml#/paths/~1users~1{userId}~1feedback"
"/userNotes":
$ref: "./paths/users.yaml#/paths/~1userNotes"
"/userNotes/{userNoteId}":
$ref: "./paths/users.yaml#/paths/~1userNotes~1{userNoteId}"

# worlds

Expand Down
18 changes: 18 additions & 0 deletions openapi/components/paths/favorites.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,24 @@ paths:
tags:
- favorites
description: Clear ALL contents of a specific favorite group.
'/auth/user/favoritelimits':
parameters: []
get:
summary: Get Favorite Limits
tags:
- favorites
x-codeSamples:
$ref: "../codeSamples/favorites.yaml#/~1auth~1user~1favoritelimits/get"
responses:
'200':
$ref: ../responses/favorites/FavoriteLimitsResponse.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
operationId: getFavoriteLimits
security:
- authCookie: []
description: Return information about a specific Favorite.
parameters: []
tags:
$ref: ../tags.yaml
components:
Expand Down
59 changes: 58 additions & 1 deletion openapi/components/paths/files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ paths:
tags:
- files
x-codeSamples:
$ref: "../codeSamples/files.yaml#/~1file~1{fieldId}~1{versionId}~1{fileType}~1status/get"
$ref: "../codeSamples/files.yaml#/~1file~1{fileId}~1{versionId}~1{fileType}~1status/get"
responses:
'200':
$ref: ../responses/files/FileVersionUploadStatusResponse.yaml
Expand Down Expand Up @@ -231,6 +231,63 @@ 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.
'/analysis/{fileId}/{versionId}':
parameters:
- $ref: ../parameters.yaml#/fileId
- $ref: ../parameters.yaml#/versionId
get:
summary: Get File Version Analysis
tags:
- files
x-codeSamples:
$ref: "../codeSamples/files.yaml#/~1analysis~1{fileId}~1{versionId}/get"
responses:
'200':
$ref: ../responses/files/FileAnalysisResponse.yaml
'404':
$ref: ../responses/files/FileNotFoundError.yaml
operationId: getFileAnalysis
security:
- authCookie: []
description: Get the performance analysis for the uploaded assets of an avatar
'/analysis/{fileId}/{versionId}/security':
parameters:
- $ref: ../parameters.yaml#/fileId
- $ref: ../parameters.yaml#/versionId
get:
summary: Get File Version Analysis Security
tags:
- files
x-codeSamples:
$ref: "../codeSamples/files.yaml#/~1analysis~1{fileId}~1{versionId}~1security/get"
responses:
'200':
$ref: ../responses/files/FileAnalysisResponse.yaml
'404':
$ref: ../responses/files/FileNotFoundError.yaml
operationId: getFileAnalysisSecurity
security:
- authCookie: []
description: Get the security performance analysis for the uploaded assets of an avatar
'/analysis/{fileId}/{versionId}/standard':
parameters:
- $ref: ../parameters.yaml#/fileId
- $ref: ../parameters.yaml#/versionId
get:
summary: Get File Version Analysis Standard
tags:
- files
x-codeSamples:
$ref: "../codeSamples/files.yaml#/~1analysis~1{fileId}~1{versionId}~1standard/get"
responses:
'200':
$ref: ../responses/files/FileAnalysisResponse.yaml
'404':
$ref: ../responses/files/FileNotFoundError.yaml
operationId: getFileAnalysisStandard
security:
- authCookie: []
description: Get the standard performance analysis for the uploaded assets of an avatar
tags:
$ref: ../tags.yaml
components:
Expand Down
80 changes: 80 additions & 0 deletions openapi/components/paths/users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,86 @@ paths:
$ref: ../responses/MissingCredentialsError.yaml
security:
- authCookie: []
'/users/{userId}/feedback':
parameters:
- $ref: ../parameters.yaml#/userId
- $ref: ../parameters.yaml#/contentId
- $ref: ../parameters.yaml#/number
- $ref: ../parameters.yaml#/offset
get:
summary: Get User Feedback
x-codeSamples:
$ref: ../codeSamples/users.yaml#/~1users~1{userId}~1feedback/get
tags:
- users
deprecated: true
security:
- authCookie: []
responses:
'200':
$ref: ../responses/users/FeedbackListResponse.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
operationId: getUserFeedback
description: Get user's submitted feedback
'/userNotes':
get:
summary: Get User Notes
x-codeSamples:
$ref: ../codeSamples/users.yaml#/~1userNotes/get
tags:
- users
security:
- authCookie: []
responses:
'200':
$ref: ../responses/users/UserNoteListResponse.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
operationId: getUserNotes
parameters:
- $ref: ../parameters.yaml#/number
- $ref: ../parameters.yaml#/offset
description: Get recently updated user notes
post:
summary: Update User Note
tags:
- users
x-codeSamples:
$ref: ../codeSamples/users.yaml#/~1userNotes/post
responses:
'200':
$ref: ../responses/users/UserNoteResponse.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
operationId: updateUserNote
security:
- authCookie: []
description: Updates the currently authenticated user's note on a user
requestBody:
required: true
content:
application/json:
schema:
$ref: ../requests/UpdateUserNoteRequest.yaml
'/userNotes/{userNoteId}':
parameters:
- $ref: ../parameters.yaml#/userNoteId
get:
summary: Get User Note
x-codeSamples:
$ref: ../codeSamples/users.yaml#/~1userNotes~1{userNoteId}/get
tags:
- users
security:
- authCookie: []
responses:
'200':
$ref: ../responses/users/UserNoteResponse.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
operationId: getUserNote
description: Get a particular user note
tags:
$ref: ../tags.yaml
components:
Expand Down
10 changes: 10 additions & 0 deletions openapi/components/requests/UpdateUserNoteRequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
title: UpdateUserNoteRequest
type: object
properties:
targetUserId:
$ref: ../schemas/UserID.yaml
note:
type: string
required:
- targetUserId
- note
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: Returns a single FavoriteLimits object.
content:
application/json:
schema:
$ref: ../../schemas/FavoriteLimits.yaml
5 changes: 5 additions & 0 deletions openapi/components/responses/files/FileAnalysisResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: Returns a single FileAnalysis object.
content:
application/json:
schema:
$ref: ../../schemas/FileAnalysis.yaml
7 changes: 7 additions & 0 deletions openapi/components/responses/users/FeedbackListResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: Returns a list of Feedback objects.
content:
application/json:
schema:
type: array
items:
$ref: ../../schemas/Feedback.yaml
7 changes: 7 additions & 0 deletions openapi/components/responses/users/UserNoteListResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: Returns a list of UserNote objects.
content:
application/json:
schema:
type: array
items:
$ref: ../../schemas/UserNote.yaml
5 changes: 5 additions & 0 deletions openapi/components/responses/users/UserNoteResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
description: Returns a single UserNote object.
content:
application/json:
schema:
$ref: ../../schemas/UserNote.yaml
13 changes: 13 additions & 0 deletions openapi/components/schemas/FavoriteGroupLimits.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
title: FavoriteGroupLimits
type: object
properties:
avatar:
type: integer
friend:
type: integer
world:
type: integer
required:
- avatar
- friend
- world
Loading

0 comments on commit 30ad99c

Please sign in to comment.