using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Requests;
var sdk = new PlexAPI();
GetTokenByPinIdRequest req = new GetTokenByPinIdRequest() {
PinID = 408895,
ClientID = "3381b62b-9ab7-4e37-827b-203e9809eb58",
ClientName = "Plex for Roku",
DeviceNickname = "Roku 3",
ClientVersion = "2.4.1",
Platform = "Roku",
};
var res = await sdk.Plex.GetTokenByPinIdAsync(req);
// 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
}
Retrieve an Access Token from Plex.tv after the Pin has been authenticated
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Requests;
var sdk = new PlexAPI();
GetTokenByPinIdRequest req = new GetTokenByPinIdRequest() {
PinID = 408895,
ClientID = "3381b62b-9ab7-4e37-827b-203e9809eb58",
ClientName = "Plex for Roku",
DeviceNickname = "Roku 3",
ClientVersion = "2.4.1",
Platform = "Roku",
};
var res = await sdk.Plex.GetTokenByPinIdAsync(req);
// 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
}
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.
The PinID to retrieve an access token for
The Pin with a non-null authToken when it has been verified by the user
The response is of type object
.