Skip to content

Commit

Permalink
Add User Group Instances endpoint (#406)
Browse files Browse the repository at this point in the history
* Add User Group Instances endpoint

* Add code sample
  • Loading branch information
jellejurre authored Nov 25, 2024
1 parent f656bbe commit 1b35761
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
6 changes: 6 additions & 0 deletions openapi/components/codeSamples/users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@
source: >-
curl -X GET "https://api.vrchat.cloud/api/1/userNotes/{userNoteId}" \
-b "auth={authCookie}"
'/users/{userId}/instances/groups':
get:
- lang: cURL
source: >-
curl -X GET "https://api.vrchat.cloud/api/1/users/{userId}/instances/groups" \
-b "auth={authCookie}"
2 changes: 2 additions & 0 deletions openapi/components/paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@
$ref: "./paths/users.yaml#/paths/~1userNotes"
"/userNotes/{userNoteId}":
$ref: "./paths/users.yaml#/paths/~1userNotes~1{userNoteId}"
"/users/{userId}/instances/groups":
$ref: "./paths/users.yaml#/paths/~1users~1{userId}~1instances~1groups"

# worlds

Expand Down
20 changes: 20 additions & 0 deletions openapi/components/paths/users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,26 @@ paths:
$ref: ../responses/MissingCredentialsError.yaml
operationId: getUserNote
description: Get a particular user note
"/users/{userId}/instances/groups":
parameters:
- $ref: ../parameters.yaml#/userId
get:
summary: Get User Group Instances
x-codeSamples:
$ref: ../codeSamples/users.yaml#/~1users~1{userId}~1instances~1groups/get
description: Returns a list of group instances for a user
operationId: getUserGroupInstances
tags:
- users
responses:
'200':
$ref: ../responses/users/UserGroupInstanceListResponse.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
'403':
$ref: ../responses/users/UserMustBeOwnError.yaml
security:
- authCookie: []
tags:
$ref: ../tags.yaml
components:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description: Returns a list of Instance objects with a fetched at time.
content:
application/json:
schema:
type: object
properties:
fetchedAt:
type: string
format: date-time
instances:
type: array
items:
$ref: ../../schemas/Instance.yaml
11 changes: 11 additions & 0 deletions openapi/components/responses/users/UserMustBeOwnError.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: Error response when trying get group instances of another user.
content:
application/json:
schema:
$ref: ../../schemas/Error.yaml
examples:
User Id must be your own:
value:
error:
message: "User ID must be your own․"
status_code: 403

0 comments on commit 1b35761

Please sign in to comment.