# Plex ## Overview API Calls that perform operations directly against https://Plex.tv ### Available Operations * [getHomeData](#gethomedata) - Get Plex Home Data * [getPin](#getpin) - Get a Pin * [getToken](#gettoken) - Get Access Token ## getHomeData Retrieves the home data for the authenticated user, including details like home ID, name, guest access information, and subscription status. ### Example Usage ```php accessToken = ''; $sdk = Plex_API\PlexAPI::builder() ->setXPlexClientIdentifier('Postman') ->setSecurity($security)->build(); try { $response = $sdk->plex->getHomeData(); if ($response->twoHundredApplicationJsonObject !== null) { // handle response } } catch (Throwable $e) { // handle exception } ``` ### Response **[?\LukeHagar\Plex_API\Models\Operations\GetHomeDataResponse](../../Models/Operations/GetHomeDataResponse.md)** ## getPin Retrieve a Pin from Plex.tv for authentication flows ### Example Usage ```php setXPlexClientIdentifier('Postman') ->build(); try { $response = $sdk->plex->getPin('Postman', false, 'Postman'); if ($response->twoHundredAndOneApplicationJsonObject !== null) { // handle response } } catch (Throwable $e) { // handle exception } ``` ### Parameters | Parameter | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `xPlexProduct` | *string* | :heavy_check_mark: | Product name of the application shown in the list of devices
| Postman | | `strong` | *bool* | :heavy_minus_sign: | Determines the kind of code returned by the API call
Strong codes are used for Pin authentication flows
Non-Strong codes are used for `Plex.tv/link`
| | | `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| Postman | | `$serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | ### Response **[?\LukeHagar\Plex_API\Models\Operations\GetPinResponse](../../Models/Operations/GetPinResponse.md)** ## getToken Retrieve an Access Token from Plex.tv after the Pin has already been authenticated ### Example Usage ```php setXPlexClientIdentifier('Postman') ->build(); try { $response = $sdk->plex->getToken('', 'Postman'); if ($response->twoHundredApplicationJsonObject !== null) { // handle response } } catch (Throwable $e) { // handle exception } ``` ### Parameters | Parameter | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `pinID` | *string* | :heavy_check_mark: | The PinID to retrieve an access token for | | | `xPlexClientIdentifier` | *string* | :heavy_minus_sign: | The unique identifier for the client application
This is used to track the client application and its usage
(UUID, serial number, or other number unique per device)
| Postman | | `$serverURL` | *string* | :heavy_minus_sign: | An optional server URL to use. | http://localhost:8080 | ### Response **[?\LukeHagar\Plex_API\Models\Operations\GetTokenResponse](../../Models/Operations/GetTokenResponse.md)**