diff --git a/docs/controllers/SessionController.yaml b/docs/controllers/SessionController.yaml new file mode 100644 index 000000000..70cab2843 --- /dev/null +++ b/docs/controllers/SessionController.yaml @@ -0,0 +1,55 @@ +paths: + /api/session/{id}/sync: + post: + operationId: syncOpenSession + summary: Sync an open session. + description: Sync an open session. + tags: + - Session + parameters: + - name: id + in: path + description: The ID of the session. + required: true + schema: + $ref: '../objects/entities/PlaybackSession.yaml#/components/schemas/playbackSessionId' + - name: currentTime + in: query + description: The current time of the session. + required: true + schema: + $ref: '../schemas.yaml#/components/schemas/durationSec' + - name: timeListened + in: query + description: The time listened to the session. + required: true + schema: + $ref: '../schemas.yaml#/components/schemas/durationSec' + - name: duration + in: query + description: The duration of the session. + required: true + schema: + $ref: '../schemas.yaml#/components/schemas/durationSec' + responses: + '200': + description: OK + content: + html/text: + schema: + type: string + example: OK + '404': + description: No listening session with the provided ID is open, or the session belongs to another user. + content: + html/text: + schema: + type: string + example: Not Found + '500': + description: There was an error syncing the session. + content: + html/text: + schema: + type: string + example: Internal Server Error diff --git a/docs/openapi.json b/docs/openapi.json index d72acb3e6..c5edd2706 100644 Binary files a/docs/openapi.json and b/docs/openapi.json differ diff --git a/docs/root.yaml b/docs/root.yaml index ff2c6f21f..63462a22c 100644 --- a/docs/root.yaml +++ b/docs/root.yaml @@ -91,6 +91,8 @@ paths: $ref: './controllers/MeController.yaml#/paths/~1api~1me~1progress~1{libraryItemId}~1{episodeId}' /api/me/progress/{mediaId}: $ref: './controllers/MeController.yaml#/paths/~1api~1me~1progress~1{mediaId}' + /api/session/{id}/sync: + $ref: './controllers/SessionController.yaml#/paths/~1api~1session~1{id}~1sync' tags: - name: Authors description: Author endpoints