diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 25edd73..48b8350 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.377.1 +speakeasyVersion: 1.392.1 sources: merge-code-samples-into-spec: sourceNamespace: merge-code-samples-into-spec - sourceRevisionDigest: sha256:931d5158bc1ba3e9f812759491cc7d8f87e49cde5e1adb21291c076f219718ef - sourceBlobDigest: sha256:aafd87aaf8b0d02c32a38b9c4e1f57c1740cda06edf001d4167d0d05f4b23398 + sourceRevisionDigest: sha256:dd1bdaa345cbf8cffc59ce76ef323db8cb2e177e88c97ac439d7d72e35b22b7f + sourceBlobDigest: sha256:128944201fe8a0eab7a019d0c4ff7a56a2290384405520ef0e84849ff2d79d37 tags: - latest - main diff --git a/openapi-with-code-samples.yaml b/openapi-with-code-samples.yaml index 91cd60f..dbd2304 100644 --- a/openapi-with-code-samples.yaml +++ b/openapi-with-code-samples.yaml @@ -2,7 +2,7 @@ openapi: 3.1.0 info: version: 0.0.3 title: Plex-API - description: An Open API Spec for interacting with Plex.tv + description: An Open API Spec for interacting with Plex.tv and Plex Media Server contact: name: Luke Hagar url: 'https://www.LukeHagar.com' @@ -15,7 +15,7 @@ servers: description: The full address of your Plex Server variables: protocol: - default: http + default: https enum: - http - https @@ -30,10 +30,10 @@ x-speakeasy-globals: 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) - in: header + in: query schema: type: string - example: Postman + example: gcgzw5rz2xovp84b4vha3a40 required: true security: - accessToken: [] @@ -42,7 +42,7 @@ components: accessToken: description: Plex Authentication Token type: apiKey - in: header + in: query name: X-Plex-Token paths: /: @@ -302,22 +302,7 @@ paths: } - lang: typescript label: getServerCapabilities - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getServerCapabilities(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getServerCapabilities();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/:/prefs': get: tags: @@ -503,22 +488,7 @@ paths: } - lang: typescript label: getServerPreferences - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getServerPreferences(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getServerPreferences();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/:/scrobble': get: tags: @@ -665,22 +635,7 @@ paths: } - lang: typescript label: markPlayed - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.media.markPlayed(59398); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.media.markPlayed(59398);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/:/unscrobble': get: tags: @@ -827,22 +782,7 @@ paths: } - lang: typescript label: markUnplayed - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.media.markUnplayed(59398); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.media.markUnplayed(59398);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/:/progress': post: tags: @@ -1009,22 +949,7 @@ paths: } - lang: typescript label: updatePlayProgress - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.media.updatePlayProgress("", 90000, "played"); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.media.updatePlayProgress(\"\", 90000, \"played\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/:/timeline': get: tags: @@ -1275,33 +1200,7 @@ paths: } - lang: typescript label: getTimeline - source: |- - import { PlexAPI, State } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.video.getTimeline({ - ratingKey: 23409, - key: "/library/metadata/23409", - state: State.Playing, - hasMDE: 1, - time: 2000, - duration: 10000, - context: "home:hub.continueWatching", - playQueueItemID: 1, - playBackTime: 2000, - row: 1, - }); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI, State } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.video.getTimeline({\n ratingKey: 23409,\n key: \"/library/metadata/23409\",\n state: State.Playing,\n hasMDE: 1,\n time: 2000,\n duration: 10000,\n context: \"home:hub.continueWatching\",\n playQueueItemID: 1,\n playBackTime: 2000,\n row: 1,\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /activities: get: tags: @@ -1474,22 +1373,7 @@ paths: } - lang: typescript label: getServerActivities - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.activities.getServerActivities(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.activities.getServerActivities();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/activities/{activityUUID}': delete: tags: @@ -1636,22 +1520,7 @@ paths: } - lang: typescript label: cancelServerActivities - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.activities.cancelServerActivities("25b71ed5-0f9d-461c-baa7-d404e9e10d3e"); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.activities.cancelServerActivities(\"25b71ed5-0f9d-461c-baa7-d404e9e10d3e\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /butler: get: tags: @@ -1819,22 +1688,7 @@ paths: } - lang: typescript label: getButlerTasks - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.butler.getButlerTasks(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.butler.getButlerTasks();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" post: tags: - Butler @@ -1975,22 +1829,7 @@ paths: } - lang: typescript label: startAllTasks - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.butler.startAllTasks(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.butler.startAllTasks();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" delete: tags: - Butler @@ -2127,22 +1966,7 @@ paths: } - lang: typescript label: stopAllTasks - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.butler.stopAllTasks(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.butler.stopAllTasks();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/butler/{taskName}': post: tags: @@ -2312,22 +2136,7 @@ paths: } - lang: typescript label: startTask - source: |- - import { PlexAPI, TaskName } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.butler.startTask(TaskName.CleanOldBundles); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI, TaskName } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.butler.startTask(TaskName.CleanOldBundles);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" delete: tags: - Butler @@ -2492,22 +2301,7 @@ paths: } - lang: typescript label: stopTask - source: |- - import { PathParamTaskName, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.butler.stopTask(PathParamTaskName.BackupDatabase); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PathParamTaskName, PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.butler.stopTask(PathParamTaskName.BackupDatabase);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /clients: get: tags: @@ -2695,22 +2489,7 @@ paths: } - lang: typescript label: getAvailableClients - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getAvailableClients(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getAvailableClients();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /devices: get: tags: @@ -2882,22 +2661,7 @@ paths: } - lang: typescript label: getDevices - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getDevices(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getDevices();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /companions: get: servers: @@ -2969,22 +2733,7 @@ paths: x-codeSamples: - lang: typescript label: getCompanionsData - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getCompanionsData(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getCompanionsData();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /friends: get: servers: @@ -3112,22 +2861,7 @@ paths: x-codeSamples: - lang: typescript label: getUserFriends - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getUserFriends(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getUserFriends();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /geoip: get: servers: @@ -3245,21 +2979,7 @@ paths: x-codeSamples: - lang: typescript label: getGeoData - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getGeoData(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getGeoData();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /home: get: tags: @@ -3419,22 +3139,7 @@ paths: } - lang: typescript label: getHomeData - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getHomeData(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getHomeData();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /hubs: get: tags: @@ -3712,22 +3417,7 @@ paths: } - lang: typescript label: getGlobalHubs - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.hubs.getGlobalHubs(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.hubs.getGlobalHubs();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /hubs/search: get: tags: @@ -3907,22 +3597,7 @@ paths: } - lang: typescript label: performSearch - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.search.performSearch("dylan", 5); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.search.performSearch(\"dylan\", 5);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /hubs/search/voice: get: tags: @@ -4090,22 +3765,7 @@ paths: } - lang: typescript label: performVoiceSearch - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.search.performVoiceSearch("dead+poop", 5); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.search.performVoiceSearch(\"dead+poop\", 5);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/hubs/sections/{sectionId}': get: tags: @@ -4580,29 +4240,15 @@ paths: } - lang: typescript label: getLibraryHubs - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.hubs.getLibraryHubs(6728.76); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.hubs.getLibraryHubs(6728.76);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /identity: get: tags: - Server summary: Get Server Identity - description: Get Server Identity - operationId: getServerIdentity + description: This request is useful to determine if the server is online or offline + operationId: get-server-identity + security: [] responses: '200': description: The Server Identity information @@ -4625,29 +4271,19 @@ paths: version: type: string example: 1.31.3.6868-28fc46b27 - '400': - description: 'Bad Request - A parameter was not specified, or was specified incorrectly.' - '401': - description: Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + '408': + description: Request Timeout 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 + code: + type: integer + example: 408 + message: + type: string + example: The server timed out waiting for the request. x-codeSamples: - lang: php label: getServerIdentity @@ -4752,23 +4388,8 @@ paths: } } - lang: typescript - label: getServerIdentity - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getServerIdentity(); - - // Handle the result - console.log(result) - } - - run(); + label: identity + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getServerIdentity();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /library/hashes: get: tags: @@ -4924,22 +4545,7 @@ paths: } - lang: typescript label: getFileHash - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getFileHash("file://C:\Image.png&type=13"); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getFileHash(\"file://C:\\Image.png&type=13\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /library/recentlyAdded: get: tags: @@ -4948,6 +4554,40 @@ paths: description: | This endpoint will return the recently added content. operationId: getRecentlyAdded + parameters: + - name: Accept + in: header + required: false + schema: + type: string + enum: + - application/json + - application/xml + example: application/json + - name: X-Plex-Container-Start + in: query + description: | + The index of the first item to return. If not specified, the first item will be returned. + If the number of items exceeds the limit, the response will be paginated. + By default this is 0 + schema: + type: integer + format: int32 + default: 0 + example: 0 + required: false + - name: X-Plex-Container-Size + in: query + description: | + The number of items to return. If not specified, all items will be returned. + If the number of items exceeds the limit, the response will be paginated. + By default this is 50 + schema: + type: integer + format: int32 + default: 50 + example: 50 + required: false responses: '200': description: The recently added content @@ -5308,28 +4948,13 @@ paths: } - lang: typescript label: getRecentlyAdded - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getRecentlyAdded(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getRecentlyAdded(0, 50);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /library/sections: get: tags: - Library summary: Get All Libraries - operationId: getLibraries + operationId: get-all-libraries description: "A library section (commonly referred to as just a library) is a collection of media. \nLibraries are typed, and depending on their type provide either a flat or a hierarchical view of the media. \nFor example, a music library has an artist > albums > tracks structure, whereas a movie library is flat.\n\nLibraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts. \nThis allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year).\n" responses: '200': @@ -5341,6 +4966,10 @@ paths: properties: MediaContainer: type: object + required: + - size + - allowSync + - title1 properties: size: type: integer @@ -5397,17 +5026,23 @@ paths: type: string example: 322a231a-b7f7-49f5-920f-14c61199cd30 updatedAt: - type: integer + type: + - integer + example: 1556281940 + description: Unix epoch datetime format: int32 - example: 1705615634 createdAt: - type: integer + type: + - integer + example: 1556281940 + description: Unix epoch datetime format: int32 - example: 1654131312 scannedAt: - type: integer + type: + - integer + example: 1556281940 + description: Unix epoch datetime format: int32 - example: 1705615584 content: type: boolean example: true @@ -5561,37 +5196,23 @@ paths: } } - lang: typescript - label: getLibraries - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getLibraries(); - - // Handle the result - console.log(result) - } - - run(); - '/library/sections/{sectionId}': + label: libraries + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getAllLibraries();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + '/library/sections/{sectionKey}': get: tags: - Library summary: Get Library Details description: "## Library Details Endpoint\n\nThis endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself. \n\nThe details include:\n\n### Directories\nOrganized into three categories:\n\n- **Primary Directories**: \n - Used in some clients for quick access to media subsets (e.g., \"All\", \"On Deck\").\n - Most can be replicated via media queries.\n - Customizable by users.\n\n- **Secondary Directories**:\n - Marked with `secondary=\"1\"`.\n - Used in older clients for structured navigation.\n\n- **Special Directories**:\n - Includes a \"By Folder\" entry for filesystem-based browsing.\n - Contains an obsolete `search=\"1\"` entry for on-the-fly search dialog creation.\n\n### Types\nEach type in the library comes with a set of filters and sorts, aiding in building dynamic media controls:\n\n- **Type Object Attributes**:\n - `key`: Endpoint for the media list of this type.\n - `type`: Metadata type (if standard Plex type).\n - `title`: Title for this content type (e.g., \"Movies\").\n\n- **Filter Objects**:\n - Subset of the media query language.\n - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`.\n\n- **Sort Objects**:\n - Description of sort fields.\n - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`.\n\n> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.\n" - operationId: getLibrary + operationId: get-library-details parameters: - - name: sectionId - description: the Id of the library to query + - name: sectionKey + description: "The unique key of the Plex library. \nNote: This is unique in the context of the Plex server.\n" in: path schema: - type: number - example: 1000 + type: integer + format: int32 + example: 9518 required: true - name: includeDetails description: "Whether or not to include details for a section (types, filters, and sorts). \nOnly exists for backwards compatibility, media providers other than the server libraries have it on always.\n" @@ -5794,146 +5415,23 @@ paths: type: number example: 401 x-codeSamples: - - lang: php - label: getLibrary - source: |- - declare(strict_types=1); - - require 'vendor/autoload.php'; - - use LukeHagar\Plex_API; - use LukeHagar\Plex_API\Models\Components; - use LukeHagar\Plex_API\Models\Operations; - - $security = new Components\Security(); - $security->accessToken = ''; - - $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') - ->setSecurity($security)->build(); - - try { - - $response = $sdk->library->getLibrary(1000, Operations\IncludeDetails::Zero); - - if ($response->object !== null) { - // handle response - } - } catch (Throwable $e) { - // handle exception - } - - lang: ruby - label: getLibrary - source: "require 'plexruby'\n\n\ns = ::OpenApiSDK::PlexAPI.new(\n x_plex_client_identifier: \"Postman\",\n )\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_library(section_id=1000.0, include_details=::OpenApiSDK::Operations::IncludeDetails::ZERO)\n\nif ! res.two_hundred_application_json_object.nil?\n # handle response\nend" - - lang: go - label: getLibrary - source: |- - package main - - import( - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - var sectionID float64 = 1000 - - var includeDetails *operations.IncludeDetails = operations.IncludeDetailsZero.ToPointer() - ctx := context.Background() - res, err := s.Library.GetLibrary(ctx, sectionID, includeDetails) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - lang: java - label: getLibrary - source: |- - package hello.world; - - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; - - public class Application { - - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); - - GetLibraryResponse res = sdk.library().getLibrary() - .sectionId(1000d) - .includeDetails(IncludeDetails.ZERO) - .call(); - - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetLibraryResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - - } - } - lang: typescript - label: getLibrary - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getLibrary(1000); - - // Handle the result - console.log(result) - } - - run(); + label: details + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getLibraryDetails(9518);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" delete: tags: - Library summary: Delete Library Section - description: Delate a library using a specific section + description: Delete a library using a specific section id operationId: deleteLibrary parameters: - - name: sectionId - description: the Id of the library to query + - name: sectionKey + description: "The unique key of the Plex library. \nNote: This is unique in the context of the Plex server.\n" in: path schema: - type: number - example: 1000 + type: integer + format: int32 + example: 9518 required: true responses: '200': @@ -5962,8 +5460,259 @@ paths: type: number example: 401 x-codeSamples: - - lang: php + - lang: typescript label: deleteLibrary + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.deleteLibrary(9518);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + '/library/sections/watchlist/{filter}': + servers: + - url: 'https://metadata.provider.plex.tv' + description: The plex metadata provider server + get: + tags: + - Watchlist + summary: Get User Watchlist + description: Get User Watchlist + operationId: get-watch-list + parameters: + - name: filter + description: Filter + in: path + required: true + schema: + type: string + enum: + - all + - available + - released + - name: sort + description: | + In the format "field:dir". Available fields are "watchlistedAt" (Added At), + "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating). + "dir" can be "asc" or "desc" + in: query + required: false + schema: + type: string + - name: libtype + description: | + The type of library to filter. Can be "movie" or "show", or all if not present. + in: query + required: false + schema: + type: string + enum: + - movie + - show + - name: maxresults + description: | + The number of items to return. If not specified, all items will be returned. + If the number of items exceeds the limit, the response will be paginated. + in: query + required: false + schema: + type: integer + format: int32 + - name: includeCollections + description: | + include collections in the results + in: query + required: false + schema: + type: integer + enum: + - 1 + - 0 + - name: includeExternalMedia + description: | + include external media in the results + in: query + required: false + schema: + type: integer + enum: + - 1 + - 0 + - name: Accept + in: header + required: false + schema: + type: string + enum: + - application/json + - application/xml + example: application/json + - name: X-Plex-Container-Start + in: query + description: | + The index of the first item to return. If not specified, the first item will be returned. + If the number of items exceeds the limit, the response will be paginated. + By default this is 0 + schema: + type: integer + format: int32 + default: 0 + example: 0 + required: false + - name: X-Plex-Container-Size + in: query + description: | + The number of items to return. If not specified, all items will be returned. + If the number of items exceeds the limit, the response will be paginated. + By default this is 50 + schema: + type: integer + format: int32 + default: 50 + example: 50 + required: false + - name: X-Plex-Token + in: query + description: Plex Authentication Token + schema: + type: string + example: CV5xoxjTpFKUzBTShsaf + required: true + responses: + '200': + description: Watchlist Data + content: + application/json: + schema: + type: object + properties: + librarySectionID: + type: string + librarySectionTitle: + type: string + offset: + type: integer + format: int32 + totalSize: + type: integer + format: int32 + identifier: + type: string + size: + type: integer + format: int32 + Metadata: + type: array + items: + type: object + properties: + art: + type: string + guid: + type: string + key: + type: string + ratingKey: + type: string + studio: + type: string + tagline: + type: string + type: + type: string + thumb: + type: string + addedAt: + type: integer + format: int32 + duration: + type: integer + format: int32 + publicPagesURL: + type: string + slug: + type: string + userState: + type: boolean + title: + type: string + contentRating: + type: string + originallyAvailableAt: + type: string + format: date + year: + type: integer + format: int32 + Image: + type: array + items: + type: object + properties: + alt: + type: string + type: + type: string + url: + type: string + banner: + type: string + rating: + type: number + expiresAt: + type: integer + format: int32 + originalTitle: + type: string + audienceRating: + type: number + audienceRatingImage: + type: string + ratingImage: + type: string + imdbRatingCount: + type: integer + format: int32 + subtype: + type: string + theme: + type: string + leafCount: + type: integer + format: int32 + childCount: + type: integer + format: int32 + isContinuingSeries: + type: boolean + skipChildren: + type: boolean + availabilityId: + type: string + streamingMediaId: + type: string + playableKey: + type: string + '400': + description: 'Bad Request - A parameter was not specified, or was specified incorrectly.' + '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 + x-codeSamples: + - lang: php + label: getWatchlist source: |- declare(strict_types=1); @@ -5971,6 +5720,7 @@ paths: use LukeHagar\Plex_API; use LukeHagar\Plex_API\Models\Components; + use LukeHagar\Plex_API\Models\Operations; $security = new Components\Security(); $security->accessToken = ''; @@ -5980,25 +5730,36 @@ paths: ->setSecurity($security)->build(); try { + $request = new Operations\GetWatchlistRequest( + filter: Operations\PathParamFilter::Released, + sort: '', + libtype: Operations\Libtype::Movie, + maxresults: 303056, + includeCollections: Operations\IncludeCollections::Zero, + includeExternalMedia: Operations\IncludeExternalMedia::One, + xPlexToken: '', + xPlexContainerStart: 406911, + xPlexContainerSize: 958629, + ); + $response = $sdk->watchlist->getWatchlist($request); - $response = $sdk->library->deleteLibrary(1000); - - if ($response->statusCode === 200) { + if ($response->object !== null) { // handle response } } catch (Throwable $e) { // handle exception } - lang: ruby - label: deleteLibrary - source: "require 'plexruby'\n\n\ns = ::OpenApiSDK::PlexAPI.new(\n x_plex_client_identifier: \"Postman\",\n )\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.delete_library(section_id=1000.0)\n\nif res.status_code == 200\n # handle response\nend" + label: getWatchlist + source: "require 'plexruby'\n\n\ns = ::OpenApiSDK::PlexAPI.new(\n x_plex_client_identifier: \"Postman\",\n )\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::OpenApiSDK::Operations::GetWatchlistRequest.new(\n filter: ::OpenApiSDK::Operations::PathParamFilter::RELEASED,\n x_plex_token: \"\",\n)\n \nres = s.watchlist.get_watchlist(req)\n\nif ! res.two_hundred_application_json_object.nil?\n # handle response\nend" - lang: go - label: deleteLibrary + label: getWatchlist source: |- package main import( "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" "context" "log" ) @@ -6008,18 +5769,21 @@ paths: plexgo.WithSecurity(""), plexgo.WithXPlexClientIdentifier("Postman"), ) - var sectionID float64 = 1000 + request := operations.GetWatchlistRequest{ + Filter: operations.PathParamFilterReleased, + XPlexToken: "", + } ctx := context.Background() - res, err := s.Library.DeleteLibrary(ctx, sectionID) + res, err := s.Watchlist.GetWatchlist(ctx, request) if err != nil { log.Fatal(err) } - if res != nil { + if res.Object != nil { // handle response } } - lang: java - label: deleteLibrary + label: getWatchlist source: |- package hello.world; @@ -6046,12 +5810,19 @@ paths: .xPlexClientIdentifier("Postman") .build(); - DeleteLibraryResponse res = sdk.library().deleteLibrary() - .sectionId(1000d) + GetWatchlistRequest req = GetWatchlistRequest.builder() + .filter(PathParamFilter.RELEASED) + .xPlexToken("") + .build(); + + GetWatchlistResponse res = sdk.watchlist().getWatchlist() + .request(req) .call(); - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.DeleteLibraryResponseBody e) { + if (res.object().isPresent()) { + // handle response + } + } catch (lukehagar.plexapi.plexapi.models.errors.GetWatchlistResponseBody e) { // handle exception throw e; } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { @@ -6065,29 +5836,14 @@ paths: } } - lang: typescript - label: deleteLibrary - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.deleteLibrary(1000); - - // Handle the result - console.log(result) - } - - run(); - '/library/sections/{sectionId}/{tag}': + label: list + source: "import { Filter, PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.watchlist.getWatchList({\n filter: Filter.Available,\n xPlexContainerStart: 0,\n xPlexContainerSize: 50,\n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + '/library/sections/{sectionKey}/{tag}': get: tags: - Library summary: Get Library Items - operationId: getLibraryItems + operationId: get-library-items description: | Fetches details from a specific section of the library identified by a section key and a tag. The tag parameter accepts the following values: - `all`: All items in the section. @@ -6110,20 +5866,14 @@ paths: - `firstCharacter`: Items categorized by the first letter. - `folder`: Items categorized by folder. parameters: - - name: sectionId + - name: sectionKey + description: "The unique key of the Plex library. \nNote: This is unique in the context of the Plex server.\n" in: path - required: true - description: the Id of the library to query schema: - x-speakeasy-type-override: any - type: - - integer - - string - examples: - librarySectionID: - value: 1 - providerSectionID: - value: watchlist + type: integer + format: int32 + example: 9518 + required: true - name: tag in: path required: true @@ -6156,8 +5906,73 @@ paths: Adds the Guids object to the response schema: type: integer - required: false + enum: + - 0 + - 1 example: 1 + required: false + - name: includeMeta + in: query + description: | + Adds the Meta object to the response + schema: + type: integer + enum: + - 0 + - 1 + example: 1 + required: false + - name: type + in: query + description: | + The type of media to retrieve. + 1 = movie + 2 = show + 3 = season + 4 = episode + E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries + schema: + type: integer + enum: + - 1 + - 2 + - 3 + - 4 + example: 2 + required: true + - name: X-Plex-Container-Start + in: query + description: | + The index of the first item to return. If not specified, the first item will be returned. + If the number of items exceeds the limit, the response will be paginated. + By default this is 0 + schema: + type: integer + format: int32 + default: 0 + example: 0 + required: false + - name: X-Plex-Container-Size + in: query + description: | + The number of items to return. If not specified, all items will be returned. + If the number of items exceeds the limit, the response will be paginated. + By default this is 50 + schema: + type: integer + format: int32 + default: 50 + example: 50 + required: false + - name: Accept + in: header + required: false + schema: + type: string + enum: + - application/json + - application/xml + example: application/json responses: '200': description: The contents of the library by section and tag @@ -6537,151 +6352,36 @@ paths: type: number example: 401 x-codeSamples: - - lang: php - label: getLibraryItems - source: |- - declare(strict_types=1); - - require 'vendor/autoload.php'; - - use LukeHagar\Plex_API; - use LukeHagar\Plex_API\Models\Components; - use LukeHagar\Plex_API\Models\Operations; - - $security = new Components\Security(); - $security->accessToken = ''; - - $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') - ->setSecurity($security)->build(); - - try { - - $response = $sdk->library->getLibraryItems('', Operations\Tag::Genre, 1); - - if ($response->object !== null) { - // handle response - } - } catch (Throwable $e) { - // handle exception - } - - lang: ruby - label: getLibraryItems - source: "require 'plexruby'\n\n\ns = ::OpenApiSDK::PlexAPI.new(\n x_plex_client_identifier: \"Postman\",\n )\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.get_library_items(section_id=\"\", tag=::OpenApiSDK::Operations::Tag::GENRE, include_guids=1)\n\nif ! res.two_hundred_application_json_object.nil?\n # handle response\nend" - - lang: go - label: getLibraryItems - source: |- - package main - - import( - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - var sectionID any = "" - - var tag operations.Tag = operations.TagGenre - - var includeGuids *int64 = plexgo.Int64(1) - ctx := context.Background() - res, err := s.Library.GetLibraryItems(ctx, sectionID, tag, includeGuids) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - lang: java - label: getLibraryItems - source: |- - package hello.world; - - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; - - public class Application { - - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); - - GetLibraryItemsResponse res = sdk.library().getLibraryItems() - .sectionId("") - .tag(Tag.GENRE) - .includeGuids(1L) - .call(); - - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetLibraryItemsResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - - } - } - lang: typescript - label: getLibraryItems - source: |- - import { PlexAPI, Tag } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getLibraryItems("", Tag.Genre, 1); - - // Handle the result - console.log(result) - } - - run(); - '/library/sections/{sectionId}/refresh': + label: items + source: "import { IncludeGuids, IncludeMeta, PlexAPI, Tag, Type } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getLibraryItems({\n sectionKey: 9518,\n tag: Tag.Edition,\n includeGuids: IncludeGuids.One,\n includeMeta: IncludeMeta.One,\n type: Type.Two,\n xPlexContainerStart: 0,\n xPlexContainerSize: 50,\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + '/library/sections/{sectionKey}/refresh': get: tags: - Library - summary: Refresh Library + summary: Refresh Metadata Of The Library description: | - This endpoint Refreshes the library. - operationId: refreshLibrary + This endpoint Refreshes all the Metadata of the library. + operationId: get-refresh-library-metadata parameters: - - name: sectionId - description: the Id of the library to refresh + - name: sectionKey + description: "The unique key of the Plex library. \nNote: This is unique in the context of the Plex server.\n" in: path schema: - type: number + type: integer + format: int32 + example: 9518 required: true + - name: force + description: Force the refresh even if the library is already being refreshed. + in: query + schema: + type: integer + example: 0 + enum: + - 0 + - 1 + required: false responses: '200': description: The library is refreshing @@ -6709,143 +6409,43 @@ paths: type: number example: 401 x-codeSamples: - - lang: php - label: refreshLibrary - source: |- - declare(strict_types=1); - - require 'vendor/autoload.php'; - - use LukeHagar\Plex_API; - use LukeHagar\Plex_API\Models\Components; - - $security = new Components\Security(); - $security->accessToken = ''; - - $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') - ->setSecurity($security)->build(); - - try { - - $response = $sdk->library->refreshLibrary(934.16); - - if ($response->statusCode === 200) { - // handle response - } - } catch (Throwable $e) { - // handle exception - } - - lang: ruby - label: refreshLibrary - source: "require 'plexruby'\n\n\ns = ::OpenApiSDK::PlexAPI.new(\n x_plex_client_identifier: \"Postman\",\n )\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.refresh_library(section_id=934.16)\n\nif res.status_code == 200\n # handle response\nend" - - lang: go - label: refreshLibrary - source: |- - package main - - import( - "github.com/LukeHagar/plexgo" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - var sectionID float64 = 934.16 - ctx := context.Background() - res, err := s.Library.RefreshLibrary(ctx, sectionID) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } - } - - lang: java - label: refreshLibrary - source: |- - package hello.world; - - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; - - public class Application { - - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); - - RefreshLibraryResponse res = sdk.library().refreshLibrary() - .sectionId(934.16d) - .call(); - - // handle response - } catch (lukehagar.plexapi.plexapi.models.errors.RefreshLibraryResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - - } - } - lang: typescript - label: refreshLibrary - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.refreshLibrary(934.16); - - // Handle the result - console.log(result) - } - - run(); - '/library/sections/{sectionId}/search': + label: metadata + source: "import { Force, PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getRefreshLibraryMetadata(9518, Force.One);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + '/library/sections/{sectionKey}/search': get: tags: - Library summary: Search Library - operationId: searchLibrary + operationId: get-search-library description: "Search for content within a specific section of the library.\n\n### Types\nEach type in the library comes with a set of filters and sorts, aiding in building dynamic media controls:\n\n- **Type Object Attributes**:\n - `type`: Metadata type (if standard Plex type). \n - `title`: Title for this content type (e.g., \"Movies\").\n\n- **Filter Objects**:\n - Subset of the media query language.\n - Attributes include `filter` (name), `filterType` (data type), `key` (endpoint for value range), and `title`.\n\n- **Sort Objects**:\n - Description of sort fields.\n - Attributes include `defaultDirection` (asc/desc), `descKey` and `key` (sort parameters), and `title`.\n\n> **Note**: Filters and sorts are optional; without them, no filtering controls are rendered.\n" parameters: - - name: sectionId + - name: sectionKey + description: "The unique key of the Plex library. \nNote: This is unique in the context of the Plex server.\n" in: path - required: true - description: the Id of the library to query schema: type: integer + format: int32 + example: 9518 + required: true + - name: Accept + in: header + required: false + schema: + type: string + enum: + - application/json + - application/xml + example: application/json - name: type - description: Plex content type to search for in: query + description: | + The type of media to retrieve. + 1 = movie + 2 = show + 3 = season + 4 = episode + E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries schema: type: integer enum: @@ -6853,6 +6453,7 @@ paths: - 2 - 3 - 4 + example: 2 required: true responses: '200': @@ -6998,151 +6599,25 @@ paths: type: number example: 401 x-codeSamples: - - lang: php - label: searchLibrary - source: |- - declare(strict_types=1); - - require 'vendor/autoload.php'; - - use LukeHagar\Plex_API; - use LukeHagar\Plex_API\Models\Components; - use LukeHagar\Plex_API\Models\Operations; - - $security = new Components\Security(); - $security->accessToken = ''; - - $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') - ->setSecurity($security)->build(); - - try { - - $response = $sdk->library->searchLibrary(933505, Operations\Type::Four); - - if ($response->object !== null) { - // handle response - } - } catch (Throwable $e) { - // handle exception - } - - lang: ruby - label: searchLibrary - source: "require 'plexruby'\n\n\ns = ::OpenApiSDK::PlexAPI.new(\n x_plex_client_identifier: \"Postman\",\n )\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n \nres = s.library.search_library(section_id=933505, type=::OpenApiSDK::Operations::Type::FOUR)\n\nif ! res.two_hundred_application_json_object.nil?\n # handle response\nend" - - lang: go - label: searchLibrary - source: |- - package main - - import( - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - var sectionID int64 = 933505 - - var type_ operations.Type = operations.TypeFour - ctx := context.Background() - res, err := s.Library.SearchLibrary(ctx, sectionID, type_) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - lang: java - label: searchLibrary - source: |- - package hello.world; - - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; - - public class Application { - - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); - - SearchLibraryResponse res = sdk.library().searchLibrary() - .sectionId(933505L) - .type(Type.FOUR) - .call(); - - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.SearchLibraryResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - - } - } - lang: typescript - label: searchLibrary - source: |- - import { PlexAPI, Type } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.searchLibrary(933505, Type.Four); - - // Handle the result - console.log(result) - } - - run(); + label: library + source: "import { PlexAPI, QueryParamType } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getSearchLibrary(9518, QueryParamType.Two);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/library/metadata/{ratingKey}': get: tags: - Library - summary: Get Items Metadata + summary: Get Metadata by RatingKey description: | This endpoint will return the metadata of a library item specified with the ratingKey. - operationId: getMetadata + operationId: get-meta-data-by-rating-key parameters: - name: ratingKey - description: the id of the library item to return the children of. in: path + description: the id of the library item to return the children of. schema: - type: number + type: integer + example: 9518 required: true - examples: - rating-key: - value: 17 responses: '200': description: The metadata of the library item. @@ -7747,23 +7222,280 @@ paths: } } - lang: typescript - label: getMetadata - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getMetadata(17); - - // Handle the result - console.log(result) - } - - run(); + label: key + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getMetaDataByRatingKey(9518);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + '/library/metadata/{ratingKey}/banner': + get: + tags: + - Media + summary: Get Banner Image + description: Gets the banner image of the media item + operationId: get-banner-image + parameters: + - name: ratingKey + in: path + description: the id of the library item to return the children of. + schema: + type: integer + example: 9518 + required: true + - name: width + in: query + required: true + schema: + type: integer + example: 396 + - name: height + in: query + required: true + schema: + type: integer + example: 396 + - name: minSize + in: query + required: true + schema: + type: integer + example: 1 + - name: upscale + in: query + required: true + schema: + type: integer + example: 1 + - name: X-Plex-Token + in: query + description: Plex Authentication Token + schema: + type: string + example: CV5xoxjTpFKUzBTShsaf + required: true + responses: + '200': + description: Successful response returning an image + headers: + X-Plex-Protocol: + description: Version of the Plex protocol + schema: + type: string + example: '1.0' + Content-Type: + description: The MIME type of the returned content + schema: + type: string + example: image/jpeg + Connection: + description: Connection type + schema: + type: string + example: Keep-Alive + Keep-Alive: + description: Keep-Alive header with timeout value + schema: + type: string + example: timeout=20 + Content-Encoding: + description: Content encoding method + schema: + type: string + example: gzip + X-Plex-Content-Original-Length: + description: Original length of the uncompressed content + schema: + type: integer + format: int32 + example: 92476 + X-Plex-Content-Compressed-Length: + description: Length of the compressed content + schema: + type: integer + format: int32 + example: 92483 + Content-Length: + description: Length of the response content + schema: + type: integer + format: int32 + example: 92483 + Cache-Control: + description: Cache control directives + schema: + type: string + example: max-age=259200 + Date: + description: Date and time the response was generated + schema: + type: string + format: date-time + example: 'Tue, 03 Sep 2024 10:48:05 GMT' + content: + image/jpeg: + schema: + type: string + format: binary + '400': + description: 'Bad Request - A parameter was not specified, or was specified incorrectly.' + '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 + x-codeSamples: + - lang: typescript + label: image + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.media.getBannerImage({\n ratingKey: 9518,\n width: 396,\n height: 396,\n minSize: 1,\n upscale: 1,\n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + '/library/metadata/{ratingKey}/thumb': + get: + tags: + - Media + summary: Get Thumb Image + description: Gets the thumbnail image of the media item + operationId: get-thumb-image + parameters: + - name: ratingKey + in: path + description: the id of the library item to return the children of. + schema: + type: integer + example: 9518 + required: true + - name: width + in: query + required: true + schema: + type: integer + example: 396 + - name: height + in: query + required: true + schema: + type: integer + example: 396 + - name: minSize + in: query + required: true + schema: + type: integer + example: 1 + - name: upscale + in: query + required: true + schema: + type: integer + example: 1 + - name: X-Plex-Token + in: query + description: Plex Authentication Token + schema: + type: string + example: CV5xoxjTpFKUzBTShsaf + required: true + responses: + '200': + description: Successful response returning an image + headers: + X-Plex-Protocol: + description: Version of the Plex protocol + schema: + type: string + example: '1.0' + Content-Type: + description: The MIME type of the returned content + schema: + type: string + example: image/jpeg + Connection: + description: Connection type + schema: + type: string + example: Keep-Alive + Keep-Alive: + description: Keep-Alive header with timeout value + schema: + type: string + example: timeout=20 + Content-Encoding: + description: Content encoding method + schema: + type: string + example: gzip + X-Plex-Content-Original-Length: + description: Original length of the uncompressed content + schema: + type: integer + format: int32 + example: 92476 + X-Plex-Content-Compressed-Length: + description: Length of the compressed content + schema: + type: integer + format: int32 + example: 92483 + Content-Length: + description: Length of the response content + schema: + type: integer + format: int32 + example: 92483 + Cache-Control: + description: Cache control directives + schema: + type: string + example: max-age=259200 + Date: + description: Date and time the response was generated + schema: + type: string + format: date-time + example: 'Tue, 03 Sep 2024 10:48:05 GMT' + content: + image/jpeg: + schema: + type: string + format: binary + '400': + description: 'Bad Request - A parameter was not specified, or was specified incorrectly.' + '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 + x-codeSamples: + - lang: typescript + label: image + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.media.getThumbImage({\n ratingKey: 9518,\n width: 396,\n height: 396,\n minSize: 1,\n upscale: 1,\n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/library/metadata/{ratingKey}/children': get: tags: @@ -8132,22 +7864,7 @@ paths: } - lang: typescript label: getMetadataChildren - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getMetadataChildren(1539.14, "Stream"); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getMetadataChildren(1539.14, \"Stream\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /library/all/top: get: tags: @@ -8158,18 +7875,23 @@ paths: operationId: getTopWatchedContent parameters: - name: type - description: 'the library type (1 - movies, 2 - shows, 3 - music)' in: query + description: | + The type of media to retrieve. + 1 = movie + 2 = show + 3 = season + 4 = episode + E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries schema: type: integer + enum: + - 1 + - 2 + - 3 + - 4 + example: 2 required: true - examples: - movies: - value: 1 - shows: - value: 2 - music: - value: 3 - name: includeGuids in: query description: | @@ -8370,6 +8092,29 @@ paths: type: integer format: int32 example: 220 + '400': + description: 'Bad Request - A parameter was not specified, or was specified incorrectly.' + '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 x-codeSamples: - lang: php label: getTopWatchedContent @@ -8477,22 +8222,7 @@ paths: } - lang: typescript label: getTopWatchedContent - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getTopWatchedContent(1, 1); - - // Handle the result - console.log(result) - } - - run(); + source: "import { GetTopWatchedContentQueryParamType, PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getTopWatchedContent(GetTopWatchedContentQueryParamType.Two, 1);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /library/onDeck: get: tags: @@ -8921,67 +8651,76 @@ paths: } - lang: typescript label: getOnDeck - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.library.getOnDeck(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.library.getOnDeck();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /resources: get: servers: - url: 'https://plex.tv/api/v2' - security: [] tags: - Plex - summary: Get Resources - description: Get Resources - operationId: getResources + summary: Get Server Resources + description: Get Plex server access tokens and server connections + operationId: get-server-resources parameters: - name: X-Plex-Client-Identifier description: | 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) - in: header + in: query schema: type: string - example: Postman + example: gcgzw5rz2xovp84b4vha3a40 + required: true + - name: X-Plex-Token + in: query + description: Plex Authentication Token + schema: + type: string + example: CV5xoxjTpFKUzBTShsaf required: true - name: includeHttps in: query description: Include Https entries in the results schema: type: integer + format: int32 enum: - 0 - 1 + example: 1 + default: 0 - name: includeRelay in: query - description: Include Relay addresses in the results + description: "Include Relay addresses in the results \nE.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400\n" schema: type: integer + format: int32 enum: - 0 - 1 + example: 1 + default: 0 - name: includeIPv6 in: query description: Include IPv6 entries in the results schema: type: integer + format: int32 enum: - 0 - 1 + example: 1 + default: 0 + - name: Accept + in: header + required: false + schema: + type: string + enum: + - application/json + - application/xml + example: application/json responses: '200': description: List of Plex Devices. This includes Plex hosted servers and clients @@ -9003,6 +8742,20 @@ paths: - createdAt - lastSeenAt - provides + - ownerId + - sourceTitle + - publicAddress + - accessToken + - owned + - home + - synced + - relay + - presence + - httpsRequired + - publicAddressMatches + - dnsRebindingProtection + - natLoopbackSupported + - connections properties: name: type: string @@ -9011,11 +8764,17 @@ paths: productVersion: type: string platform: - type: string + type: + - 'null' + - string platformVersion: - type: string + type: + - 'null' + - string device: - type: string + type: + - 'null' + - string clientIdentifier: type: string createdAt: @@ -9027,11 +8786,14 @@ paths: provides: type: string ownerId: - type: string - format: nullable + description: ownerId is null when the device is owned by the token used to send the request + type: + - 'null' + - integer sourceTitle: - type: string - format: nullable + type: + - 'null' + - string publicAddress: type: string accessToken: @@ -9058,6 +8820,14 @@ paths: type: array items: type: object + required: + - protocol + - address + - port + - uri + - local + - relay + - IPv6 properties: protocol: type: string @@ -9098,22 +8868,8 @@ paths: example: 401 x-codeSamples: - lang: typescript - label: getResources - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getResources("Postman"); - - // Handle the result - console.log(result) - } - - run(); + label: resources + source: "import { IncludeHttps, IncludeIPv6, IncludeRelay, PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getServerResources({\n xPlexToken: \"CV5xoxjTpFKUzBTShsaf\",\n includeHttps: IncludeHttps.One,\n includeRelay: IncludeRelay.One,\n includeIPv6: IncludeIPv6.One,\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /log: get: tags: @@ -9288,22 +9044,7 @@ paths: } - lang: typescript label: logLine - source: |- - import { Level, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.log.logLine(Level.Three, "Test log message", "Postman"); - - // Handle the result - console.log(result) - } - - run(); + source: "import { Level, PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.log.logLine(Level.Three, \"Test log message\", \"Postman\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" post: tags: - Log @@ -9459,24 +9200,7 @@ paths: } - lang: typescript label: logMultiLine - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.log.logMultiLine("level=4&message=Test%20message%201&source=postman - level=3&message=Test%20message%202&source=postman - level=1&message=Test%20message%203&source=postman"); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.log.logMultiLine(\"level=4&message=Test%20message%201&source=postman\\n\" +\n \"level=3&message=Test%20message%202&source=postman\\n\" +\n \"level=1&message=Test%20message%203&source=postman\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /log/networked: get: tags: @@ -9616,22 +9340,7 @@ paths: } - lang: typescript label: enablePaperTrail - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.log.enablePaperTrail(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.log.enablePaperTrail();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /myplex/account: get: tags: @@ -9812,22 +9521,7 @@ paths: } - lang: typescript label: getMyPlexAccount - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getMyPlexAccount(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getMyPlexAccount();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/photo/:/transcode': get: tags: @@ -10054,30 +9748,7 @@ paths: } - lang: typescript label: getResizedPhoto - source: |- - import { MinSize, PlexAPI, Upscale } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getResizedPhoto({ - width: 110, - height: 165, - opacity: 100, - blur: 20, - minSize: MinSize.One, - upscale: Upscale.Zero, - url: "/library/metadata/49564/thumb/1654258204", - }); - - // Handle the result - console.log(result) - } - - run(); + source: "import { MinSize, PlexAPI, Upscale } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getResizedPhoto({\n width: 110,\n height: 165,\n opacity: 100,\n blur: 20,\n minSize: MinSize.One,\n upscale: Upscale.One,\n url: \"/library/metadata/49564/thumb/1654258204\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /pins: post: servers: @@ -10104,19 +9775,17 @@ paths: 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) - in: header + in: query schema: type: string - example: Postman + example: gcgzw5rz2xovp84b4vha3a40 required: true - name: X-Plex-Product - description: | - Product name of the application shown in the list of devices - in: header + in: query + required: false schema: type: string - example: Postman - required: true + example: Plex Web responses: '200': description: Requests a new pin id used in the authentication flow @@ -10424,21 +10093,7 @@ paths: } - lang: typescript label: getPin - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getPin("Postman", "Postman"); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getPin(\"gcgzw5rz2xovp84b4vha3a40\", \"Plex Web\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/pins/{pinID}': get: servers: @@ -10455,10 +10110,10 @@ paths: 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) - in: header + in: query schema: type: string - example: Postman + example: gcgzw5rz2xovp84b4vha3a40 required: true - name: pinID description: The PinID to retrieve an access token for @@ -10647,29 +10302,26 @@ paths: newRegistration: type: 'null' '400': + description: Bad Request response when the X-Plex-Client-Identifier is missing content: application/json: schema: - description: Bad Request response when the X-Plex-Client-Identifier is missing - content: - application/json: - schema: + type: object + properties: + errors: + type: array + items: type: object properties: - errors: - type: array - items: - type: object - properties: - code: - type: integer - example: 1000 - message: - type: string - example: X-Plex-Client-Identifier is missing - status: - type: integer - example: 400 + code: + type: integer + example: 1000 + message: + type: string + example: X-Plex-Client-Identifier is missing + status: + type: integer + example: 400 '404': description: Not Found or Expired content: @@ -10795,21 +10447,7 @@ paths: } - lang: typescript label: getTokenByPinId - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getTokenByPinId(408895, "Postman"); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.plex.getTokenByPinId(408895, \"gcgzw5rz2xovp84b4vha3a40\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /playlists: post: tags: @@ -11082,27 +10720,7 @@ paths: } - lang: typescript label: createPlaylist - source: |- - import { PlexAPI, QueryParamType, Smart } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.createPlaylist({ - title: "", - type: QueryParamType.Photo, - smart: Smart.One, - uri: "https://inborn-brochure.biz", - }); - - // Handle the result - console.log(result) - } - - run(); + source: "import { CreatePlaylistQueryParamType, PlexAPI, Smart } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.createPlaylist({\n title: \"\",\n type: CreatePlaylistQueryParamType.Photo,\n smart: Smart.One,\n uri: \"https://inborn-brochure.biz\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" get: tags: - Playlists @@ -11338,22 +10956,7 @@ paths: } - lang: typescript label: getPlaylists - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.getPlaylists(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.getPlaylists();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/playlists/{playlistID}': get: tags: @@ -11569,22 +11172,7 @@ paths: } - lang: typescript label: getPlaylist - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.getPlaylist(4109.48); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.getPlaylist(4109.48);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" delete: tags: - Playlists @@ -11730,22 +11318,7 @@ paths: } - lang: typescript label: deletePlaylist - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.deletePlaylist(216.22); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.deletePlaylist(216.22);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" put: tags: - Playlists @@ -11909,22 +11482,7 @@ paths: } - lang: typescript label: updatePlaylist - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.updatePlaylist(3915); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.updatePlaylist(3915);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/playlists/{playlistID}/items': get: tags: @@ -11940,10 +11498,22 @@ paths: type: number required: true - name: type - description: the metadata type of the item to return in: query + description: | + The type of media to retrieve. + 1 = movie + 2 = show + 3 = season + 4 = episode + E.g. A movie library will not return anything with type 3 as there are no seasons for movie libraries schema: - type: number + type: integer + enum: + - 1 + - 2 + - 3 + - 4 + example: 2 required: true responses: '200': @@ -12343,22 +11913,7 @@ paths: } - lang: typescript label: getPlaylistContents - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.getPlaylistContents(5004.46, 9403.59); - - // Handle the result - console.log(result) - } - - run(); + source: "import { GetPlaylistContentsQueryParamType, PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.getPlaylistContents(5004.46, GetPlaylistContentsQueryParamType.Two);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" delete: tags: - Playlists @@ -12504,22 +12059,7 @@ paths: } - lang: typescript label: clearPlaylistContents - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.clearPlaylistContents(1893.18); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.clearPlaylistContents(1893.18);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" put: tags: - Playlists @@ -12756,22 +12296,7 @@ paths: } - lang: typescript label: addPlaylistContents - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.addPlaylistContents(8502.01, "server://12345/com.plexapp.plugins.library/library/metadata/1", 123); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.addPlaylistContents(8502.01, \"server://12345/com.plexapp.plugins.library/library/metadata/1\", 123);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /playlists/upload: post: tags: @@ -12933,22 +12458,225 @@ paths: } - lang: typescript label: uploadPlaylist - source: |- - import { Force, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.playlists.uploadPlaylist("/home/barkley/playlist.m3u", Force.Zero); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI, QueryParamForce } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.playlists.uploadPlaylist(\"/home/barkley/playlist.m3u\", QueryParamForce.Zero);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" + /media/providers: + get: + tags: + - Server + summary: Get Media Providers + description: Retrieves media providers and their features from the Plex server. + operationId: get-media-providers + parameters: + - name: Accept + in: header + required: false + schema: + type: string + enum: + - application/json + - application/xml + example: application/json + - name: X-Plex-Token + in: query + description: Plex Authentication Token + schema: + type: string + example: CV5xoxjTpFKUzBTShsaf + required: true + responses: + '200': + description: Media providers and their features + content: + application/json: + schema: + type: object + properties: + MediaContainer: + type: object + properties: + size: + type: integer + allowCameraUpload: + type: boolean + allowChannelAccess: + type: boolean + allowSharing: + type: boolean + allowSync: + type: boolean + allowTuners: + type: boolean + backgroundProcessing: + type: boolean + certificate: + type: boolean + companionProxy: + type: boolean + countryCode: + type: string + diagnostics: + type: string + eventStream: + type: boolean + friendlyName: + type: string + livetv: + type: integer + machineIdentifier: + type: string + musicAnalysis: + type: integer + myPlex: + type: boolean + myPlexMappingState: + type: string + myPlexSigninState: + type: string + myPlexSubscription: + type: boolean + myPlexUsername: + type: string + offlineTranscode: + type: integer + ownerFeatures: + type: string + platform: + type: string + platformVersion: + type: string + pluginHost: + type: boolean + pushNotifications: + type: boolean + readOnlyLibraries: + type: boolean + streamingBrainABRVersion: + type: integer + streamingBrainVersion: + type: integer + sync: + type: boolean + transcoderActiveVideoSessions: + type: integer + transcoderAudio: + type: boolean + transcoderLyrics: + type: boolean + transcoderSubtitles: + type: boolean + transcoderVideo: + type: boolean + transcoderVideoBitrates: + type: string + transcoderVideoQualities: + type: string + transcoderVideoResolutions: + type: string + updatedAt: + type: integer + updater: + type: boolean + version: + type: string + voiceSearch: + type: boolean + MediaProvider: + type: array + items: + type: object + properties: + identifier: + type: string + title: + type: string + types: + type: string + protocols: + type: string + Feature: + type: array + items: + type: object + properties: + key: + type: string + type: + type: string + Directory: + type: array + items: + type: object + properties: + hubKey: + type: string + title: + type: string + agent: + type: string + language: + type: string + refreshing: + type: boolean + scanner: + type: string + uuid: + type: string + id: + type: string + key: + type: string + type: + type: string + subtype: + type: string + updatedAt: + type: integer + scannedAt: + type: integer + Pivot: + type: array + items: + type: object + properties: + id: + type: string + key: + type: string + type: + type: string + title: + type: string + context: + type: string + symbol: + type: string + '400': + description: 'Bad Request - A parameter was not specified, or was specified incorrectly.' + '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 + x-codeSamples: + - lang: typescript + label: providers + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getMediaProviders(\"CV5xoxjTpFKUzBTShsaf\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /search: get: tags: @@ -13335,22 +13063,7 @@ paths: } - lang: typescript label: getSearchResults - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.search.getSearchResults("110"); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.search.getSearchResults(\"110\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /security/token: get: tags: @@ -13512,22 +13225,7 @@ paths: } - lang: typescript label: getTransientToken - source: |- - import { GetTransientTokenQueryParamType, PlexAPI, Scope } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.authentication.getTransientToken(GetTransientTokenQueryParamType.Delegation, Scope.All); - - // Handle the result - console.log(result) - } - - run(); + source: "import { GetTransientTokenQueryParamType, PlexAPI, Scope } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.authentication.getTransientToken(GetTransientTokenQueryParamType.Delegation, Scope.All);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /security/resources: get: tags: @@ -13678,22 +13376,7 @@ paths: } - lang: typescript label: getSourceConnectionInformation - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.authentication.getSourceConnectionInformation("server://client-identifier"); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.authentication.getSourceConnectionInformation(\"server://client-identifier\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /servers: get: tags: @@ -13866,22 +13549,7 @@ paths: } - lang: typescript label: getServerList - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.server.getServerList(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.server.getServerList();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /statistics/media: get: tags: @@ -14130,22 +13798,7 @@ paths: } - lang: typescript label: getStatistics - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.statistics.getStatistics(4); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.statistics.getStatistics(4);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /statistics/resources: get: tags: @@ -14335,22 +13988,7 @@ paths: } - lang: typescript label: getResourcesStatistics - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.statistics.getResourcesStatistics(4); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.statistics.getResourcesStatistics(4);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /statistics/bandwidth: get: tags: @@ -14448,7 +14086,7 @@ paths: deviceID: type: integer format: int32 - exmaple: 208 + example: 208 timespan: type: integer example: 6 @@ -14592,22 +14230,7 @@ paths: } - lang: typescript label: getBandwidthStatistics - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.statistics.getBandwidthStatistics(4); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.statistics.getBandwidthStatistics(4);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /status/sessions: get: tags: @@ -15078,22 +14701,7 @@ paths: } - lang: typescript label: getSessions - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.sessions.getSessions(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.sessions.getSessions();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /status/sessions/history/all: get: tags: @@ -15380,22 +14988,7 @@ paths: } - lang: typescript label: getSessionHistory - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.sessions.getSessionHistory("viewedAt:desc", 1, {}, 12); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.sessions.getSessionHistory(\"viewedAt:desc\", 1, {}, 12);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /transcode/sessions: get: tags: @@ -15652,22 +15245,7 @@ paths: } - lang: typescript label: getTranscodeSessions - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.sessions.getTranscodeSessions(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.sessions.getTranscodeSessions();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/transcode/sessions/{sessionKey}': delete: tags: @@ -15814,22 +15392,7 @@ paths: } - lang: typescript label: stopTranscodeSession - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.sessions.stopTranscodeSession("zz7llzqlx8w9vnrsbnwhbmep"); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.sessions.stopTranscodeSession(\"zz7llzqlx8w9vnrsbnwhbmep\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /updater/status: get: tags: @@ -16058,22 +15621,7 @@ paths: } - lang: typescript label: getUpdateStatus - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.updater.getUpdateStatus(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.updater.getUpdateStatus();\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /updater/check: put: tags: @@ -16225,22 +15773,7 @@ paths: } - lang: typescript label: checkForUpdates - source: |- - import { Download, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.updater.checkForUpdates(Download.One); - - // Handle the result - console.log(result) - } - - run(); + source: "import { Download, PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.updater.checkForUpdates(Download.One);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /updater/apply: put: tags: @@ -16261,7 +15794,7 @@ paths: - 1 example: 1 - name: skip - description: Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. + description: 'Indicate that the latest version should be marked as skipped. The [Release] entry for this version will have the `state` set to `skipped`.' required: false in: query schema: @@ -16408,22 +15941,7 @@ paths: } - lang: typescript label: applyUpdates - source: |- - import { PlexAPI, Skip, Tonight } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.updater.applyUpdates(Tonight.One, Skip.One); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI, Skip, Tonight } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.updater.applyUpdates(Tonight.One, Skip.One);\n \n // Handle the result\n console.log(result)\n}\n\nrun();" '/video/:/transcode/universal/start.mpd': get: tags: @@ -16723,48 +16241,33 @@ paths: } - lang: typescript label: startUniversalTranscode - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.video.startUniversalTranscode({ - hasMDE: 1, - path: "/library/metadata/23409", - mediaIndex: 0, - partIndex: 0, - protocol: "hls", - fastSeek: 0, - directPlay: 0, - directStream: 0, - subtitleSize: 100, - subtites: "burn", - audioBoost: 100, - location: "lan", - mediaBufferSize: 102400, - session: "zvcage8b7rkioqcm8f4uns4c", - addDebugOverlay: 0, - autoAdjustQuality: 0, - }); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.video.startUniversalTranscode({\n hasMDE: 1,\n path: \"/library/metadata/23409\",\n mediaIndex: 0,\n partIndex: 0,\n protocol: \"hls\",\n fastSeek: 0,\n directPlay: 0,\n directStream: 0,\n subtitleSize: 100,\n subtites: \"burn\",\n audioBoost: 100,\n location: \"lan\",\n mediaBufferSize: 102400,\n session: \"zvcage8b7rkioqcm8f4uns4c\",\n addDebugOverlay: 0,\n autoAdjustQuality: 0,\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /user: get: servers: - url: 'https://plex.tv/api/v2' tags: - - Plex - summary: Get UserData By Token + - Authentication + summary: Get User Data By Token description: Get the User data from the provided X-Plex-Token operationId: getUserDetails + parameters: + - name: X-Plex-Token + in: query + description: Plex Authentication Token + schema: + type: string + example: CV5xoxjTpFKUzBTShsaf + required: true + - name: Accept + in: header + required: false + schema: + type: string + enum: + - application/json + - application/xml + example: application/json responses: '200': description: Logged in user details @@ -16920,7 +16423,9 @@ paths: description: Unknown format: date-time anonymous: - type: boolean + type: + - boolean + - 'null' description: Unknown default: false authToken: @@ -17007,7 +16512,7 @@ paths: mailingListStatus: description: Your current mailing list status enum: - - subscribed + - active - unsubscribed maxHomeSize: type: integer @@ -17019,42 +16524,58 @@ paths: description: '[Might be removed] The hashed Plex Home PIN ' deprecated: true profile: - type: array - items: - title: UserProfile - type: object - properties: - autoSelectAudio: - type: boolean - example: true - default: true - description: If the account has automatically select audio and subtitle tracks enabled - defaultAudioLanguage: - type: string - example: ja - description: The preferred audio language for the account - defaultSubtitleLanguage: - type: string - example: en - description: The preferred subtitle language for the account - autoSelectSubtitle: - type: integer - example: 1 - description: 'The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)' - defaultSubtitleAccessibility: - type: integer - example: 1 - description: 'The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles)' - defaultSubtitleForced: - type: integer - example: 0 - description: 'The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)' - watchedIndicator: - type: integer - example: 1 - mediaReviewsVisibility: - type: integer - example: 0 + title: UserProfile + type: object + required: + - defaultAudioLanguage + - defaultSubtitleLanguage + properties: + autoSelectAudio: + type: boolean + example: true + default: true + description: If the account has automatically select audio and subtitle tracks enabled + defaultAudioLanguage: + type: + - string + - 'null' + example: ja + description: The preferred audio language for the account + defaultSubtitleLanguage: + type: + - string + - 'null' + example: en + description: The preferred subtitle language for the account + autoSelectSubtitle: + example: 1 + description: 'The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)' + enum: + - 0 + - 1 + defaultSubtitleAccessibility: + enum: + - 0 + - 1 + example: 1 + description: 'The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles)' + defaultSubtitleForced: + enum: + - 0 + - 1 + example: 0 + description: 'The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)' + watchedIndicator: + enum: + - 0 + - 1 + example: 1 + mediaReviewsVisibility: + enum: + - 0 + - 1 + type: integer + example: 0 protected: type: boolean description: If the account has a Plex Home PIN enabled @@ -17183,9 +16704,10 @@ paths: example: true subscribedAt: description: Date the account subscribed to Plex Pass - type: string + type: + - string + - 'null' example: '2021-04-12T18:21:12Z' - format: date-time status: description: String representation of subscriptionActive example: Inactive @@ -17283,9 +16805,10 @@ paths: example: true subscribedAt: description: Date the account subscribed to Plex Pass - type: string + type: + - string + - 'null' example: '2021-04-12T18:21:12Z' - format: date-time status: description: String representation of subscriptionActive example: Inactive @@ -17349,42 +16872,27 @@ paths: x-codeSamples: - lang: typescript label: getUserDetails - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.plex.getUserDetails(); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n accessToken: \"\",\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.authentication.getUserDetails(\"CV5xoxjTpFKUzBTShsaf\");\n \n // Handle the result\n console.log(result)\n}\n\nrun();" /users/signin: post: servers: - url: 'https://plex.tv/api/v2' security: [] tags: - - User + - Authentication summary: Get User SignIn Data description: Sign in user with username and password and return user data with Plex authentication token - operationId: post-users-signin-data + operationId: post-users-sign-in-data parameters: - name: X-Plex-Client-Identifier description: | 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) - in: header + in: query schema: type: string - example: Postman + example: gcgzw5rz2xovp84b4vha3a40 required: true requestBody: content: @@ -17563,7 +17071,9 @@ paths: description: Unknown format: date-time anonymous: - type: boolean + type: + - boolean + - 'null' description: Unknown default: false authToken: @@ -17650,7 +17160,7 @@ paths: mailingListStatus: description: Your current mailing list status enum: - - subscribed + - active - unsubscribed maxHomeSize: type: integer @@ -17662,42 +17172,58 @@ paths: description: '[Might be removed] The hashed Plex Home PIN ' deprecated: true profile: - type: array - items: - title: UserProfile - type: object - properties: - autoSelectAudio: - type: boolean - example: true - default: true - description: If the account has automatically select audio and subtitle tracks enabled - defaultAudioLanguage: - type: string - example: ja - description: The preferred audio language for the account - defaultSubtitleLanguage: - type: string - example: en - description: The preferred subtitle language for the account - autoSelectSubtitle: - type: integer - example: 1 - description: 'The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)' - defaultSubtitleAccessibility: - type: integer - example: 1 - description: 'The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles)' - defaultSubtitleForced: - type: integer - example: 0 - description: 'The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)' - watchedIndicator: - type: integer - example: 1 - mediaReviewsVisibility: - type: integer - example: 0 + title: UserProfile + type: object + required: + - defaultAudioLanguage + - defaultSubtitleLanguage + properties: + autoSelectAudio: + type: boolean + example: true + default: true + description: If the account has automatically select audio and subtitle tracks enabled + defaultAudioLanguage: + type: + - string + - 'null' + example: ja + description: The preferred audio language for the account + defaultSubtitleLanguage: + type: + - string + - 'null' + example: en + description: The preferred subtitle language for the account + autoSelectSubtitle: + example: 1 + description: 'The auto-select subtitle mode (0 = Manually selected, 1 = Shown with foreign audio, 2 = Always enabled)' + enum: + - 0 + - 1 + defaultSubtitleAccessibility: + enum: + - 0 + - 1 + example: 1 + description: 'The subtitles for the deaf or hard-of-hearing (SDH) searches mode (0 = Prefer non-SDH subtitles, 1 = Prefer SDH subtitles, 2 = Only show SDH subtitles, 3 = Only shown non-SDH subtitles)' + defaultSubtitleForced: + enum: + - 0 + - 1 + example: 0 + description: 'The forced subtitles searches mode (0 = Prefer non-forced subtitles, 1 = Prefer forced subtitles, 2 = Only show forced subtitles, 3 = Only show non-forced subtitles)' + watchedIndicator: + enum: + - 0 + - 1 + example: 1 + mediaReviewsVisibility: + enum: + - 0 + - 1 + type: integer + example: 0 protected: type: boolean description: If the account has a Plex Home PIN enabled @@ -17826,9 +17352,10 @@ paths: example: true subscribedAt: description: Date the account subscribed to Plex Pass - type: string + type: + - string + - 'null' example: '2021-04-12T18:21:12Z' - format: date-time status: description: String representation of subscriptionActive example: Inactive @@ -17926,9 +17453,10 @@ paths: example: true subscribedAt: description: Date the account subscribed to Plex Pass - type: string + type: + - string + - 'null' example: '2021-04-12T18:21:12Z' - format: date-time status: description: String representation of subscriptionActive example: Inactive @@ -18002,18 +17530,21 @@ paths: - string - 'null' renewsAt: - type: - - integer - - 'null' - description: Unix epoch datetime - format: int32 + oneOf: + - type: + - integer + example: 1556281940 + description: Unix epoch datetime + format: int32 + - type: 'null' endsAt: - type: - - integer - - 'null' - example: 1556281940 - description: Unix epoch datetime - format: int32 + oneOf: + - type: + - integer + example: 1556281940 + description: Unix epoch datetime + format: int32 + - type: 'null' canceled: type: boolean example: false @@ -18054,19 +17585,17 @@ paths: enum: - ended billing: - type: array - items: - type: object - required: - - internalPaymentMethod - - paymentMethodId - properties: - internalPaymentMethod: - type: object - paymentMethodId: - type: - - integer - - 'null' + type: object + required: + - internalPaymentMethod + - paymentMethodId + properties: + internalPaymentMethod: + type: object + paymentMethodId: + type: + - integer + - 'null' trials: type: array items: @@ -18097,401 +17626,7 @@ paths: x-codeSamples: - lang: typescript label: data - source: |- - import { PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.user.postUsersSigninData("Postman", { - login: "username@email.com", - password: "password123", - }); - - // Handle the result - console.log(result) - } - - run(); - '/library/sections/watchlist/{filter}': - servers: - - url: 'https://metadata.provider.plex.tv' - description: The plex metadata provider server - get: - tags: - - Watchlist - summary: Get User Watchlist - description: Get User Watchlist - operationId: getWatchlist - parameters: - - name: filter - description: Filter - in: path - required: true - schema: - type: string - enum: - - all - - available - - released - - name: sort - description: | - In the format "field:dir". Available fields are "watchlistedAt" (Added At), - "titleSort" (Title), "originallyAvailableAt" (Release Date), or "rating" (Critic Rating). - "dir" can be "asc" or "desc" - in: query - required: false - schema: - type: string - - name: libtype - description: | - The type of library to filter. Can be "movie" or "show", or all if not present. - in: query - required: false - schema: - type: string - enum: - - movie - - show - - name: maxresults - description: | - The number of items to return. If not specified, all items will be returned. - If the number of items exceeds the limit, the response will be paginated. - in: query - required: false - schema: - type: integer - format: int32 - - name: includeCollections - description: | - include collections in the results - in: query - required: false - schema: - type: integer - enum: - - 1 - - 0 - - name: includeExternalMedia - description: | - include external media in the results - in: query - required: false - schema: - type: integer - enum: - - 1 - - 0 - - name: X-Plex-Token - description: User Token - in: query - required: true - schema: - type: string - - name: X-Plex-Container-Start - description: | - The index of the first item to return. If not specified, the first item will be returned. - If the number of items exceeds the limit, the response will be paginated. - in: query - required: false - schema: - type: integer - format: int32 - - name: X-Plex-Container-Size - description: | - The number of items to return. If not specified, all items will be returned. - If the number of items exceeds the limit, the response will be paginated. - in: query - required: false - schema: - type: integer - format: int32 - responses: - '200': - description: Watchlist Data - content: - application/json: - schema: - type: object - properties: - librarySectionID: - type: string - librarySectionTitle: - type: string - offset: - type: integer - format: int32 - totalSize: - type: integer - format: int32 - identifier: - type: string - size: - type: integer - format: int32 - Metadata: - type: array - items: - type: object - properties: - art: - type: string - guid: - type: string - key: - type: string - ratingKey: - type: string - studio: - type: string - tagline: - type: string - type: - type: string - thumb: - type: string - addedAt: - type: integer - format: int32 - duration: - type: integer - format: int32 - publicPagesURL: - type: string - slug: - type: string - userState: - type: boolean - title: - type: string - contentRating: - type: string - originallyAvailableAt: - type: string - format: date - year: - type: integer - format: int32 - Image: - type: array - items: - type: object - properties: - alt: - type: string - type: - type: string - url: - type: string - banner: - type: string - rating: - type: number - expiresAt: - type: integer - format: int32 - originalTitle: - type: string - audienceRating: - type: number - audienceRatingImage: - type: string - ratingImage: - type: string - imdbRatingCount: - type: integer - format: int32 - subtype: - type: string - theme: - type: string - leafCount: - type: integer - format: int32 - childCount: - type: integer - format: int32 - isContinuingSeries: - type: boolean - skipChildren: - type: boolean - availabilityId: - type: string - streamingMediaId: - type: string - playableKey: - type: string - '400': - description: 'Bad Request - A parameter was not specified, or was specified incorrectly.' - '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 - x-codeSamples: - - lang: php - label: getWatchlist - source: |- - declare(strict_types=1); - - require 'vendor/autoload.php'; - - use LukeHagar\Plex_API; - use LukeHagar\Plex_API\Models\Components; - use LukeHagar\Plex_API\Models\Operations; - - $security = new Components\Security(); - $security->accessToken = ''; - - $sdk = Plex_API\PlexAPI::builder() - ->setXPlexClientIdentifier('Postman') - ->setSecurity($security)->build(); - - try { - $request = new Operations\GetWatchlistRequest( - filter: Operations\PathParamFilter::Released, - sort: '', - libtype: Operations\Libtype::Movie, - maxresults: 303056, - includeCollections: Operations\IncludeCollections::Zero, - includeExternalMedia: Operations\IncludeExternalMedia::One, - xPlexToken: '', - xPlexContainerStart: 406911, - xPlexContainerSize: 958629, - ); - $response = $sdk->watchlist->getWatchlist($request); - - if ($response->object !== null) { - // handle response - } - } catch (Throwable $e) { - // handle exception - } - - lang: ruby - label: getWatchlist - source: "require 'plexruby'\n\n\ns = ::OpenApiSDK::PlexAPI.new(\n x_plex_client_identifier: \"Postman\",\n )\ns.config_security(\n ::OpenApiSDK::Shared::Security.new(\n access_token: \"\",\n )\n)\n\n\nreq = ::OpenApiSDK::Operations::GetWatchlistRequest.new(\n filter: ::OpenApiSDK::Operations::PathParamFilter::RELEASED,\n x_plex_token: \"\",\n)\n \nres = s.watchlist.get_watchlist(req)\n\nif ! res.two_hundred_application_json_object.nil?\n # handle response\nend" - - lang: go - label: getWatchlist - source: |- - package main - - import( - "github.com/LukeHagar/plexgo" - "github.com/LukeHagar/plexgo/models/operations" - "context" - "log" - ) - - func main() { - s := plexgo.New( - plexgo.WithSecurity(""), - plexgo.WithXPlexClientIdentifier("Postman"), - ) - request := operations.GetWatchlistRequest{ - Filter: operations.PathParamFilterReleased, - XPlexToken: "", - } - ctx := context.Background() - res, err := s.Watchlist.GetWatchlist(ctx, request) - if err != nil { - log.Fatal(err) - } - if res.Object != nil { - // handle response - } - } - - lang: java - label: getWatchlist - source: |- - package hello.world; - - import java.math.BigDecimal; - import java.math.BigDecimal; - import java.math.BigInteger; - import java.time.LocalDate; - import java.time.OffsetDateTime; - import java.util.Optional; - import lukehagar.plexapi.plexapi.PlexAPI; - import lukehagar.plexapi.plexapi.models.operations.*; - import lukehagar.plexapi.plexapi.models.shared.*; - import lukehagar.plexapi.plexapi.models.shared.Security; - import lukehagar.plexapi.plexapi.utils.EventStream; - import org.openapitools.jackson.nullable.JsonNullable; - import static java.util.Map.entry; - - public class Application { - - public static void main(String[] args) throws Exception { - try { - PlexAPI sdk = PlexAPI.builder() - .accessToken("") - .xPlexClientIdentifier("Postman") - .build(); - - GetWatchlistRequest req = GetWatchlistRequest.builder() - .filter(PathParamFilter.RELEASED) - .xPlexToken("") - .build(); - - GetWatchlistResponse res = sdk.watchlist().getWatchlist() - .request(req) - .call(); - - if (res.object().isPresent()) { - // handle response - } - } catch (lukehagar.plexapi.plexapi.models.errors.GetWatchlistResponseBody e) { - // handle exception - throw e; - } catch (lukehagar.plexapi.plexapi.models.errors.SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - - } - } - - lang: typescript - label: getWatchlist - source: |- - import { PathParamFilter, PlexAPI } from "@lukehagar/plexjs"; - - const plexAPI = new PlexAPI({ - accessToken: "", - xPlexClientIdentifier: "Postman", - }); - - async function run() { - const result = await plexAPI.watchlist.getWatchlist({ - filter: PathParamFilter.Released, - xPlexToken: "", - }); - - // Handle the result - console.log(result) - } - - run(); + source: "import { PlexAPI } from \"@lukehagar/plexjs\";\n\nconst plexAPI = new PlexAPI({\n xPlexClientIdentifier: \"gcgzw5rz2xovp84b4vha3a40\",\n});\n\nasync function run() {\n const result = await plexAPI.authentication.postUsersSignInData(\"gcgzw5rz2xovp84b4vha3a40\", {\n login: \"username@email.com\",\n password: \"password123\",\n });\n \n // Handle the result\n console.log(result)\n}\n\nrun();" tags: - name: Activities description: |