Files
plexcsharp/docs/sdks/devices/README.md
speakeasybot c0836c3b34 ## Csharp SDK Changes:
* `PlexApi.LibraryPlaylists.AddPlaylistItems()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryPlaylists.ClearPlaylistItems()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryCollections.MoveCollectionItem()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryCollections.DeleteCollectionItem()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryCollections.AddCollectionItems()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Content.GetSonicallySimilar()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Butler.StopTask()`:  `request` **Changed** **Breaking** ⚠️
* `PlexApi.Butler.StartTask()`:  `request` **Changed** **Breaking** ⚠️
* `PlexApi.Content.GetSonicPath()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.DownloadQueue.GetItemDecision()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Hubs.GetAllHubs()`: 
  *  `request.OnlyTransient` **Changed**
  *  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Hubs.GetContinueWatching()`:  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Hubs.GetPromotedHubs()`:  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Hubs.GetMetadataHubs()`: 
  *  `request.OnlyTransient` **Changed**
  *  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Hubs.GetPostplayHubs()`: 
  *  `request.OnlyTransient` **Changed**
  *  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Hubs.GetRelatedHubs()`: 
  *  `request.OnlyTransient` **Changed**
  *  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Hubs.GetSectionHubs()`: 
  *  `request.OnlyTransient` **Changed**
  *  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Content.GetAllLeaves()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Content.ListContent()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Search.SearchHubs()`:  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Content.GetAlbums()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetLibraryItems()`: 
  *  `request.MediaQuery` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.IngestTransientItem()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetLibraryMatches()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Content.GetMetadataItem()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetSections()`:  `response.mediaContainer.Directory.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.AddSection()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.Directory.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetTags()`: 
  *  `request.Type` **Changed** **Breaking** ⚠️
* `PlexApi.Content.GetCollectionItems()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetAllItemLeaves()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Status.ListSessions()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.MovePlayQueueItem()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetExtras()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.DeletePlayQueueItem()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.Unshuffle()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.ListMatches()`: 
  *  `request.Manual` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.ListSonicallySimilar()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.Shuffle()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetRelatedItems()`:  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.ListSimilar()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.ResetPlayQueue()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetItemTree()`:  `response.mediaContainer.MetadataItem.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.ClearPlayQueue()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.AddToPlayQueue()`: 
  *  `request.Next` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetCommon()`: 
  *  `request.MediaQuery` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetPerson()`:  `response.mediaContainer.Directory.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.ListPersonMedia()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.GetPlayQueue()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetLibraryDetails()`: 
  *  `request.IncludeDetails` **Changed**
  *  `response.mediaContainer.Directory.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryPlaylists.MovePlaylistItem()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.Autocomplete()`: 
  *  `request.MediaQuery` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetCollections()`: 
  *  `request.MediaQuery` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryPlaylists.GetPlaylistGeneratorItems()`:  `response.mediaContainer.Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryPlaylists.DeletePlaylistItem()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Search.VoiceSearchHubs()`: 
  *  `request.Type` **Changed** **Breaking** ⚠️
  *  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryPlaylists.CreatePlaylist()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Playlist.GetPlaylistItems()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Playlist.GetPlaylist()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Playlist.ListPlaylists()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Collections.CreateCollection()`: 
  *  `request.Type` **Changed** **Breaking** ⚠️
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.DvRs.TuneChannel()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LiveTv.GetSessions()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LiveTv.GetLiveTvSession()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Transcoder.MakeDecision()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Subscriptions.GetAllSubscriptions()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.MediaSubscription.[].MediaGrabOperation.[].Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.Subscriptions.CreateSubscription()`:  `response.mediaContainer.MediaSubscription.[].MediaGrabOperation.[].Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.Subscriptions.GetScheduledRecordings()`:  `response.mediaContainer.MediaGrabOperation.[].Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.Subscriptions.GetTemplate()`:  `response.mediaContainer.SubscriptionTemplate.[].MediaSubscription.[].MediaGrabOperation.[].Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.Subscriptions.GetSubscription()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.MediaSubscription.[].MediaGrabOperation.[].Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.Subscriptions.EditSubscriptionPreferences()`:  `response.mediaContainer.MediaSubscription.[].MediaGrabOperation.[].Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.Subscriptions.ReorderSubscription()`:  `response.mediaContainer.MediaSubscription.[].MediaGrabOperation.[].Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.Library.AddSubtitles()`:  `request` **Changed**
* `PlexApi.LibraryPlaylists.UploadPlaylist()`: 
  *  `request.Force` **Changed**
* `PlexApi.Transcoder.TranscodeSubtitles()`:  `request` **Changed**
* `PlexApi.Transcoder.StartTranscodeSession()`:  `request` **Changed**
* `PlexApi.Library.GetMediaPart()`: 
  *  `request.Download` **Changed**
* `PlexApi.Library.DetectIntros()`: 
  *  `request.Force` **Changed**
* `PlexApi.Library.GetSectionImage()`: 
  *  `request.MediaQuery` **Changed**
* `PlexApi.Library.DeleteMediaItem()`: 
  *  `request.Proxy` **Changed**
* `PlexApi.Library.RefreshItemsMetadata()`: 
  *  `request.MarkUpdated` **Changed**
* `PlexApi.Authentication.Post-Users-Sign-In-Data()`: **Added**
* `PlexApi.Authentication.GetTokenDetails()`: **Added**
* `PlexApi.Library.DetectCredits()`:  `request` **Changed**
* `PlexApi.Library.SetStreamSelection()`: 
  *  `request.AllParts` **Changed**
* `PlexApi.Library.UpdateItems()`: 
  *  `request.Field.locked` **Changed**
* `PlexApi.PlayQueue.CreatePlayQueue()`:  `request` **Changed**
* `PlexApi.Library.DeleteLibrarySection()`: 
  *  `request.Async` **Changed**
* `PlexApi.Library.GetAugmentationStatus()`: 
  *  `request.Wait` **Changed**
* `PlexApi.Transcoder.TranscodeImage()`:  `request` **Changed**
* `PlexApi.Devices.ModifyDevice()`: 
  *  `request.Enabled` **Changed**
* `PlexApi.Library.DetectVoiceActivity()`:  `request` **Changed**
* `PlexApi.Library.GetStream()`: 
  *  `request.AutoAdjustSubtitle` **Changed**
* `PlexApi.Library.StartBifGeneration()`: 
  *  `request.Force` **Changed**
* `PlexApi.Library.GetFirstCharacters()`: 
  *  `request.MediaQuery` **Changed**
* `PlexApi.UltraBlur.GetImage()`: 
  *  `request.Noise` **Changed**
* `PlexApi.Library.GenerateThumbs()`: 
  *  `request.Force` **Changed**
* `PlexApi.Updater.ApplyUpdates()`:  `request` **Changed**
* `PlexApi.Updater.CheckUpdates()`: 
  *  `request.Download` **Changed**
* `PlexApi.Library.DeleteMetadataItem()`: 
  *  `request.Proxy` **Changed**
* `PlexApi.Library.OptimizeDatabase()`: 
  *  `request.Async` **Changed**
* `PlexApi.Library.RefreshSection()`: 
  *  `request.Force` **Changed**
* `PlexApi.Hubs.UpdateHubVisibility()`:  `request` **Changed**
* `PlexApi.Hubs.CreateCustomHub()`:  `request` **Changed**
* `PlexApi.DownloadQueue.AddDownloadQueueItems()`:  `request` **Changed**
* `PlexApi.Timeline.Report()`:  `request` **Changed**
* `PlexApi.General.GetSourceConnectionInformation()`: 
  *  `request.Refresh` **Changed**
* `PlexApi.Plex.Get-Server-Resources()`: **Added**
* `PlexApi.Users.Get-Users()`: **Added**
2025-12-01 00:32:52 +00:00

30 KiB

Devices

(Devices)

Overview

Media grabbers provide ways for media to be obtained for a given protocol. The simplest ones are stream and download. More complex grabbers can have associated devices

Network tuners can present themselves on the network using the Simple Service Discovery Protocol and Plex Media Server will discover them. The following XML is an example of the data returned from SSDP. The deviceType, serviceType, and serviceId values must remain as they are in the example in order for PMS to properly discover the device. Other less-obvious fields are described in the parameters section below.

Example SSDP output

<root xmlns="urn:schemas-upnp-org:device-1-0">
    <specVersion>
        <major>1</major>
        <minor>0</minor>
    </specVersion>
    <device>
        <deviceType>urn:plex-tv:device:Media:1</deviceType>
        <friendlyName>Turing Hopper 3000</friendlyName>
        <manufacturer>Plex, Inc.</manufacturer>
        <manufacturerURL>https://plex.tv/</manufacturerURL>
        <modelDescription>Turing Hopper 3000 Media Grabber</modelDescription>
        <modelName>Plex Media Grabber</modelName>
        <modelNumber>1</modelNumber>
        <modelURL>https://plex.tv</modelURL>
        <UDN>uuid:42fde8e4-93b6-41e5-8a63-12d848655811</UDN>
        <serviceList>
            <service>
                <URLBase>http://10.0.0.5:8088</URLBase>
                <serviceType>urn:plex-tv:service:MediaGrabber:1</serviceType>
                <serviceId>urn:plex-tv:serviceId:MediaGrabber</serviceId>
            </service>
        </serviceList>
    </device>
</root>
  • UDN: (string) A UUID for the device. This should be unique across models of a device at minimum.
  • URLBase: (string) The base HTTP URL for the device from which all of the other endpoints are hosted.

Available Operations

GetAvailableGrabbers

Get available grabbers visible to the server

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;

var sdk = new PlexAPI(
    accepts: LukeHagar.PlexAPI.SDK.Models.Components.Accepts.ApplicationXml,
    clientIdentifier: "abc123",
    product: "Plex for Roku",
    version: "2.4.1",
    platform: "Roku",
    platformVersion: "4.3 build 1057",
    device: "Roku 3",
    model: "4200X",
    deviceVendor: "Roku",
    deviceName: "Living Room TV",
    marketplace: "googlePlay",
    token: "<YOUR_API_KEY_HERE>"
);

GetAvailableGrabbersRequest req = new GetAvailableGrabbersRequest() {
    Protocol = "livetv",
};

var res = await sdk.Devices.GetAvailableGrabbersAsync(req);

// handle response

Parameters

Parameter Type Required Description
request GetAvailableGrabbersRequest ✔️ The request object to use for the request.

Response

GetAvailableGrabbersResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

ListDevices

Get the list of all devices present

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;

var sdk = new PlexAPI(token: "<YOUR_API_KEY_HERE>");

var res = await sdk.Devices.ListDevicesAsync();

// handle response

Response

ListDevicesResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

AddDevice

This endpoint adds a device to an existing grabber. The device is identified, and added to the correct grabber.

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;

var sdk = new PlexAPI(
    accepts: LukeHagar.PlexAPI.SDK.Models.Components.Accepts.ApplicationXml,
    clientIdentifier: "abc123",
    product: "Plex for Roku",
    version: "2.4.1",
    platform: "Roku",
    platformVersion: "4.3 build 1057",
    device: "Roku 3",
    model: "4200X",
    deviceVendor: "Roku",
    deviceName: "Living Room TV",
    marketplace: "googlePlay",
    token: "<YOUR_API_KEY_HERE>"
);

AddDeviceRequest req = new AddDeviceRequest() {
    Uri = "http://10.0.0.5",
};

var res = await sdk.Devices.AddDeviceAsync(req);

// handle response

Parameters

Parameter Type Required Description
request AddDeviceRequest ✔️ The request object to use for the request.

Response

AddDeviceResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

DiscoverDevices

Tell grabbers to discover devices

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;

var sdk = new PlexAPI(token: "<YOUR_API_KEY_HERE>");

var res = await sdk.Devices.DiscoverDevicesAsync();

// handle response

Response

DiscoverDevicesResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

RemoveDevice

Remove a devices by its id along with its channel mappings

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;

var sdk = new PlexAPI(
    accepts: LukeHagar.PlexAPI.SDK.Models.Components.Accepts.ApplicationXml,
    clientIdentifier: "abc123",
    product: "Plex for Roku",
    version: "2.4.1",
    platform: "Roku",
    platformVersion: "4.3 build 1057",
    device: "Roku 3",
    model: "4200X",
    deviceVendor: "Roku",
    deviceName: "Living Room TV",
    marketplace: "googlePlay",
    token: "<YOUR_API_KEY_HERE>"
);

RemoveDeviceRequest req = new RemoveDeviceRequest() {
    DeviceId = 685908,
};

var res = await sdk.Devices.RemoveDeviceAsync(req);

// handle response

Parameters

Parameter Type Required Description
request RemoveDeviceRequest ✔️ The request object to use for the request.

Response

RemoveDeviceResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

GetDeviceDetails

Get a device's details by its id

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;

var sdk = new PlexAPI(
    accepts: LukeHagar.PlexAPI.SDK.Models.Components.Accepts.ApplicationXml,
    clientIdentifier: "abc123",
    product: "Plex for Roku",
    version: "2.4.1",
    platform: "Roku",
    platformVersion: "4.3 build 1057",
    device: "Roku 3",
    model: "4200X",
    deviceVendor: "Roku",
    deviceName: "Living Room TV",
    marketplace: "googlePlay",
    token: "<YOUR_API_KEY_HERE>"
);

GetDeviceDetailsRequest req = new GetDeviceDetailsRequest() {
    DeviceId = 170949,
};

var res = await sdk.Devices.GetDeviceDetailsAsync(req);

// handle response

Parameters

Parameter Type Required Description
request GetDeviceDetailsRequest ✔️ The request object to use for the request.

Response

GetDeviceDetailsResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

ModifyDevice

Enable or disable a device by its id

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;

var sdk = new PlexAPI(
    accepts: LukeHagar.PlexAPI.SDK.Models.Components.Accepts.ApplicationXml,
    clientIdentifier: "abc123",
    product: "Plex for Roku",
    version: "2.4.1",
    platform: "Roku",
    platformVersion: "4.3 build 1057",
    device: "Roku 3",
    model: "4200X",
    deviceVendor: "Roku",
    deviceName: "Living Room TV",
    marketplace: "googlePlay",
    token: "<YOUR_API_KEY_HERE>"
);

ModifyDeviceRequest req = new ModifyDeviceRequest() {
    DeviceId = 879135,
    Enabled = BoolInt.True,
};

var res = await sdk.Devices.ModifyDeviceAsync(req);

// handle response

Parameters

Parameter Type Required Description
request ModifyDeviceRequest ✔️ The request object to use for the request.

Response

ModifyDeviceResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

SetChannelmap

Set a device's channel mapping

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;
using System.Collections.Generic;

var sdk = new PlexAPI(
    accepts: LukeHagar.PlexAPI.SDK.Models.Components.Accepts.ApplicationXml,
    clientIdentifier: "abc123",
    product: "Plex for Roku",
    version: "2.4.1",
    platform: "Roku",
    platformVersion: "4.3 build 1057",
    device: "Roku 3",
    model: "4200X",
    deviceVendor: "Roku",
    deviceName: "Living Room TV",
    marketplace: "googlePlay",
    token: "<YOUR_API_KEY_HERE>"
);

SetChannelmapRequest req = new SetChannelmapRequest() {
    DeviceId = 937661,
    ChannelMapping = new LukeHagar.PlexAPI.SDK.Models.Requests.ChannelMapping() {},
    ChannelMappingByKey = new ChannelMappingByKey() {},
    ChannelsEnabled = new List<string>() {
        "4",
        "6",
        ".",
        "1",
        ",",
        "4",
        "4",
        ".",
        "1",
        ",",
        "4",
        "5",
        ".",
        "1",
    },
};

var res = await sdk.Devices.SetChannelmapAsync(req);

// handle response

Parameters

Parameter Type Required Description
request SetChannelmapRequest ✔️ The request object to use for the request.

Response

SetChannelmapResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

GetDevicesChannels

Get a device's channels by its id

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;

var sdk = new PlexAPI(
    accepts: LukeHagar.PlexAPI.SDK.Models.Components.Accepts.ApplicationXml,
    clientIdentifier: "abc123",
    product: "Plex for Roku",
    version: "2.4.1",
    platform: "Roku",
    platformVersion: "4.3 build 1057",
    device: "Roku 3",
    model: "4200X",
    deviceVendor: "Roku",
    deviceName: "Living Room TV",
    marketplace: "googlePlay",
    token: "<YOUR_API_KEY_HERE>"
);

GetDevicesChannelsRequest req = new GetDevicesChannelsRequest() {
    DeviceId = 517209,
};

var res = await sdk.Devices.GetDevicesChannelsAsync(req);

// handle response

Parameters

Parameter Type Required Description
request GetDevicesChannelsRequest ✔️ The request object to use for the request.

Response

GetDevicesChannelsResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

SetDevicePreferences

Set device preferences by its id

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;

var sdk = new PlexAPI(
    accepts: LukeHagar.PlexAPI.SDK.Models.Components.Accepts.ApplicationXml,
    clientIdentifier: "abc123",
    product: "Plex for Roku",
    version: "2.4.1",
    platform: "Roku",
    platformVersion: "4.3 build 1057",
    device: "Roku 3",
    model: "4200X",
    deviceVendor: "Roku",
    deviceName: "Living Room TV",
    marketplace: "googlePlay",
    token: "<YOUR_API_KEY_HERE>"
);

SetDevicePreferencesRequest req = new SetDevicePreferencesRequest() {
    DeviceId = 420973,
};

var res = await sdk.Devices.SetDevicePreferencesAsync(req);

// handle response

Parameters

Parameter Type Required Description
request SetDevicePreferencesRequest ✔️ The request object to use for the request.

Response

SetDevicePreferencesResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

StopScan

Tell a device to stop scanning for channels

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;

var sdk = new PlexAPI(
    accepts: LukeHagar.PlexAPI.SDK.Models.Components.Accepts.ApplicationXml,
    clientIdentifier: "abc123",
    product: "Plex for Roku",
    version: "2.4.1",
    platform: "Roku",
    platformVersion: "4.3 build 1057",
    device: "Roku 3",
    model: "4200X",
    deviceVendor: "Roku",
    deviceName: "Living Room TV",
    marketplace: "googlePlay",
    token: "<YOUR_API_KEY_HERE>"
);

StopScanRequest req = new StopScanRequest() {
    DeviceId = 576494,
};

var res = await sdk.Devices.StopScanAsync(req);

// handle response

Parameters

Parameter Type Required Description
request StopScanRequest ✔️ The request object to use for the request.

Response

StopScanResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

Scan

Tell a device to scan for channels

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;

var sdk = new PlexAPI(
    accepts: LukeHagar.PlexAPI.SDK.Models.Components.Accepts.ApplicationXml,
    clientIdentifier: "abc123",
    product: "Plex for Roku",
    version: "2.4.1",
    platform: "Roku",
    platformVersion: "4.3 build 1057",
    device: "Roku 3",
    model: "4200X",
    deviceVendor: "Roku",
    deviceName: "Living Room TV",
    marketplace: "googlePlay",
    token: "<YOUR_API_KEY_HERE>"
);

ScanRequest req = new ScanRequest() {
    DeviceId = 57391,
    Source = "Cable",
};

var res = await sdk.Devices.ScanAsync(req);

// handle response

Parameters

Parameter Type Required Description
request ScanRequest ✔️ The request object to use for the request.

Response

ScanResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

GetThumb

Get a device's thumb for display to the user

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;

var sdk = new PlexAPI(
    accepts: LukeHagar.PlexAPI.SDK.Models.Components.Accepts.ApplicationXml,
    clientIdentifier: "abc123",
    product: "Plex for Roku",
    version: "2.4.1",
    platform: "Roku",
    platformVersion: "4.3 build 1057",
    device: "Roku 3",
    model: "4200X",
    deviceVendor: "Roku",
    deviceName: "Living Room TV",
    marketplace: "googlePlay",
    token: "<YOUR_API_KEY_HERE>"
);

GetThumbRequest req = new GetThumbRequest() {
    DeviceId = 960617,
    VersionPathParameter = 1025,
};

var res = await sdk.Devices.GetThumbAsync(req);

// handle response

Parameters

Parameter Type Required Description
request GetThumbRequest ✔️ The request object to use for the request.

Response

GetThumbResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*