PlexPHP
declare(strict_types=1);
require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->butler->getButlerTasks(
);
if ($response->object !== null) {
// handle response
}require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new(
security: Models::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
),
)
res = s.butler.get_butler_tasks()
if ! res.object.nil?
# handle response
endpackage 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.Butler.GetTasks(ctx)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetTasksResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetTasksResponse res = sdk.butler().getTasks()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.butler.getTasks();
console.log(result);
}
run();curl --request GET \
--url https://{IP-description}.{identifier}.plex.direct:{port}/butler \
--header 'X-Plex-Token: <api-key>'import requests
url = "https://{IP-description}.{identifier}.plex.direct:{port}/butler"
headers = {"X-Plex-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Plex-Token': '<api-key>'}};
fetch('https://{IP-description}.{identifier}.plex.direct:{port}/butler', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ButlerTasks": {
"ButlerTask": [
{
"description": "<string>",
"enabled": true,
"interval": 123,
"name": "<string>",
"scheduleRandomized": true,
"title": "<string>"
}
]
}
}Butler
Get all Butler tasks
Get the list of butler tasks and their scheduling
GET
/
butler
PlexPHP
declare(strict_types=1);
require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->butler->getButlerTasks(
);
if ($response->object !== null) {
// handle response
}require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new(
security: Models::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
),
)
res = s.butler.get_butler_tasks()
if ! res.object.nil?
# handle response
endpackage 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.Butler.GetTasks(ctx)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.GetTasksResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
GetTasksResponse res = sdk.butler().getTasks()
.call();
if (res.object().isPresent()) {
// handle response
}
}
}import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await plexAPI.butler.getTasks();
console.log(result);
}
run();curl --request GET \
--url https://{IP-description}.{identifier}.plex.direct:{port}/butler \
--header 'X-Plex-Token: <api-key>'import requests
url = "https://{IP-description}.{identifier}.plex.direct:{port}/butler"
headers = {"X-Plex-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Plex-Token': '<api-key>'}};
fetch('https://{IP-description}.{identifier}.plex.direct:{port}/butler', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"ButlerTasks": {
"ButlerTask": [
{
"description": "<string>",
"enabled": true,
"interval": 123,
"name": "<string>",
"scheduleRandomized": true,
"title": "<string>"
}
]
}
}Authorizations
The token which identifies the user accessing the PMS. This can be either:
- A traditional access token obtained from plex.tv
- A JWT token obtained through the JWT authentication flow
JWT tokens provide better security with:
- Short-lived tokens (7 days expiration)
- Public-key cryptography (ED25519)
- Better clock synchronization
- Individual device revocation capability
Response
200 - application/json
Butler tasks
Show child attributes
Show child attributes
Was this page helpful?