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

Add notification get endpoint #398

Merged
Merged
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
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