Plex
Get Access Token by PinId
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
Plex
Get Access Token by PinId
Retrieve an Access Token from Plex.tv after the Pin has been authenticated
GET
/
pins
/
{pinID}
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\GetTokenByPinIdRequest(
pinID: 408895,
clientID: '3381b62b-9ab7-4e37-827b-203e9809eb58',
clientName: 'Plex for Roku',
deviceNickname: 'Roku 3',
clientVersion: '2.4.1',
platform: 'Roku',
);
$response = $sdk->plex->getTokenByPinId(
request: $request
);
if ($response->authPinContainer !== null) {
// handle response
}
{
"id": 308667304,
"code": "7RQZ",
"product": "0",
"trusted": false,
"qr": "https://plex.tv/api/v2/pins/qr/7RQZ",
"clientIdentifier": "string",
"location": {
"code": "VI",
"continent_code": "NA",
"country": "United States Virgin Islands",
"city": "Amsterdam",
"european_union_member": true,
"time_zone": "America/St_Thomas",
"postal_code": 802,
"in_privacy_restricted_country": true,
"in_privacy_restricted_region": true,
"subdivisions": "Saint Thomas",
"coordinates": "18.3381, -64.8941"
},
"expiresIn": 876,
"createdAt": "2024-07-16T17:03:05Z",
"expiresAt": "2024-07-16T17:18:05Z",
"authToken": null,
"newRegistration": null
}
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.
Path Parameters
The PinID to retrieve an access token for
Response
200
application/json
The Pin with a non-null authToken when it has been verified by the user
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\GetTokenByPinIdRequest(
pinID: 408895,
clientID: '3381b62b-9ab7-4e37-827b-203e9809eb58',
clientName: 'Plex for Roku',
deviceNickname: 'Roku 3',
clientVersion: '2.4.1',
platform: 'Roku',
);
$response = $sdk->plex->getTokenByPinId(
request: $request
);
if ($response->authPinContainer !== null) {
// handle response
}
{
"id": 308667304,
"code": "7RQZ",
"product": "0",
"trusted": false,
"qr": "https://plex.tv/api/v2/pins/qr/7RQZ",
"clientIdentifier": "string",
"location": {
"code": "VI",
"continent_code": "NA",
"country": "United States Virgin Islands",
"city": "Amsterdam",
"european_union_member": true,
"time_zone": "America/St_Thomas",
"postal_code": 802,
"in_privacy_restricted_country": true,
"in_privacy_restricted_region": true,
"subdivisions": "Saint Thomas",
"coordinates": "18.3381, -64.8941"
},
"expiresIn": 876,
"createdAt": "2024-07-16T17:03:05Z",
"expiresAt": "2024-07-16T17:18:05Z",
"authToken": null,
"newRegistration": null
}