Get a Single Device
This API command is used to get information about a single device that has been authorized to access the Plex server.
While a device can be removed from the authorized device list, the information about the device is still kept within the Plex database, and can be retrieved using this API command.
URL
GET http://{ip_address}:32400/devices/{id}?X-Plex-Token={plex_token}
Parameters
Name | Description |
---|---|
ip_address | The IP address of the Plex Media server. |
plex_token | The Plex token. |
id | The key associated with a device. This key can be found by calling the Devices API command and looking for the device. |
Return Status
HTTP Code | Description |
---|---|
200 | Success - The request was successful. |
401 | Unauthorized - The Plex token provided was not valid. |
Response
XML string value that lists the device that has accessed the Plex server. An example of the XML returned from the request is shown below:
<?xml version="1.0" encoding="UTF-8"?> <MediaContainer size="1" identifier="com.plexapp.system.devices"> <Device id="7" name="Plex Web (Firefox)" platform="" clientIdentifier="63tn6wik38f" createdAt="1456185758" /> </MediaContainer>
Remarks
The XML returned provides a list of the devices that have accessed the Plex server. The root is the MediaContainer
element. This element contains a few attributes that provide overall information about the devices that have accessed the server.
Attribute | Description |
---|---|
size | The number of devices returned by the command. |
identifier | The identifier for this type of item in Plex. |
Within the MediaContainer
is one Device
child elements the represents the device that has accessed the Plex server.
Attribute | Description |
---|---|
id | The unique integer value used to identify the device. |
name | The name of the device. |
platform | The platform of the device. |
clientIdentifier | The identifier for this type of device in Plex. |
createdAt | The date and time the device was created on the Plex server. This would represent the first time the device accessed the server. |
As mentioned earlier, the information about the device that has previously accessed the Plex server. If the device was removed from the server's authorized devices, information about the device can still be returned by this API command.
Examples
curl -X GET http://{ip_address}:32400/devices/{id}?X-Plex-Token={plex_token}
import requests plex_url = http://{ip_address}:32400/devices/{id}?X-Plex-Token={plex_token} response = requests.get(plex_url) print(response.text)
$response = Invoke-RestMethod 'http://{ip_address}:32400/devices/{id}?X-Plex-Token={plex_token}' -Method 'GET' Write-Output $response