Updating OpenAPI Spec

This commit is contained in:
lukehagar
2023-04-12 16:59:00 +00:00
parent 2962c0b753
commit 81cd8fe186

View File

@@ -36,88 +36,6 @@ components:
in: header in: header
name: X-Plex-Token name: X-Plex-Token
paths: paths:
/clients:
get:
tags:
- Devices
summary: Get Available Clients
description: Get Available Clients
operationId: getAvailableClients
responses:
'200':
description: Available Clients
content:
application/json:
schema:
type: array
items:
type: object
properties:
MediaContainer:
type: object
properties:
size:
type: number
example: 1
Server:
type: array
items:
type: object
properties:
name:
type: string
example: iPad
host:
type: string
example: 10.10.10.102
address:
type: string
example: 10.10.10.102
port:
type: number
example: 32500
machineIdentifier:
type: string
example: A2E901F8-E016-43A7-ADFB-EF8CA8A4AC05
version:
type: string
example: 8.17
protocol:
type: string
example: plex
product:
type: string
example: Plex for iOS
deviceClass:
type: string
example: tablet
protocolVersion:
type: string
example: 2
protocolCapabilities:
type: string
example: 'playback,playqueues,timeline,provider-playback'
'401':
description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
code:
type: number
example: 1001
message:
type: string
example: User could not be authenticated
status:
type: number
example: 401
/: /:
get: get:
tags: tags:
@@ -268,6 +186,88 @@ paths:
status: status:
type: number type: number
example: 401 example: 401
/clients:
get:
tags:
- Devices
summary: Get Available Clients
description: Get Available Clients
operationId: getAvailableClients
responses:
'200':
description: Available Clients
content:
application/json:
schema:
type: array
items:
type: object
properties:
MediaContainer:
type: object
properties:
size:
type: number
example: 1
Server:
type: array
items:
type: object
properties:
name:
type: string
example: iPad
host:
type: string
example: 10.10.10.102
address:
type: string
example: 10.10.10.102
port:
type: number
example: 32500
machineIdentifier:
type: string
example: A2E901F8-E016-43A7-ADFB-EF8CA8A4AC05
version:
type: string
example: 8.17
protocol:
type: string
example: plex
product:
type: string
example: Plex for iOS
deviceClass:
type: string
example: tablet
protocolVersion:
type: string
example: 2
protocolCapabilities:
type: string
example: 'playback,playqueues,timeline,provider-playback'
'401':
description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
code:
type: number
example: 1001
message:
type: string
example: User could not be authenticated
status:
type: number
example: 401
/activities: /activities:
get: get:
tags: tags:
@@ -1941,6 +1941,99 @@ paths:
status: status:
type: number type: number
example: 401 example: 401
/status/sessions:
get:
tags:
- Sessions
summary: Get Active Sessions
description: This will retrieve the "Now Playing" Information of the PMS.
operationId: getSessions
responses:
'200':
description: List of Active Plex Sessions
'401':
description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
code:
type: number
example: 1001
message:
type: string
example: User could not be authenticated
status:
type: number
example: 401
/status/sessions/history/all:
get:
tags:
- Sessions
summary: Get Session History
description: This will Retrieve a listing of all history views.
operationId: getSessionHistory
responses:
'200':
description: List of Plex Sessions
'401':
description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
code:
type: number
example: 1001
message:
type: string
example: User could not be authenticated
status:
type: number
example: 401
'/:/prefs':
get:
tags:
- Server
summary: Get Server Preferences
description: Get Server Preferences
operationId: getServerPreferences
responses:
'200':
description: Server Preferences
'401':
description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
content:
application/json:
schema:
type: object
properties:
errors:
type: array
items:
type: object
properties:
code:
type: number
example: 1001
message:
type: string
example: User could not be authenticated
status:
type: number
example: 401
/user: /user:
servers: servers:
- url: 'https://plex.tv/api/v2' - url: 'https://plex.tv/api/v2'
@@ -1953,7 +2046,7 @@ paths:
parameters: parameters:
- in: header - in: header
name: X-Plex-Client-Identifier name: X-Plex-Client-Identifier
description: 'UUID, serial number, or other number unique per device' description: 'Unique Id, UUID, serial number, or other number unique per device that identifies your client'
schema: schema:
type: string type: string
required: true required: true
@@ -1966,7 +2059,9 @@ paths:
required: false required: false
- in: header - in: header
name: X-Plex-Device name: X-Plex-Device
description: 'Device name and model number, eg `iPhone3,2`, `Motorola XOOM™`, `LG5200TV`' description: |
The type of device your application is running on
Device name and or model number, eg `iPhone3,2`, `Motorola XOOM™`, `LG5200TV`
schema: schema:
type: string type: string
example: example:
@@ -1986,10 +2081,11 @@ paths:
required: false required: false
- in: header - in: header
name: X-Plex-Platform name: X-Plex-Platform
description: 'Platform name, eg `iOS`, `MacOSX`, `Android`, `LG`' description: 'Platform name, eg `Web`, `iOS`, `MacOSX`, `Android`, `LG`'
schema: schema:
type: string type: string
example: example:
- Web
- iOS - iOS
- MacOSX - MacOSX
- Android - Android
@@ -2018,7 +2114,7 @@ paths:
required: false required: false
- in: header - in: header
name: X-Plex-Version name: X-Plex-Version
description: Plex application version number description: Your application version number
schema: schema:
type: string type: string
required: false required: false
@@ -2058,7 +2154,7 @@ paths:
parameters: parameters:
- in: header - in: header
name: X-Plex-Client-Identifier name: X-Plex-Client-Identifier
description: 'UUID, serial number, or other number unique per device' description: 'Unique Id, UUID, serial number, or other number unique per device that identifies your client'
schema: schema:
type: string type: string
required: true required: true
@@ -2071,7 +2167,9 @@ paths:
required: false required: false
- in: header - in: header
name: X-Plex-Device name: X-Plex-Device
description: 'Device name and model number, eg `iPhone3,2`, `Motorola XOOM™`, `LG5200TV`' description: |
The type of device your application is running on
Device name and or model number, eg `iPhone3,2`, `Motorola XOOM™`, `LG5200TV`
schema: schema:
type: string type: string
example: example:
@@ -2091,10 +2189,11 @@ paths:
required: false required: false
- in: header - in: header
name: X-Plex-Platform name: X-Plex-Platform
description: 'Platform name, eg `iOS`, `MacOSX`, `Android`, `LG`' description: 'Platform name, eg `Web`, `iOS`, `MacOSX`, `Android`, `LG`'
schema: schema:
type: string type: string
example: example:
- Web
- iOS - iOS
- MacOSX - MacOSX
- Android - Android
@@ -2123,7 +2222,7 @@ paths:
required: false required: false
- in: header - in: header
name: X-Plex-Version name: X-Plex-Version
description: Plex application version number description: Your application version number
schema: schema:
type: string type: string
required: false required: false
@@ -2243,99 +2342,189 @@ paths:
status: status:
type: number type: number
example: 401 example: 401
/status/sessions: /pins:
servers:
- url: 'https://plex.tv/api/v2'
post:
tags:
- Authentication
summary: Get a Pin
operationId: getPin
description: Retrieve a Pin from Plex.tv for authentication flows
parameters:
- name: strong
description: |
Determines the kind of code returned by the API call
Strong codes are used for Pin authentication flows
Non-Strong codes are used for `Plex.tv/link`
in: query
schema:
type: boolean
required: true
- in: header
name: X-Plex-Client-Identifier
description: 'Unique Id, UUID, serial number, or other number unique per device that identifies your client'
schema:
type: string
required: true
- in: header
name: X-Plex-Device-Name
description: Primary name for the device eg. `Plex Web (Chrome)`
schema:
type: string
example: Plex Web (Chrome)
required: false
- in: header
name: X-Plex-Device
description: |
The type of device your application is running on
Device name and or model number, eg `iPhone3,2`, `Motorola XOOM™`, `LG5200TV`
schema:
type: string
example:
- 'iPhone3,2'
- Motorola XOOM™
- LG5200TV
required: false
- in: header
name: X-Plex-Platform-Version
description: 'Operating system version, eg `4.3.1`, `10.6.7`, `3.2`'
schema:
type: string
example:
- 4.3.1
- 10.6.7
- 3.2
required: false
- in: header
name: X-Plex-Platform
description: 'Platform name, eg `Web`, `iOS`, `MacOSX`, `Android`, `LG`'
schema:
type: string
example:
- Web
- iOS
- MacOSX
- Android
- LG
required: false
- in: header
name: X-Plex-Product
description: 'Plex application name, eg `Laika`, `Plex Media Server`, `Media Link`'
schema:
type: string
example:
- Laika
- Plex Media Server
- Media Link
required: false
- in: header
name: X-Plex-Provides
description: 'One or more of `[player, controller, server]`'
schema:
type: string
example:
- iOS
- MacOSX
- Android
- LG
required: false
- in: header
name: X-Plex-Version
description: Your application version number
schema:
type: string
required: false
'/pins/{pinID}':
servers:
- url: 'https://plex.tv/api/v2'
get: get:
tags: tags:
- Sessions - Authentication
summary: Get Active Sessions summary: Get Access Token
description: This will retrieve the "Now Playing" Information of the PMS. operationId: getToken
operationId: getSessions description: Retrieve a Pin from Plex.tv for authentication flows
responses: parameters:
'200': - name: pinID
description: List of Active Plex Sessions description: The PinID to retrieve an access token for
'401': in: path
description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. schema:
content: type: string
application/json: required: true
schema: - in: header
type: object name: X-Plex-Client-Identifier
properties: description: 'Unique Id, UUID, serial number, or other number unique per device that identifies your client'
errors: schema:
type: array type: string
items: required: true
type: object - in: header
properties: name: X-Plex-Device-Name
code: description: Primary name for the device eg. `Plex Web (Chrome)`
type: number schema:
example: 1001 type: string
message: example: Plex Web (Chrome)
type: string required: false
example: User could not be authenticated - in: header
status: name: X-Plex-Device
type: number description: |
example: 401 The type of device your application is running on
/status/sessions/history/all: Device name and or model number, eg `iPhone3,2`, `Motorola XOOM™`, `LG5200TV`
get: schema:
tags: type: string
- Sessions example:
summary: Get Session History - 'iPhone3,2'
description: This will Retrieve a listing of all history views. - Motorola XOOM™
operationId: getSessionHistory - LG5200TV
responses: required: false
'200': - in: header
description: List of Plex Sessions name: X-Plex-Platform-Version
'401': description: 'Operating system version, eg `4.3.1`, `10.6.7`, `3.2`'
description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. schema:
content: type: string
application/json: example:
schema: - 4.3.1
type: object - 10.6.7
properties: - 3.2
errors: required: false
type: array - in: header
items: name: X-Plex-Platform
type: object description: 'Platform name, eg `Web`, `iOS`, `MacOSX`, `Android`, `LG`'
properties: schema:
code: type: string
type: number example:
example: 1001 - Web
message: - iOS
type: string - MacOSX
example: User could not be authenticated - Android
status: - LG
type: number required: false
example: 401 - in: header
'/:/prefs': name: X-Plex-Product
get: description: 'Plex application name, eg `Laika`, `Plex Media Server`, `Media Link`'
tags: schema:
- Server type: string
summary: Get Server Preferences example:
description: Get Server Preferences - Laika
operationId: getServerPreferences - Plex Media Server
responses: - Media Link
'200': required: false
description: Server Preferences - in: header
'401': name: X-Plex-Provides
description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. description: 'One or more of `[player, controller, server]`'
content: schema:
application/json: type: string
schema: example:
type: object - iOS
properties: - MacOSX
errors: - Android
type: array - LG
items: required: false
type: object - in: header
properties: name: X-Plex-Version
code: description: Your application version number
type: number schema:
example: 1001 type: string
message: required: false
type: string
example: User could not be authenticated
status:
type: number
example: 401
tags: tags:
- name: Activities - name: Activities
description: | description: |
@@ -2346,6 +2535,9 @@ tags:
- They must contain an `type` which is used by clients to distinguish the specific activity. - They must contain an `type` which is used by clients to distinguish the specific activity.
- They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.) - They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.)
- The may contain a `Response` object which attributes which represent the result of the asynchronous operation. - The may contain a `Response` object which attributes which represent the result of the asynchronous operation.
- name: Authentication
description: |
API Calls regarding authentication for Plex Media Server
- name: Butler - name: Butler
description: | description: |
Butler is the task manager of the Plex Media Server Ecosystem. Butler is the task manager of the Plex Media Server Ecosystem.