Authentication
Get Token Details
Server
Media
Butler
Plex
Library
- GETGet Hash Value
- GETGet Recently Added
- GETGet All Libraries
- GETGet library details
- DELDelete library section
- GETGet library items
- GETGet all media of library
- GETRefresh Metadata Of The Library
- GETSearch library
- GETGet Genres of library media
- GETGet Countries of library media
- GETGet Actors of library media
- GETSearch All Libraries
- GETGet Media Metadata
- GETGet Items Children
- GETGet Top Watched Content
- GETGet On Deck
Watchlist
Playlists
Authentication
Sessions
Authentication
Get Token Details
Get the User data from the provided X-Plex-Token
GET
/
user
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->authentication->getTokenDetails(
);
if ($response->userPlexAccount !== null) {
// handle response
}
{
"adsConsent": true,
"adsConsentReminderAt": 1556281940,
"adsConsentSetAt": 1556281940,
"anonymous": false,
"authToken": "CxoUzBTSV5hsxjTpFKaf",
"backupCodesCreated": false,
"confirmed": false,
"country": "US",
"email": "username@email.com",
"emailOnlyAuth": false,
"experimentalFeatures": false,
"friendlyName": "friendlyUsername",
"entitlements": [
"[]"
],
"guest": false,
"hasPassword": true,
"home": false,
"homeAdmin": false,
"homeSize": 1,
"id": 13692262,
"joinedAt": 1556281940,
"locale": "<string>",
"mailingListActive": false,
"mailingListStatus": "active",
"maxHomeSize": 15,
"pin": "<string>",
"profile": {
"autoSelectAudio": true,
"defaultAudioLanguage": "ja",
"defaultSubtitleLanguage": "en",
"autoSelectSubtitle": 1,
"defaultSubtitleAccessibility": 1,
"defaultSubtitleForced": 1,
"watchedIndicator": 1,
"mediaReviewsVisibility": 1
},
"protected": false,
"rememberExpiresAt": 1556281940,
"restricted": false,
"roles": [
"<string>"
],
"scrobbleTypes": "<string>",
"services": [
{
"identifier": "metadata-dev",
"endpoint": "https://epg.provider.plex.tv",
"token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv",
"secret": "<string>",
"status": "online"
}
],
"subscription": {
"features": [
"<string>"
],
"active": true,
"subscribedAt": "2021-04-12T18:21:12Z",
"status": "Inactive",
"paymentService": "<string>",
"plan": "<string>"
},
"subscriptionDescription": "<string>",
"subscriptions": [
{
"features": [
"<string>"
],
"active": true,
"subscribedAt": "2021-04-12T18:21:12Z",
"status": "Inactive",
"paymentService": "<string>",
"plan": "<string>"
}
],
"thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101",
"title": "UsernameTitle",
"twoFactorEnabled": false,
"username": "Username",
"uuid": "dae343c1f45beb4f",
"attributionPartner": null
}
Authorizations
Plex Authentication Token
Response
200
application/json
Logged in user details
The response is of type object
.
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->authentication->getTokenDetails(
);
if ($response->userPlexAccount !== null) {
// handle response
}
{
"adsConsent": true,
"adsConsentReminderAt": 1556281940,
"adsConsentSetAt": 1556281940,
"anonymous": false,
"authToken": "CxoUzBTSV5hsxjTpFKaf",
"backupCodesCreated": false,
"confirmed": false,
"country": "US",
"email": "username@email.com",
"emailOnlyAuth": false,
"experimentalFeatures": false,
"friendlyName": "friendlyUsername",
"entitlements": [
"[]"
],
"guest": false,
"hasPassword": true,
"home": false,
"homeAdmin": false,
"homeSize": 1,
"id": 13692262,
"joinedAt": 1556281940,
"locale": "<string>",
"mailingListActive": false,
"mailingListStatus": "active",
"maxHomeSize": 15,
"pin": "<string>",
"profile": {
"autoSelectAudio": true,
"defaultAudioLanguage": "ja",
"defaultSubtitleLanguage": "en",
"autoSelectSubtitle": 1,
"defaultSubtitleAccessibility": 1,
"defaultSubtitleForced": 1,
"watchedIndicator": 1,
"mediaReviewsVisibility": 1
},
"protected": false,
"rememberExpiresAt": 1556281940,
"restricted": false,
"roles": [
"<string>"
],
"scrobbleTypes": "<string>",
"services": [
{
"identifier": "metadata-dev",
"endpoint": "https://epg.provider.plex.tv",
"token": "DjoMtqFAGRL1uVtCyF1dKIorTbShJeqv",
"secret": "<string>",
"status": "online"
}
],
"subscription": {
"features": [
"<string>"
],
"active": true,
"subscribedAt": "2021-04-12T18:21:12Z",
"status": "Inactive",
"paymentService": "<string>",
"plan": "<string>"
},
"subscriptionDescription": "<string>",
"subscriptions": [
{
"features": [
"<string>"
],
"active": true,
"subscribedAt": "2021-04-12T18:21:12Z",
"status": "Inactive",
"paymentService": "<string>",
"plan": "<string>"
}
],
"thumb": "https://plex.tv/users/a4f43c1ebfde43a5/avatar?c=8372075101",
"title": "UsernameTitle",
"twoFactorEnabled": false,
"username": "Username",
"uuid": "dae343c1f45beb4f",
"attributionPartner": null
}