(Library)
API Calls interacting with Plex Media Server Libraries
- GetFileHash - Get Hash Value
- GetRecentlyAddedLibrary - Get Recently Added
- GetAllLibraries - Get All Libraries
- GetLibraryDetails - Get Library Details
- DeleteLibrary - Delete Library Section
- GetLibraryItems - Get Library Items
- GetAllMediaLibrary - Get all media of library
- GetRefreshLibraryMetadata - Refresh Metadata Of The Library
- GetSearchLibrary - Search Library
- GetGenresLibrary - Get Genres of library media
- GetCountriesLibrary - Get Countries of library media
- GetActorsLibrary - Get Actors of library media
- GetSearchAllLibraries - Search All Libraries
- GetMediaMetaData - Get Media Metadata
- GetMetadataChildren - Get Items Children
- GetTopWatchedContent - Get Top Watched Content
- GetOnDeck - Get On Deck
This resource returns hash values for local files
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetFileHash(ctx, "file://C:\Image.png&type=13", nil)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
url_ |
string | ✔️ | This is the path to the local file, must be prefixed by file:// |
file://C:\Image.png&type=13 |
type_ |
*float64 | ➖ | Item type | |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetFileHashResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetFileHashBadRequest | 400 | application/json |
sdkerrors.GetFileHashUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
This endpoint will return the recently added content.
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"github.com/LukeHagar/plexgo/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetRecentlyAddedLibrary(ctx, operations.GetRecentlyAddedLibraryRequest{
ContentDirectoryID: plexgo.Int64(2),
PinnedContentDirectoryID: []int64{
3,
5,
7,
13,
12,
1,
6,
14,
2,
10,
16,
17,
},
SectionID: plexgo.Int64(2),
Type: operations.QueryParamTypeTvShow,
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetRecentlyAddedLibraryRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetRecentlyAddedLibraryResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetRecentlyAddedLibraryBadRequest | 400 | application/json |
sdkerrors.GetRecentlyAddedLibraryUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
A library section (commonly referred to as just a library) is a collection of media. Libraries are typed, and depending on their type provide either a flat or a hierarchical view of the media. For example, a music library has an artist > albums > tracks structure, whereas a movie library is flat.
Libraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts. This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year).
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetAllLibraries(ctx)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetAllLibrariesResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetAllLibrariesBadRequest | 400 | application/json |
sdkerrors.GetAllLibrariesUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
This endpoint provides comprehensive details about the library, focusing on organizational aspects rather than the content itself.
The details include:
Organized into three categories:
-
Primary Directories:
- Used in some clients for quick access to media subsets (e.g., "All", "On Deck").
- Most can be replicated via media queries.
- Customizable by users.
-
Secondary Directories:
- Marked with
secondary="1"
. - Used in older clients for structured navigation.
- Marked with
-
Special Directories:
- Includes a "By Folder" entry for filesystem-based browsing.
- Contains an obsolete
search="1"
entry for on-the-fly search dialog creation.
Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls:
-
Type Object Attributes:
key
: Endpoint for the media list of this type.type
: Metadata type (if standard Plex type).title
: Title for this content type (e.g., "Movies").
-
Filter Objects:
- Subset of the media query language.
- Attributes include
filter
(name),filterType
(data type),key
(endpoint for value range), andtitle
.
-
Sort Objects:
- Description of sort fields.
- Attributes include
defaultDirection
(asc/desc),descKey
andkey
(sort parameters), andtitle
.
Note: Filters and sorts are optional; without them, no filtering controls are rendered.
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetLibraryDetails(ctx, 9518, nil)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
sectionKey |
int | ✔️ | The unique key of the Plex library. Note: This is unique in the context of the Plex server. |
9518 |
includeDetails |
*operations.IncludeDetails | ➖ | Whether or not to include details for a section (types, filters, and sorts). Only exists for backwards compatibility, media providers other than the server libraries have it on always. |
|
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetLibraryDetailsResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetLibraryDetailsBadRequest | 400 | application/json |
sdkerrors.GetLibraryDetailsUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Delete a library using a specific section id
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.DeleteLibrary(ctx, 9518)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
sectionKey |
int | ✔️ | The unique key of the Plex library. Note: This is unique in the context of the Plex server. |
9518 |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.DeleteLibraryResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.DeleteLibraryBadRequest | 400 | application/json |
sdkerrors.DeleteLibraryUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
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.unwatched
: Items that have not been played.newest
: Items that are recently released.recentlyAdded
: Items that are recently added to the library.recentlyViewed
: Items that were recently viewed.onDeck
: Items to continue watching.collection
: Items categorized by collection.edition
: Items categorized by edition.genre
: Items categorized by genre.year
: Items categorized by year of release.decade
: Items categorized by decade.director
: Items categorized by director.actor
: Items categorized by starring actor.country
: Items categorized by country of origin.contentRating
: Items categorized by content rating.rating
: Items categorized by rating.resolution
: Items categorized by resolution.firstCharacter
: Items categorized by the first letter.folder
: Items categorized by folder.albums
: Items categorized by album.
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"github.com/LukeHagar/plexgo/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetLibraryItems(ctx, operations.GetLibraryItemsRequest{
Tag: operations.TagEdition,
Type: operations.GetLibraryItemsQueryParamTypeTvShow,
SectionKey: 9518,
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetLibraryItemsRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetLibraryItemsResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetLibraryItemsBadRequest | 400 | application/json |
sdkerrors.GetLibraryItemsUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Retrieves a list of all general media data for this library.
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"github.com/LukeHagar/plexgo/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetAllMediaLibrary(ctx, operations.GetAllMediaLibraryRequest{
SectionKey: 9518,
Type: operations.GetAllMediaLibraryQueryParamTypeTvShow,
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetAllMediaLibraryRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetAllMediaLibraryResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetAllMediaLibraryBadRequest | 400 | application/json |
sdkerrors.GetAllMediaLibraryUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
This endpoint Refreshes all the Metadata of the library.
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"github.com/LukeHagar/plexgo/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetRefreshLibraryMetadata(ctx, 9518, operations.ForceOne.ToPointer())
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
sectionKey |
int | ✔️ | The unique key of the Plex library. Note: This is unique in the context of the Plex server. |
9518 |
force |
*operations.Force | ➖ | Force the refresh even if the library is already being refreshed. | 0 |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetRefreshLibraryMetadataResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetRefreshLibraryMetadataBadRequest | 400 | application/json |
sdkerrors.GetRefreshLibraryMetadataUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Search for content within a specific section of the library.
Each type in the library comes with a set of filters and sorts, aiding in building dynamic media controls:
-
Type Object Attributes:
type
: Metadata type (if standard Plex type).title
: Title for this content type (e.g., "Movies").
-
Filter Objects:
- Subset of the media query language.
- Attributes include
filter
(name),filterType
(data type),key
(endpoint for value range), andtitle
.
-
Sort Objects:
- Description of sort fields.
- Attributes include
defaultDirection
(asc/desc),descKey
andkey
(sort parameters), andtitle
.
Note: Filters and sorts are optional; without them, no filtering controls are rendered.
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"github.com/LukeHagar/plexgo/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetSearchLibrary(ctx, 9518, operations.GetSearchLibraryQueryParamTypeTvShow)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
sectionKey |
int | ✔️ | The unique key of the Plex library. Note: This is unique in the context of the Plex server. |
9518 |
type_ |
operations.GetSearchLibraryQueryParamType | ✔️ | The type of media to retrieve or filter by. 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 |
2 |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetSearchLibraryResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetSearchLibraryBadRequest | 400 | application/json |
sdkerrors.GetSearchLibraryUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Retrieves a list of all the genres that are found for the media in this library.
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"github.com/LukeHagar/plexgo/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetGenresLibrary(ctx, 9518, operations.GetGenresLibraryQueryParamTypeTvShow)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
sectionKey |
int | ✔️ | The unique key of the Plex library. Note: This is unique in the context of the Plex server. |
9518 |
type_ |
operations.GetGenresLibraryQueryParamType | ✔️ | The type of media to retrieve or filter by. 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 |
2 |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetGenresLibraryResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetGenresLibraryBadRequest | 400 | application/json |
sdkerrors.GetGenresLibraryUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Retrieves a list of all the countries that are found for the media in this library.
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"github.com/LukeHagar/plexgo/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetCountriesLibrary(ctx, 9518, operations.GetCountriesLibraryQueryParamTypeTvShow)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
sectionKey |
int | ✔️ | The unique key of the Plex library. Note: This is unique in the context of the Plex server. |
9518 |
type_ |
operations.GetCountriesLibraryQueryParamType | ✔️ | The type of media to retrieve or filter by. 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 |
2 |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetCountriesLibraryResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetCountriesLibraryBadRequest | 400 | application/json |
sdkerrors.GetCountriesLibraryUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Retrieves a list of all the actors that are found for the media in this library.
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"github.com/LukeHagar/plexgo/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetActorsLibrary(ctx, 9518, operations.GetActorsLibraryQueryParamTypeTvShow)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
sectionKey |
int | ✔️ | The unique key of the Plex library. Note: This is unique in the context of the Plex server. |
9518 |
type_ |
operations.GetActorsLibraryQueryParamType | ✔️ | The type of media to retrieve or filter by. 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 |
2 |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetActorsLibraryResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetActorsLibraryBadRequest | 400 | application/json |
sdkerrors.GetActorsLibraryUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
Search the provided query across all library sections, or a single section, and return matches as hubs, split up by type.
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"github.com/LukeHagar/plexgo/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetSearchAllLibraries(ctx, operations.GetSearchAllLibrariesRequest{
Query: "<value>",
ClientID: "3381b62b-9ab7-4e37-827b-203e9809eb58",
SearchTypes: []operations.SearchTypes{
operations.SearchTypesPeople,
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetSearchAllLibrariesRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetSearchAllLibrariesResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetSearchAllLibrariesBadRequest | 400 | application/json |
sdkerrors.GetSearchAllLibrariesUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
This endpoint will return all the (meta)data of a library item specified with by the ratingKey.
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"github.com/LukeHagar/plexgo/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetMediaMetaData(ctx, operations.GetMediaMetaDataRequest{
RatingKey: 9518,
IncludeConcerts: plexgo.Bool(true),
IncludeExtras: plexgo.Bool(true),
IncludeOnDeck: plexgo.Bool(true),
IncludePopularLeaves: plexgo.Bool(true),
IncludePreferences: plexgo.Bool(true),
IncludeReviews: plexgo.Bool(true),
IncludeChapters: plexgo.Bool(true),
IncludeStations: plexgo.Bool(true),
IncludeExternalMedia: plexgo.Bool(true),
AsyncAugmentMetadata: plexgo.Bool(true),
AsyncCheckFiles: plexgo.Bool(true),
AsyncRefreshAnalysis: plexgo.Bool(true),
AsyncRefreshLocalMediaAgent: plexgo.Bool(true),
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.GetMediaMetaDataRequest | ✔️ | The request object to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetMediaMetaDataResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetMediaMetaDataBadRequest | 400 | application/json |
sdkerrors.GetMediaMetaDataUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
This endpoint will return the children of of a library item specified with the ratingKey.
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetMetadataChildren(ctx, 1539.14, plexgo.String("Stream"))
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
ratingKey |
float64 | ✔️ | the id of the library item to return the children of. |
includeElements |
*string | ➖ | Adds additional elements to the response. Supported types are (Stream) |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetMetadataChildrenResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetMetadataChildrenBadRequest | 400 | application/json |
sdkerrors.GetMetadataChildrenUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
This endpoint will return the top watched content from libraries of a certain type
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"github.com/LukeHagar/plexgo/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetTopWatchedContent(ctx, operations.GetTopWatchedContentQueryParamTypeTvShow, plexgo.Int64(1))
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
type_ |
operations.GetTopWatchedContentQueryParamType | ✔️ | The type of media to retrieve or filter by. 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 |
2 |
includeGuids |
*int64 | ➖ | Adds the Guids object to the response |
1 |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetTopWatchedContentResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetTopWatchedContentBadRequest | 400 | application/json |
sdkerrors.GetTopWatchedContentUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |
This endpoint will return the on deck content.
package main
import(
"context"
"github.com/LukeHagar/plexgo"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Library.GetOnDeck(ctx)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
opts |
[]operations.Option | ➖ | The options for this request. |
*operations.GetOnDeckResponse, error
Error Type | Status Code | Content Type |
---|---|---|
sdkerrors.GetOnDeckBadRequest | 400 | application/json |
sdkerrors.GetOnDeckUnauthorized | 401 | application/json |
sdkerrors.SDKError | 4XX, 5XX | */* |