diff options
Diffstat (limited to 'support/doc/api/openapi.yaml')
-rw-r--r-- | support/doc/api/openapi.yaml | 134 |
1 files changed, 130 insertions, 4 deletions
diff --git a/support/doc/api/openapi.yaml b/support/doc/api/openapi.yaml index 77d55d749..7b8461c72 100644 --- a/support/doc/api/openapi.yaml +++ b/support/doc/api/openapi.yaml | |||
@@ -273,6 +273,8 @@ tags: | |||
273 | description: Operations on video files | 273 | description: Operations on video files |
274 | - name: Video Transcoding | 274 | - name: Video Transcoding |
275 | description: Video transcoding related operations | 275 | description: Video transcoding related operations |
276 | - name: Video stats | ||
277 | description: Video statistics | ||
276 | - name: Feeds | 278 | - name: Feeds |
277 | description: Server syndication feeds | 279 | description: Server syndication feeds |
278 | - name: Search | 280 | - name: Search |
@@ -314,6 +316,7 @@ x-tagGroups: | |||
314 | - Video Comments | 316 | - Video Comments |
315 | - Video Rates | 317 | - Video Rates |
316 | - Video Playlists | 318 | - Video Playlists |
319 | - Video Stats | ||
317 | - Video Ownership Change | 320 | - Video Ownership Change |
318 | - Video Mirroring | 321 | - Video Mirroring |
319 | - Video Files | 322 | - Video Files |
@@ -1902,12 +1905,19 @@ paths: | |||
1902 | 1905 | ||
1903 | '/videos/{id}/views': | 1906 | '/videos/{id}/views': |
1904 | post: | 1907 | post: |
1905 | summary: Add a view to a video | 1908 | summary: Notify user is watching a video |
1909 | description: Call this endpoint regularly (every 5-10 seconds for example) to notify the server the user is watching the video. After a while, PeerTube will increase video's viewers counter. If the user is authenticated, PeerTube will also store the current player time. | ||
1906 | operationId: addView | 1910 | operationId: addView |
1907 | tags: | 1911 | tags: |
1908 | - Video | 1912 | - Video |
1909 | parameters: | 1913 | parameters: |
1910 | - $ref: '#/components/parameters/idOrUUID' | 1914 | - $ref: '#/components/parameters/idOrUUID' |
1915 | requestBody: | ||
1916 | content: | ||
1917 | application/json: | ||
1918 | schema: | ||
1919 | $ref: '#/components/schemas/UserViewingVideo' | ||
1920 | required: true | ||
1911 | responses: | 1921 | responses: |
1912 | '204': | 1922 | '204': |
1913 | description: successful operation | 1923 | description: successful operation |
@@ -1915,7 +1925,8 @@ paths: | |||
1915 | '/videos/{id}/watching': | 1925 | '/videos/{id}/watching': |
1916 | put: | 1926 | put: |
1917 | summary: Set watching progress of a video | 1927 | summary: Set watching progress of a video |
1918 | operationId: setProgress | 1928 | deprecated: true |
1929 | description: This endpoint has been deprecated. Use `/videos/{id}/views` instead | ||
1919 | tags: | 1930 | tags: |
1920 | - Video | 1931 | - Video |
1921 | security: | 1932 | security: |
@@ -1926,12 +1937,73 @@ paths: | |||
1926 | content: | 1937 | content: |
1927 | application/json: | 1938 | application/json: |
1928 | schema: | 1939 | schema: |
1929 | $ref: '#/components/schemas/UserWatchingVideo' | 1940 | $ref: '#/components/schemas/UserViewingVideo' |
1930 | required: true | 1941 | required: true |
1931 | responses: | 1942 | responses: |
1932 | '204': | 1943 | '204': |
1933 | description: successful operation | 1944 | description: successful operation |
1934 | 1945 | ||
1946 | '/videos/{id}/stats/overall': | ||
1947 | get: | ||
1948 | summary: Get overall stats of a video | ||
1949 | tags: | ||
1950 | - Video Stats | ||
1951 | security: | ||
1952 | - OAuth2: [] | ||
1953 | parameters: | ||
1954 | - $ref: '#/components/parameters/idOrUUID' | ||
1955 | responses: | ||
1956 | '200': | ||
1957 | description: successful operation | ||
1958 | content: | ||
1959 | application/json: | ||
1960 | schema: | ||
1961 | $ref: '#/components/schemas/VideoStatsOverall' | ||
1962 | |||
1963 | '/videos/{id}/stats/retention': | ||
1964 | get: | ||
1965 | summary: Get retention stats of a video | ||
1966 | tags: | ||
1967 | - Video Stats | ||
1968 | security: | ||
1969 | - OAuth2: [] | ||
1970 | parameters: | ||
1971 | - $ref: '#/components/parameters/idOrUUID' | ||
1972 | responses: | ||
1973 | '200': | ||
1974 | description: successful operation | ||
1975 | content: | ||
1976 | application/json: | ||
1977 | schema: | ||
1978 | $ref: '#/components/schemas/VideoStatsRetention' | ||
1979 | |||
1980 | '/videos/{id}/stats/timeseries/{metric}': | ||
1981 | get: | ||
1982 | summary: Get timeserie stats of a video | ||
1983 | tags: | ||
1984 | - Video Stats | ||
1985 | security: | ||
1986 | - OAuth2: [] | ||
1987 | parameters: | ||
1988 | - $ref: '#/components/parameters/idOrUUID' | ||
1989 | - | ||
1990 | name: metric | ||
1991 | in: path | ||
1992 | required: true | ||
1993 | description: The metric to get | ||
1994 | schema: | ||
1995 | type: string | ||
1996 | enum: | ||
1997 | - 'viewers' | ||
1998 | - 'aggregateWatchTime' | ||
1999 | responses: | ||
2000 | '200': | ||
2001 | description: successful operation | ||
2002 | content: | ||
2003 | application/json: | ||
2004 | schema: | ||
2005 | $ref: '#/components/schemas/VideoStatsTimeserie' | ||
2006 | |||
1935 | /videos/upload: | 2007 | /videos/upload: |
1936 | post: | 2008 | post: |
1937 | summary: Upload a video | 2009 | summary: Upload a video |
@@ -6054,13 +6126,67 @@ components: | |||
6054 | description: | 6126 | description: |
6055 | type: string | 6127 | type: string |
6056 | description: text or bio displayed on the account's profile | 6128 | description: text or bio displayed on the account's profile |
6057 | UserWatchingVideo: | 6129 | UserViewingVideo: |
6058 | properties: | 6130 | properties: |
6059 | currentTime: | 6131 | currentTime: |
6060 | type: integer | 6132 | type: integer |
6061 | format: seconds | 6133 | format: seconds |
6062 | description: timestamp within the video, in seconds | 6134 | description: timestamp within the video, in seconds |
6063 | example: 5 | 6135 | example: 5 |
6136 | |||
6137 | VideoStatsOverall: | ||
6138 | properties: | ||
6139 | averageWatchTime: | ||
6140 | type: number | ||
6141 | totalWatchTime: | ||
6142 | type: number | ||
6143 | viewersPeak: | ||
6144 | type: number | ||
6145 | viewersPeakDate: | ||
6146 | type: string | ||
6147 | format: date-time | ||
6148 | views: | ||
6149 | type: number | ||
6150 | likes: | ||
6151 | type: number | ||
6152 | dislikes: | ||
6153 | type: number | ||
6154 | comments: | ||
6155 | type: number | ||
6156 | countries: | ||
6157 | type: array | ||
6158 | items: | ||
6159 | type: object | ||
6160 | properties: | ||
6161 | isoCode: | ||
6162 | type: string | ||
6163 | viewers: | ||
6164 | type: number | ||
6165 | |||
6166 | VideoStatsRetention: | ||
6167 | properties: | ||
6168 | data: | ||
6169 | type: array | ||
6170 | items: | ||
6171 | type: object | ||
6172 | properties: | ||
6173 | second: | ||
6174 | type: number | ||
6175 | retentionPercent: | ||
6176 | type: number | ||
6177 | |||
6178 | VideoStatsTimeserie: | ||
6179 | properties: | ||
6180 | data: | ||
6181 | type: array | ||
6182 | items: | ||
6183 | type: object | ||
6184 | properties: | ||
6185 | date: | ||
6186 | type: string | ||
6187 | value: | ||
6188 | type: number | ||
6189 | |||
6064 | ServerConfig: | 6190 | ServerConfig: |
6065 | properties: | 6191 | properties: |
6066 | instance: | 6192 | instance: |