Authentication
Get User Sign In Data
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 User Sign In Data
Sign in user with username and password and return user data with Plex authentication token
POST
/
users
/
signin
declare(strict_types=1);
require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$sdk = Plex_API\PlexAPI::builder()->build();
$request = new Operations\PostUsersSignInDataRequest(
clientID: '3381b62b-9ab7-4e37-827b-203e9809eb58',
clientName: 'Plex for Roku',
deviceNickname: 'Roku 3',
clientVersion: '2.4.1',
platform: 'Roku',
requestBody: new Operations\PostUsersSignInDataRequestBody(
login: 'username@email.com',
password: 'password123',
verificationCode: '123456',
),
);
$response = $sdk->authentication->postUsersSignInData(
request: $request
);
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,
"pastSubscriptions": [
{
"id": "<string>",
"mode": "<string>",
"renewsAt": 1556281940,
"endsAt": 1556281940,
"canceled": false,
"gracePeriod": false,
"onHold": false,
"canReactivate": false,
"canUpgrade": false,
"canDowngrade": false,
"canConvert": false,
"type": "plexpass",
"transfer": "<string>",
"state": "ended",
"billing": {
"internalPaymentMethod": {},
"paymentMethodId": 123
}
}
],
"trials": [
{}
]
}
Headers
An opaque identifier unique to the client (UUID, serial number, or other unique device ID)
The name of the client application. (Plex Web, Plex Media Server, etc.)
A relatively friendly name for the client device
The version of the client application.
The platform of the client application.
Body
application/x-www-form-urlencoded
Login credentials
The body is of type object
.
Response
201
application/json
Returns the user account data with a valid auth token
The response is of type object
.
declare(strict_types=1);
require 'vendor/autoload.php';
use LukeHagar\Plex_API;
use LukeHagar\Plex_API\Models\Operations;
$sdk = Plex_API\PlexAPI::builder()->build();
$request = new Operations\PostUsersSignInDataRequest(
clientID: '3381b62b-9ab7-4e37-827b-203e9809eb58',
clientName: 'Plex for Roku',
deviceNickname: 'Roku 3',
clientVersion: '2.4.1',
platform: 'Roku',
requestBody: new Operations\PostUsersSignInDataRequestBody(
login: 'username@email.com',
password: 'password123',
verificationCode: '123456',
),
);
$response = $sdk->authentication->postUsersSignInData(
request: $request
);
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,
"pastSubscriptions": [
{
"id": "<string>",
"mode": "<string>",
"renewsAt": 1556281940,
"endsAt": 1556281940,
"canceled": false,
"gracePeriod": false,
"onHold": false,
"canReactivate": false,
"canUpgrade": false,
"canDowngrade": false,
"canConvert": false,
"type": "plexpass",
"transfer": "<string>",
"state": "ended",
"billing": {
"internalPaymentMethod": {},
"paymentMethodId": 123
}
}
],
"trials": [
{}
]
}