Libraries endpoint documentation
This commit is contained in:
parent
65dd21d1a3
commit
4aabcf8d57
206
docs/swagger.yml
206
docs/swagger.yml
|
@ -1,3 +1,16 @@
|
||||||
|
# Undocumented endpoints:
|
||||||
|
# /api/v1/settings
|
||||||
|
# /api/v1/activity
|
||||||
|
# /api/v1/uploads
|
||||||
|
# /api/v1/listen
|
||||||
|
# /api/v1/playlists
|
||||||
|
# /api/v1/playlist-tracks
|
||||||
|
# /api/v1/favorites
|
||||||
|
# /api/v1/search
|
||||||
|
# /api/v1/radios
|
||||||
|
# /api/v1/history
|
||||||
|
# /api/v1/users
|
||||||
|
|
||||||
openapi: "3.0.0"
|
openapi: "3.0.0"
|
||||||
info:
|
info:
|
||||||
description: "Documentation for [Funkwhale](https://funkwhale.audio) API. The API is **not** stable yet."
|
description: "Documentation for [Funkwhale](https://funkwhale.audio) API. The API is **not** stable yet."
|
||||||
|
@ -30,11 +43,21 @@ components:
|
||||||
security:
|
security:
|
||||||
- jwt: []
|
- jwt: []
|
||||||
|
|
||||||
|
tags:
|
||||||
|
- name: Auth and security
|
||||||
|
description: Login, logout and authorization endpoints
|
||||||
|
- name: Library and metadata
|
||||||
|
description: Information and metadata about musical and audio entities (albums, tracks, artists, etc.)
|
||||||
|
- name: Uploads and audio content
|
||||||
|
description: Manipulation and uploading of audio files
|
||||||
|
externalDocs:
|
||||||
|
url: https://docs.funkwhale.audio/users/managing.html
|
||||||
|
|
||||||
paths:
|
paths:
|
||||||
/token/:
|
/token/:
|
||||||
post:
|
post:
|
||||||
tags:
|
tags:
|
||||||
- "auth"
|
- "Auth and security"
|
||||||
description:
|
description:
|
||||||
Obtain a JWT token you can use for authenticating your next requests.
|
Obtain a JWT token you can use for authenticating your next requests.
|
||||||
security: []
|
security: []
|
||||||
|
@ -61,7 +84,7 @@ paths:
|
||||||
get:
|
get:
|
||||||
summary: List artists
|
summary: List artists
|
||||||
tags:
|
tags:
|
||||||
- "artists"
|
- "Library and metadata"
|
||||||
parameters:
|
parameters:
|
||||||
- name: "q"
|
- name: "q"
|
||||||
in: "query"
|
in: "query"
|
||||||
|
@ -106,7 +129,7 @@ paths:
|
||||||
- $ref: "#/parameters/ObjectId"
|
- $ref: "#/parameters/ObjectId"
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- "artists"
|
- "Library and metadata"
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
content:
|
content:
|
||||||
|
@ -127,8 +150,7 @@ paths:
|
||||||
- $ref: "#/parameters/PageSize"
|
- $ref: "#/parameters/PageSize"
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- "artists"
|
- "Library and metadata"
|
||||||
- "libraries"
|
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
content:
|
content:
|
||||||
|
@ -145,7 +167,7 @@ paths:
|
||||||
get:
|
get:
|
||||||
summary: List albums
|
summary: List albums
|
||||||
tags:
|
tags:
|
||||||
- "albums"
|
- "Library and metadata"
|
||||||
parameters:
|
parameters:
|
||||||
- name: "q"
|
- name: "q"
|
||||||
in: "query"
|
in: "query"
|
||||||
|
@ -198,7 +220,7 @@ paths:
|
||||||
- $ref: "#/parameters/ObjectId"
|
- $ref: "#/parameters/ObjectId"
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- "albums"
|
- "Library and metadata"
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
content:
|
content:
|
||||||
|
@ -220,8 +242,7 @@ paths:
|
||||||
- $ref: "#/parameters/PageSize"
|
- $ref: "#/parameters/PageSize"
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- "albums"
|
- "Library and metadata"
|
||||||
- "libraries"
|
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
content:
|
content:
|
||||||
|
@ -238,7 +259,7 @@ paths:
|
||||||
get:
|
get:
|
||||||
summary: List tracks
|
summary: List tracks
|
||||||
tags:
|
tags:
|
||||||
- "tracks"
|
- "Library and metadata"
|
||||||
parameters:
|
parameters:
|
||||||
- name: "q"
|
- name: "q"
|
||||||
in: "query"
|
in: "query"
|
||||||
|
@ -302,12 +323,12 @@ paths:
|
||||||
$ref: "#/definitions/Track"
|
$ref: "#/definitions/Track"
|
||||||
/tracks/{id}/:
|
/tracks/{id}/:
|
||||||
get:
|
get:
|
||||||
summary: Retrieve a single track
|
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/ObjectId"
|
- $ref: "#/parameters/ObjectId"
|
||||||
|
summary: Retrieve a single track
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- "tracks"
|
- "Library and metadata"
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
content:
|
content:
|
||||||
|
@ -329,8 +350,7 @@ paths:
|
||||||
- $ref: "#/parameters/PageSize"
|
- $ref: "#/parameters/PageSize"
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- "tracks"
|
- "Library and metadata"
|
||||||
- "libraries"
|
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
content:
|
content:
|
||||||
|
@ -347,7 +367,7 @@ paths:
|
||||||
get:
|
get:
|
||||||
summary: List licenses
|
summary: List licenses
|
||||||
tags:
|
tags:
|
||||||
- "licenses"
|
- "Library and metadata"
|
||||||
parameters:
|
parameters:
|
||||||
- $ref: "#/parameters/PageNumber"
|
- $ref: "#/parameters/PageNumber"
|
||||||
- $ref: "#/parameters/PageSize"
|
- $ref: "#/parameters/PageSize"
|
||||||
|
@ -366,8 +386,6 @@ paths:
|
||||||
$ref: "#/definitions/License"
|
$ref: "#/definitions/License"
|
||||||
|
|
||||||
/licenses/{code}/:
|
/licenses/{code}/:
|
||||||
get:
|
|
||||||
summary: Retrieve a single license
|
|
||||||
parameters:
|
parameters:
|
||||||
- name: code
|
- name: code
|
||||||
in: path
|
in: path
|
||||||
|
@ -376,9 +394,11 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
example: cc0-1.0
|
example: cc0-1.0
|
||||||
|
get:
|
||||||
|
summary: Retrieve a single license
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
- "licenses"
|
- "Library and metadata"
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
content:
|
content:
|
||||||
|
@ -391,6 +411,89 @@ paths:
|
||||||
schema:
|
schema:
|
||||||
$ref: "#/definitions/ResourceNotFound"
|
$ref: "#/definitions/ResourceNotFound"
|
||||||
|
|
||||||
|
/libraries/:
|
||||||
|
get:
|
||||||
|
summary: List owned libraries
|
||||||
|
tags:
|
||||||
|
- "Uploads and audio content"
|
||||||
|
parameters:
|
||||||
|
- $ref: "#/parameters/PageNumber"
|
||||||
|
- $ref: "#/parameters/PageSize"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
allOf:
|
||||||
|
- $ref: "#/definitions/ResultPage"
|
||||||
|
- type: "object"
|
||||||
|
properties:
|
||||||
|
results:
|
||||||
|
type: "array"
|
||||||
|
items:
|
||||||
|
$ref: "#/definitions/OwnedLibrary"
|
||||||
|
post:
|
||||||
|
tags:
|
||||||
|
- "Uploads and audio content"
|
||||||
|
description:
|
||||||
|
Create a new library
|
||||||
|
security: []
|
||||||
|
responses:
|
||||||
|
201:
|
||||||
|
$ref: "#/responses/201"
|
||||||
|
400:
|
||||||
|
$ref: "#/responses/400"
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/OwnedLibraryCreate"
|
||||||
|
|
||||||
|
/libraries/{uuid}/:
|
||||||
|
parameters:
|
||||||
|
- name: uuid
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: "string"
|
||||||
|
format: "uuid"
|
||||||
|
get:
|
||||||
|
summary: Retrieve a library
|
||||||
|
tags:
|
||||||
|
- "Uploads and audio content"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/OwnedLibrary"
|
||||||
|
post:
|
||||||
|
summary: Update a library
|
||||||
|
tags:
|
||||||
|
- "Uploads and audio content"
|
||||||
|
requestBody:
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/OwnedLibraryCreate"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/definitions/OwnedLibrary"
|
||||||
|
delete:
|
||||||
|
summary: Delete a library and all associated uploads
|
||||||
|
description: |
|
||||||
|
This will delete the library, all associated uploads, follows, and broadcast
|
||||||
|
the event on the federation.
|
||||||
|
tags:
|
||||||
|
- "Uploads and audio content"
|
||||||
|
responses:
|
||||||
|
204:
|
||||||
|
$ref: "#/responses/204"
|
||||||
|
|
||||||
parameters:
|
parameters:
|
||||||
ObjectId:
|
ObjectId:
|
||||||
|
@ -434,11 +537,35 @@ parameters:
|
||||||
required: false
|
required: false
|
||||||
type: "boolean"
|
type: "boolean"
|
||||||
|
|
||||||
|
responses:
|
||||||
|
201:
|
||||||
|
description: Successfully created
|
||||||
|
204:
|
||||||
|
description: Successfully deleted
|
||||||
|
400:
|
||||||
|
description: Bad request
|
||||||
|
|
||||||
properties:
|
properties:
|
||||||
mbid:
|
mbid:
|
||||||
type: "string"
|
type: "string"
|
||||||
formats: "uuid"
|
format: "uuid"
|
||||||
description: "A musicbrainz ID"
|
description: "A musicbrainz ID"
|
||||||
|
creation_date:
|
||||||
|
type: "string"
|
||||||
|
format: "date-time"
|
||||||
|
privacy_level:
|
||||||
|
type: string
|
||||||
|
example: "me"
|
||||||
|
description: "'me' means private, 'instance' means viewable by local users, 'everyone' means public"
|
||||||
|
enum:
|
||||||
|
- "me"
|
||||||
|
- "instance"
|
||||||
|
- "everyone"
|
||||||
|
fid:
|
||||||
|
type: "string"
|
||||||
|
format: "uri"
|
||||||
|
description: "Federation ID"
|
||||||
|
example: "https://my.instance/federation/music/libraries/3fa85f64-5717-4562-b3fc-2c963f66afa6"
|
||||||
|
|
||||||
definitions:
|
definitions:
|
||||||
ResultPage:
|
ResultPage:
|
||||||
|
@ -793,6 +920,47 @@ definitions:
|
||||||
format: "uri"
|
format: "uri"
|
||||||
description: "URL to stream the upload"
|
description: "URL to stream the upload"
|
||||||
|
|
||||||
|
OwnedLibraryCreate:
|
||||||
|
type: "object"
|
||||||
|
properties:
|
||||||
|
password:
|
||||||
|
type: "name"
|
||||||
|
example: "My new library"
|
||||||
|
description:
|
||||||
|
required: false
|
||||||
|
type: "string"
|
||||||
|
example: "Lots of interesting content"
|
||||||
|
privacy_level:
|
||||||
|
$ref: "#/properties/privacy_level"
|
||||||
|
|
||||||
|
OwnedLibrary:
|
||||||
|
type: "object"
|
||||||
|
properties:
|
||||||
|
uuid:
|
||||||
|
type: string
|
||||||
|
format: uuid
|
||||||
|
fid:
|
||||||
|
$ref: "#/properties/fid"
|
||||||
|
name:
|
||||||
|
type: "string"
|
||||||
|
example: "My Creative Commons library"
|
||||||
|
description:
|
||||||
|
type: "string"
|
||||||
|
example: "All content is under CC-BY"
|
||||||
|
creation_date:
|
||||||
|
$ref: "#/properties/creation_date"
|
||||||
|
privacy_level:
|
||||||
|
$ref: "#/properties/privacy_level"
|
||||||
|
uploads_count:
|
||||||
|
type: "integer"
|
||||||
|
format: "int64"
|
||||||
|
example: 34
|
||||||
|
size:
|
||||||
|
type: "integer"
|
||||||
|
format: "int64"
|
||||||
|
example: 678917000
|
||||||
|
description: "Total size of uploads in the library, in bytes"
|
||||||
|
|
||||||
ResourceNotFound:
|
ResourceNotFound:
|
||||||
type: "object"
|
type: "object"
|
||||||
properties:
|
properties:
|
||||||
|
|
Loading…
Reference in New Issue