From e98bb6c20f8ea97bfb874f91d75283dc29d406f3 Mon Sep 17 00:00:00 2001 From: JelleJurre <76777936+jellejurre@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:44:18 +0200 Subject: [PATCH] Add notification get endpoint (#398) * Add notification get endpoint * Add description --- .../components/codeSamples/notifications.yaml | 6 ++++++ openapi/components/paths.yaml | 2 ++ openapi/components/paths/notifications.yaml | 20 +++++++++++++++++++ .../NotificationNotFoundError.yaml | 11 ++++++++++ 4 files changed, 39 insertions(+) create mode 100644 openapi/components/responses/notifications/NotificationNotFoundError.yaml diff --git a/openapi/components/codeSamples/notifications.yaml b/openapi/components/codeSamples/notifications.yaml index 7719443b..86035c42 100644 --- a/openapi/components/codeSamples/notifications.yaml +++ b/openapi/components/codeSamples/notifications.yaml @@ -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 diff --git a/openapi/components/paths.yaml b/openapi/components/paths.yaml index d28ecefd..d33d2a8f 100644 --- a/openapi/components/paths.yaml +++ b/openapi/components/paths.yaml @@ -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": diff --git a/openapi/components/paths/notifications.yaml b/openapi/components/paths/notifications.yaml index 54aa1133..3d583303 100644 --- a/openapi/components/paths/notifications.yaml +++ b/openapi/components/paths/notifications.yaml @@ -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 diff --git a/openapi/components/responses/notifications/NotificationNotFoundError.yaml b/openapi/components/responses/notifications/NotificationNotFoundError.yaml new file mode 100644 index 00000000..d9b1012f --- /dev/null +++ b/openapi/components/responses/notifications/NotificationNotFoundError.yaml @@ -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 \ No newline at end of file