mirror of
https://github.com/LukeHagar/plexcsharp.git
synced 2025-12-06 04:20:46 +00:00
2.9 KiB
2.9 KiB
Sessions
(Sessions)
Overview
API Calls that perform search operations with Plex Media Server Sessions
Available Operations
- GetSessions - Get Active Sessions
- GetSessionHistory - Get Session History
- GetTranscodeSessions - Get Transcode Sessions
- StopTranscodeSession - Stop a Transcode Session
GetSessions
This will retrieve the "Now Playing" Information of the PMS.
Example Usage
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Sessions.GetSessionsAsync();
// handle response
Response
GetSessionHistory
This will Retrieve a listing of all history views.
Example Usage
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Sessions.GetSessionHistoryAsync();
// handle response
Response
GetTranscodeSessions
Get Transcode Sessions
Example Usage
using PlexAPI;
using PlexAPI.Models.Components;
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Sessions.GetTranscodeSessionsAsync();
// handle response
Response
StopTranscodeSession
Stop a Transcode Session
Example Usage
using PlexAPI;
using PlexAPI.Models.Components;
using PlexAPI.Models.Requests;
var sdk = new PlexAPISDK(security: new Models.Components.Security() {
AccessToken = "<YOUR_API_KEY_HERE>",
});
var res = await sdk.Sessions.StopTranscodeSessionAsync(sessionKey: "zz7llzqlx8w9vnrsbnwhbmep");
// handle response
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
SessionKey |
string | ✔️ | the Key of the transcode session to stop | zz7llzqlx8w9vnrsbnwhbmep |