mirror of
https://github.com/LukeHagar/plex-docs.git
synced 2025-12-06 04:20:40 +00:00
56 lines
16 KiB
Plaintext
56 lines
16 KiB
Plaintext
---
|
|
id: get-library-details
|
|
sidebar_label: Get Library Details
|
|
hide_title: true
|
|
hide_table_of_contents: true
|
|
api: {"tags":["Library"],"description":"Returns details for the library. This can be thought of as an interstitial endpoint because it contains information about the library, rather than content itself. These details are:\n\n- A list of `Directory` objects: These used to be used by clients to build a menuing system. There are four flavors of directory found here:\n - Primary: (e.g. all, On Deck) These are still used in some clients to provide \"shortcuts\" to subsets of media. However, with the exception of On Deck, all of them can be created by media queries, and the desire is to allow these to be customized by users.\n - Secondary: These are marked with `secondary=\"1\"` and were used by old clients to provide nested menus allowing for primative (but structured) navigation.\n - Special: There is a By Folder entry which allows browsing the media by the underlying filesystem structure, and there's a completely obsolete entry marked `search=\"1\"` which used to be used to allow clients to build search dialogs on the fly.\n- A list of `Type` objects: These represent the types of things found in this library, and for each one, a list of `Filter` and `Sort` objects. These can be used to build rich controls around a grid of media to allow filtering and organizing. Note that these filters and sorts are optional, and without them, the client won't render any filtering controls. The `Type` object contains:\n - `key`: This provides the root endpoint returning the actual media list for the type.\n - `type`: This is the metadata type for the type (if a standard Plex type).\n - `title`: The title for for the content of this type (e.g. \"Movies\").\n- Each `Filter` object contains a description of the filter. Note that it is not an exhaustive list of the full media query language, but an inportant subset useful for top-level API.\n - `filter`: This represents the filter name used for the filter, which can be used to construct complex media queries with.\n - `filterType`: This is either `string`, `integer`, or `boolean`, and describes the type of values used for the filter.\n - `key`: This provides the endpoint where the possible range of values for the filter can be retrieved (e.g. for a \"Genre\" filter, it returns a list of all the genres in the library). This will include a `type` argument that matches the metadata type of the Type element.\n - `title`: The title for the filter.\n- Each `Sort` object contains a description of the sort field.\n - `defaultDirection`: Can be either `asc` or `desc`, and specifies the default direction for the sort field (e.g. titles default to alphabetically ascending).\n - `descKey` and `key`: Contains the parameters passed to the `sort=...` media query for each direction of the sort.\n - `title`: The title of the field.\n","operationId":"getLibraryDetails","parameters":[{"name":"sectionId","description":"the Id of the library to query","in":"path","schema":{"type":"string","example":1000},"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","in":"query","schema":{"type":"number","enum":[0,1],"default":0},"required":false}],"responses":{"200":{"description":"The details of the library"},"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}}}}}}}}}},"method":"get","path":"/library/sections/{sectionId}","servers":[{"url":"http://{Local IP}:{Port}","variables":{"Local IP":{"default":"10.10.10.47","description":"The Local IP Address of your plex server"},"Port":{"default":"32400","description":"The port to access your plex server"}}},{"url":"https://{Local IP}:{Port}","variables":{"Local IP":{"default":"10.10.10.47","description":"The Local IP Address of your plex server"},"Port":{"default":"32400","description":"The port to access your plex server"}}}],"security":[{"Token":[],"ClientIdentifier":[],"Device":[],"DeviceName":[],"Platform":[],"PlatformVersion":[],"Product":[],"Version":[]}],"securitySchemes":{"Token":{"description":"Plex Authentication Token","type":"apiKey","in":"header","name":"X-Plex-Token"},"ClientIdentifier":{"description":"Plex Authentication Token","type":"apiKey","in":"header","name":"X-Plex-Client-Identifier"},"DeviceName":{"description":"Primary name for the device eg. `Plex Web (Chrome)`","type":"apiKey","in":"header","name":"X-Plex-Device-Name"},"Device":{"description":"The type of device your application is running on\nDevice name and or model number, eg `iPhone3,2`, `Motorola XOOM™`, `LG5200TV`\n","type":"apiKey","in":"header","name":"X-Plex-Device"},"PlatformVersion":{"description":"Operating system version\neg `4.3.1`, `10.6.7`, `3.2`\n","type":"apiKey","in":"header","name":"X-Plex-Platform-Version"},"Platform":{"description":"Platform name \neg: `Web`, `iOS`, `MacOSX`, `Android`, `LG`\n","type":"apiKey","in":"header","name":"X-Plex-Platform"},"Product":{"description":"Plex application name \neg: `Laika`, `Plex Media Server`, `Media Link`\n","type":"apiKey","in":"header","name":"X-Plex-Product"},"Version":{"description":"Plex application version number","type":"apiKey","in":"header","name":"X-Plex-Version"}},"info":{"title":"Plex-API","summary":"A Plex Media Server API Map","description":"An Open API Spec for interacting with Plex.tv and Plex Servers","version":"0.0.3","contact":{"name":"Luke Hagar","url":"https://www.LukeHagar.com","email":"Lukeslakemail@gmail.com"},"license":{"name":"MIT","identifier":"MIT","url":"https://opensource.org/licenses/MIT"}},"postman":{"name":"Get Library Details","description":{"content":"Returns details for the library. This can be thought of as an interstitial endpoint because it contains information about the library, rather than content itself. These details are:\n\n- A list of `Directory` objects: These used to be used by clients to build a menuing system. There are four flavors of directory found here:\n - Primary: (e.g. all, On Deck) These are still used in some clients to provide \"shortcuts\" to subsets of media. However, with the exception of On Deck, all of them can be created by media queries, and the desire is to allow these to be customized by users.\n - Secondary: These are marked with `secondary=\"1\"` and were used by old clients to provide nested menus allowing for primative (but structured) navigation.\n - Special: There is a By Folder entry which allows browsing the media by the underlying filesystem structure, and there's a completely obsolete entry marked `search=\"1\"` which used to be used to allow clients to build search dialogs on the fly.\n- A list of `Type` objects: These represent the types of things found in this library, and for each one, a list of `Filter` and `Sort` objects. These can be used to build rich controls around a grid of media to allow filtering and organizing. Note that these filters and sorts are optional, and without them, the client won't render any filtering controls. The `Type` object contains:\n - `key`: This provides the root endpoint returning the actual media list for the type.\n - `type`: This is the metadata type for the type (if a standard Plex type).\n - `title`: The title for for the content of this type (e.g. \"Movies\").\n- Each `Filter` object contains a description of the filter. Note that it is not an exhaustive list of the full media query language, but an inportant subset useful for top-level API.\n - `filter`: This represents the filter name used for the filter, which can be used to construct complex media queries with.\n - `filterType`: This is either `string`, `integer`, or `boolean`, and describes the type of values used for the filter.\n - `key`: This provides the endpoint where the possible range of values for the filter can be retrieved (e.g. for a \"Genre\" filter, it returns a list of all the genres in the library). This will include a `type` argument that matches the metadata type of the Type element.\n - `title`: The title for the filter.\n- Each `Sort` object contains a description of the sort field.\n - `defaultDirection`: Can be either `asc` or `desc`, and specifies the default direction for the sort field (e.g. titles default to alphabetically ascending).\n - `descKey` and `key`: Contains the parameters passed to the `sort=...` media query for each direction of the sort.\n - `title`: The title of the field.\n","type":"text/plain"},"url":{"path":["library","sections",":sectionId"],"host":["{{baseUrl}}"],"query":[{"disabled":false,"description":{"content":"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","type":"text/plain"},"key":"includeDetails","value":""}],"variable":[{"disabled":false,"description":{"content":"(Required) the Id of the library to query","type":"text/plain"},"type":"any","value":"","key":"sectionId"}]},"header":[{"key":"Accept","value":"application/json"}],"method":"GET"}}
|
|
sidebar_class_name: "get api-method"
|
|
info_path: docs/plex-media-server/plex-api
|
|
---
|
|
|
|
import ApiTabs from "@theme/ApiTabs";
|
|
import DiscriminatorTabs from "@theme/DiscriminatorTabs";
|
|
import MethodEndpoint from "@theme/ApiDemoPanel/MethodEndpoint";
|
|
import MimeTabs from "@theme/MimeTabs";
|
|
import ParamsItem from "@theme/ParamsItem";
|
|
import ResponseSamples from "@theme/ResponseSamples";
|
|
import SchemaItem from "@theme/SchemaItem";
|
|
import SchemaTabs from "@theme/SchemaTabs";
|
|
import TabItem from "@theme/TabItem";
|
|
|
|
<h1 className={"openapi__heading"}>Get Library Details</h1>
|
|
|
|
<MethodEndpoint method={"get"} path={"/library/sections/{sectionId}"}></MethodEndpoint>
|
|
|
|
|
|
|
|
Returns details for the library. This can be thought of as an interstitial endpoint because it contains information about the library, rather than content itself. These details are:
|
|
|
|
- A list of `Directory` objects: These used to be used by clients to build a menuing system. There are four flavors of directory found here:
|
|
- Primary: (e.g. all, On Deck) These are still used in some clients to provide "shortcuts" to subsets of media. However, with the exception of On Deck, all of them can be created by media queries, and the desire is to allow these to be customized by users.
|
|
- Secondary: These are marked with `secondary="1"` and were used by old clients to provide nested menus allowing for primative (but structured) navigation.
|
|
- Special: There is a By Folder entry which allows browsing the media by the underlying filesystem structure, and there's a completely obsolete entry marked `search="1"` which used to be used to allow clients to build search dialogs on the fly.
|
|
- A list of `Type` objects: These represent the types of things found in this library, and for each one, a list of `Filter` and `Sort` objects. These can be used to build rich controls around a grid of media to allow filtering and organizing. Note that these filters and sorts are optional, and without them, the client won't render any filtering controls. The `Type` object contains:
|
|
- `key`: This provides the root endpoint returning the actual media list for the type.
|
|
- `type`: This is the metadata type for the type (if a standard Plex type).
|
|
- `title`: The title for for the content of this type (e.g. "Movies").
|
|
- Each `Filter` object contains a description of the filter. Note that it is not an exhaustive list of the full media query language, but an inportant subset useful for top-level API.
|
|
- `filter`: This represents the filter name used for the filter, which can be used to construct complex media queries with.
|
|
- `filterType`: This is either `string`, `integer`, or `boolean`, and describes the type of values used for the filter.
|
|
- `key`: This provides the endpoint where the possible range of values for the filter can be retrieved (e.g. for a "Genre" filter, it returns a list of all the genres in the library). This will include a `type` argument that matches the metadata type of the Type element.
|
|
- `title`: The title for the filter.
|
|
- Each `Sort` object contains a description of the sort field.
|
|
- `defaultDirection`: Can be either `asc` or `desc`, and specifies the default direction for the sort field (e.g. titles default to alphabetically ascending).
|
|
- `descKey` and `key`: Contains the parameters passed to the `sort=...` media query for each direction of the sort.
|
|
- `title`: The title of the field.
|
|
|
|
|
|
<details style={{"marginBottom":"1rem"}} className={"openapi-markdown__details"} data-collapsed={false} open={true}><summary style={{}}><strong>Path Parameters</strong></summary><div><ul><ParamsItem className={"paramsItem"} param={{"name":"sectionId","description":"the Id of the library to query","in":"path","schema":{"type":"string","example":1000},"required":true}}></ParamsItem></ul></div></details><details style={{"marginBottom":"1rem"}} className={"openapi-markdown__details"} data-collapsed={false} open={true}><summary style={{}}><strong>Query Parameters</strong></summary><div><ul><ParamsItem className={"paramsItem"} param={{"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","in":"query","schema":{"type":"number","enum":[0,1],"default":0},"required":false}}></ParamsItem></ul></div></details><div><div><ApiTabs><TabItem label={"200"} value={"200"}><div>
|
|
|
|
The details of the library
|
|
|
|
</div><div></div></TabItem><TabItem label={"401"} value={"401"}><div>
|
|
|
|
Unauthorized - Returned if the X-Plex-Token is missing from the header or query.
|
|
|
|
</div><div><MimeTabs className={"openapi-tabs__mime"} schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs className={"openapi-tabs__schema"}><TabItem label={"Schema"} value={"Schema"}><details style={{}} className={"openapi-markdown__details"} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={true} className={"schemaItem"}><details style={{}} className={"openapi-markdown__details"}><summary style={{}}><strong>errors</strong><span style={{"opacity":"0.6"}}> object[]</span></summary><div style={{"marginLeft":"1rem"}}><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem","paddingBottom":".5rem"}}>Array [</div></li><SchemaItem collapsible={false} name={"code"} required={false} schemaName={"number"} qualifierMessage={undefined} schema={{"type":"number","example":1001}}></SchemaItem><SchemaItem collapsible={false} name={"message"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string","example":"User could not be authenticated"}}></SchemaItem><SchemaItem collapsible={false} name={"status"} required={false} schemaName={"number"} qualifierMessage={undefined} schema={{"type":"number","example":401}}></SchemaItem><li><div style={{"fontSize":"var(--ifm-code-font-size)","opacity":"0.6","marginLeft":"-.5rem"}}>]</div></li></div></details></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"errors\": [\n {\n \"code\": 1001,\n \"message\": \"User could not be authenticated\",\n \"status\": 401\n }\n ]\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem></ApiTabs></div></div> |