From c100a6142e6571312db9f6407698a21a08b593fb Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Tue, 9 Apr 2019 11:02:02 +0200 Subject: Add /accounts/:username/ratings endpoint (#1756) * Add /users/me/videos/ratings endpoint * Move ratings endpoint from users to accounts * /accounts/:name/ratings: add support for rating= and sort= * Restrict ratings list to owner * Wording and better way to ensure current account --- support/doc/api/openapi.yaml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'support/doc/api/openapi.yaml') diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 46c66a101..833a98d3b 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml @@ -1344,6 +1344,35 @@ paths: type: array items: $ref: '#/components/schemas/VideoChannel' + '/accounts/{name}/ratings': + get: + summary: Get ratings of an account by its name + security: + - OAuth2: [] + tags: + - User + parameters: + - $ref: '#/components/parameters/start' + - $ref: '#/components/parameters/count' + - $ref: '#/components/parameters/sort' + - name: rating + in: query + required: false + description: Optionaly filter which ratings to retrieve + schema: + type: string + enum: + - like + - dislike + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/VideoRating' '/videos/{id}/comment-threads': get: summary: Get the comment threads of a video by its id @@ -2142,6 +2171,16 @@ components: required: - id - rating + VideoRating: + properties: + video: + $ref: '#/components/schemas/Video' + rating: + type: number + description: 'Rating of the video' + required: + - video + - rating RegisterUser: properties: username: -- cgit v1.2.3