Files
plexpy/docs/sdks/plex/README.md

8.3 KiB
Raw Blame History

Plex

(plex)

Overview

API Calls that perform operations directly against https://Plex.tv

Available Operations

get_pin

Retrieve a Pin from Plex.tv for authentication flows

Example Usage

import plex_api

s = plex_api.PlexAPI()


res = s.plex.get_pin(x_plex_client_identifier='<value>', strong=False)

if res.object is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
x_plex_client_identifier str ✔️ The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
strong Optional[bool] 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
server_url Optional[str] An optional server URL to use.

Response

operations.GetPinResponse

Errors

Error Object Status Code Content Type
errors.GetPinResponseBody 400 application/json
errors.SDKError 4x-5xx /

get_token

Retrieve an Access Token from Plex.tv after the Pin has already been authenticated

Example Usage

import plex_api

s = plex_api.PlexAPI()


res = s.plex.get_token(pin_id='<value>', x_plex_client_identifier='<value>')

if res is not None:
    # handle response
    pass

Parameters

Parameter Type Required Description
pin_id str ✔️ The PinID to retrieve an access token for
x_plex_client_identifier str ✔️ The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
server_url Optional[str] An optional server URL to use.

Response

operations.GetTokenResponse

Errors

Error Object Status Code Content Type
errors.GetTokenResponseBody 400 application/json
errors.SDKError 4x-5xx /