Skip to content

Commit

Permalink
Add notification get endpoint (#398)
Browse files Browse the repository at this point in the history
* Add notification get endpoint

* Add description
  • Loading branch information
jellejurre authored Oct 7, 2024
1 parent 573deca commit e98bb6c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
6 changes: 6 additions & 0 deletions openapi/components/codeSamples/notifications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
source: >-
curl -X GET "https://vrchat.com/api/1/auth/user/notifications?type=all" \
-b "auth={authCookie}"
/auth/user/notifications/{notificationId}:
get:
- lang: cURL
source: >-
curl -X GET "https://vrchat.com/api/1/auth/user/notifications/{notificationId}" \
-b "auth={authCookie}"
'/auth/user/notifications/{notificationId}/accept':
put:
- lang: cURL
Expand Down
2 changes: 2 additions & 0 deletions openapi/components/paths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@

"/auth/user/notifications":
$ref: "./paths/notifications.yaml#/paths/~1auth~1user~1notifications"
"/auth/user/notifications/{notificationId}":
$ref: "./paths/notifications.yaml#/paths/~1auth~1user~1notifications~1{notificationId}"
"/auth/user/notifications/{notificationId}/accept":
$ref: "./paths/notifications.yaml#/paths/~1auth~1user~1notifications~1{notificationId}~1accept"
"/auth/user/notifications/{notificationId}/see":
Expand Down
20 changes: 20 additions & 0 deletions openapi/components/paths/notifications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,26 @@ paths:
description: Only return notifications sent after this Date. Ignored if type is `friendRequest`.
- $ref: ../parameters.yaml#/number
- $ref: ../parameters.yaml#/offset
'/auth/user/notifications/{notificationId}':
parameters:
- $ref: ../parameters.yaml#/notificationId
get:
summary: Show notification
operationId: getNotification
tags:
- notifications
x-codeSamples:
$ref: "../codeSamples/notifications.yaml#/~1auth~1user~1notifications~1{notificationId}/get"
responses:
'200':
$ref: ../responses/notifications/NotificationResponse.yaml
'401':
$ref: ../responses/MissingCredentialsError.yaml
'404':
$ref: ../responses/notifications/NotificationNotFoundError.yaml
security:
- authCookie: []
description: Get a notification by notification `not_` ID.
'/auth/user/notifications/{notificationId}/see':
parameters:
- $ref: ../parameters.yaml#/notificationId
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: Error response when trying to perform operations on a non-existing notification.
content:
application/json:
schema:
$ref: ../../schemas/Error.yaml
examples:
404 World Not Found:
value:
error:
message: "Notification not found"
status_code: 404

0 comments on commit e98bb6c

Please sign in to comment.