mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-10 19:31:39 +00:00
278 lines
8.7 KiB
YAML
278 lines
8.7 KiB
YAML
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'
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
properties:
|
|
id:
|
|
$ref: '../objects/entities/PlaybackSession.yaml#/components/schemas/playbackSessionId'
|
|
currentTime:
|
|
$ref: '../schemas.yaml#/components/schemas/durationSec'
|
|
timeListened:
|
|
$ref: '../schemas.yaml#/components/schemas/durationSec'
|
|
duration:
|
|
$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
|
|
/api/sessions/{id}:
|
|
delete:
|
|
operationId: deleteSession
|
|
summary: Delets a listening session.
|
|
description: Deletes a listening 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'
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
content:
|
|
html/text:
|
|
schema:
|
|
type: string
|
|
example: OK
|
|
'403':
|
|
description: A user with delete permissions is required to delete sessions.
|
|
content:
|
|
html/text:
|
|
schema:
|
|
type: string
|
|
example: Forbidden
|
|
'404':
|
|
description: No listening session with the provided ID was found.
|
|
content:
|
|
html/text:
|
|
schema:
|
|
type: string
|
|
example: Not Found
|
|
/api/session/{id}/close:
|
|
post:
|
|
operationId: closeSession
|
|
summary: Close a listening session.
|
|
description: Close a listening 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: false
|
|
schema:
|
|
$ref: '../schemas.yaml#/components/schemas/durationSec'
|
|
- name: timeListened
|
|
in: query
|
|
description: The time listened to the session.
|
|
required: false
|
|
schema:
|
|
$ref: '../schemas.yaml#/components/schemas/durationSec'
|
|
- name: duration
|
|
in: query
|
|
description: The duration of the session.
|
|
required: false
|
|
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
|
|
/api/session/{id}:
|
|
get:
|
|
operationId: getSession
|
|
summary: Get a listening session.
|
|
description: Get a listening 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'
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../objects/entities/PlaybackSession.yaml#/components/schemas/playbackSessionExpanded'
|
|
'404':
|
|
description: No listening session with the provided ID was found.
|
|
content:
|
|
html/text:
|
|
schema:
|
|
type: string
|
|
example: Not Found
|
|
/api/sessions:
|
|
get:
|
|
operationId: getSessions
|
|
summary: Get all listening sessions.
|
|
description: Get all listening sessions.
|
|
tags:
|
|
- Session
|
|
parameters:
|
|
- name: user
|
|
in: query
|
|
description: The ID of the user to filter listening sessions by.
|
|
required: false
|
|
schema:
|
|
$ref: '../objects/entities/User.yaml#/components/schemas/userId'
|
|
- name: itemsPerPage
|
|
in: query
|
|
description: The number of items to return.
|
|
required: false
|
|
schema:
|
|
$ref: '../schemas.yaml#/components/schemas/limit'
|
|
- name: page
|
|
in: query
|
|
description: The page number (zero indexed) to return.
|
|
required: false
|
|
schema:
|
|
$ref: '../schemas.yaml#/components/schemas/page'
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
results:
|
|
type: array
|
|
items:
|
|
$ref: '../objects/LibraryItem.yaml#/components/schemas/libraryItemBase'
|
|
total:
|
|
$ref: '../schemas.yaml#/components/schemas/total'
|
|
itemsPerPage:
|
|
$ref: '../schemas.yaml#/components/schemas/limit'
|
|
numPages:
|
|
description: The number of pages.
|
|
type: integer
|
|
example: 10
|
|
userFilter:
|
|
description: If provided, the `user` parameter.
|
|
sessions:
|
|
type: array
|
|
items:
|
|
$ref: '../objects/entities/PlaybackSession.yaml#/components/schemas/playbackSession'
|
|
'404':
|
|
description: No listening sessions were found.
|
|
content:
|
|
html/text:
|
|
schema:
|
|
type: string
|
|
example: Not Found
|
|
/api/session/local:
|
|
post:
|
|
operationId: createLocalSession
|
|
summary: Create a local session.
|
|
description: Create a local session.
|
|
tags:
|
|
- Session
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '../objects/entities/PlaybackSession.yaml#/components/schemas/playbackSession'
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
content:
|
|
html/text:
|
|
schema:
|
|
type: string
|
|
example: OK
|
|
'500':
|
|
description: There was an error creating the session.
|
|
content:
|
|
html/text:
|
|
schema:
|
|
type: string
|
|
example: Internal Server Error
|
|
/api/local/session/local-all:
|
|
post:
|
|
operationId: createLocalSessionAll
|
|
summary: Create a local session for all users.
|
|
description: Create a local session for all users.
|
|
tags:
|
|
- Session
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
items:
|
|
$ref: '../objects/entities/PlaybackSession.yaml#/components/schemas/playbackSession'
|
|
responses:
|
|
'200':
|
|
description: OK
|
|
content:
|
|
html/text:
|
|
schema:
|
|
type: string
|
|
example: OK
|
|
'500':
|
|
description: There was an error creating the session.
|
|
content:
|
|
html/text:
|
|
schema:
|
|
type: string
|
|
example: Internal Server Error
|