Get Devices List
Retrieves the list of devices, optionally matching the specified filter parameters. The list is automatically filtered to only include devices accessible by the user's roles.
URL |
Copy
|
Method |
|
Header parameters
Name |
Description |
---|---|
|
The Perfecto security token. For more information, see Generate a security token. |
Request parameters
Name |
Type |
Default |
Description |
---|---|---|---|
|
boolean |
false |
|
Request body
Name | Type | Description |
---|---|---|
|
string |
The identifier of the device specified as IMEI or ESN. |
|
string |
The manufacturer of the device. For example: Apple, Samsung, HTC, and so on |
|
string |
The model of the device. For example: Galaxy S6, iPhone 6, and so on |
|
string |
The distributor of the device. |
|
string |
The version of the firmware of the device. |
|
string |
The description of the device. |
|
string |
The geographical location of the device. |
|
string |
The current language of the device. |
|
string |
The current connectivity status of the device. The following is a list of the possible values:
|
|
string |
The identifier of the user account that is currently using the device. |
|
string |
The identifier of the user account that is currently reserving the device. |
|
string |
The identifier of the user account for which the device is currently available. |
|
string |
The owner's user id. Used by an administrator to list all devices accessible to this owner. Accessibility is determined by the user's roles. A user can access only devices that have one of the roles assigned to the user. |
|
boolean |
true indicates that the device is currently in use. |
|
string |
The identifier of the cradle to which the device is connected. |
|
string |
The name of the device's operating system. |
|
string |
The version of the device's operating system. |
|
string |
The resolution of the device screen. |
|
string |
The phone number of the device. |
|
string |
The type of device. The possible values are: all, local, or lab |
|
array |
The name and value of one or more dynamic fields for the device, in the following format: Copy
The following category values are allowed: DEVICE_TAGS, DYNAMIC_FIELDS, ADMIN_FIELDS For example, to specify an integer dynamic field called timeout with the value 10, specify: Copy
|
|
object |
The name of the operator network to which the device is connected, the country in which the operator is located, and the code that is associated with the operator, in the following format: Copy
Following are relevant examples. |
Request body
Following are several examples of the request body. It is mandatory to send all parameters inside the device object. An empty device object is allowed.
Fetch devices allocatedTo
users @myDomain.com
{
"device": {
"allocatedTo": ".*@myDomain.com"
}
}
Fetch devices on the basis of dynamic fields
{
"device": {
"customFields": [{
"name": "test_field_1",
"value": "test_value_1",
"category": "DYNAMIC_FIELDS"
}]
}
}
Fetch devices on the basis of country
{
"device": {
"operator": {
"country": "Afghanistan"
}
}
}
Success response
Code: 200 OK
false
{
"handsets": {
"timeStamp": 1677732737205,
"productVersion": "master",
"modelVersion": "2.21.0.0",
"handset": [
{
"osBuild": "<<OS_BUILD_VALUE>>",
"link": {
"type": "<<LINK_TYPE_VALUE>>"
},
"available": false|true,
"description": "<<DESCRIPTION>>",
"language": "<<LANGUAGE>>",
"imsi": "<<IMSI>>",
"deviceId": "<<DEVICE_ID>>",
"resolution": "<<RESOLUTION>>",
"operator": {
"country": "<<COUNTRY>>",
"code": "<<CODE>>",
"name": "<<NAME>>"
},
"manufacturer": "<<MANUFACTURER_VALUE>>",
"wifiMacAddress": "<<WIFI_MAC_ADDRESS_VALUE>>",
"mode": "<<MODE_VALUE>>",
"osVersion": "<<OS_VERSION>>",
"model": "<<MODEL_VALUE>>",
"firmware": "<<FIRMWARE_VALUE>>",
"os": "<<OS_VALUE>>",
"cpuArch": "<<CPU_ARCH_VALUE>>",
"originalDeviceId": "<<ORIGINAL_DEVICE_ID>>",
"phoneNumber": "<<PHONE_NUMBER>>",
"lastCradleId": "<<LAST_CRADLE_ID>>",
"reserved": false|true,
"location": "<<LOCATION_VALUE>>",
"distributer": "<<DISTRIBUTOR_VALUE>>",
"nativeImei": "<<NATIVE_IMEI_VALUE>>",
"status": "<<STATUS_VALUE>>"
}
],
"time": "2023-03-02:04-52-17 GMT",
"items": <<TOTAL_ITEM_COUNT>>
}
}
true
)
{
"handsets": {
"timeStamp": 1677734236775,
"productVersion": "master",
"modelVersion": "2.21.0.0",
"handset": [
{
"connectionProperties": {
"property": [
{
"name": "device-host",
"content": "<<VALUE>>"
},
{
"name": "device-host-type",
"content": "<<VALUE>>"
},
{
"name": "dns-name",
"content": "<<VALUE>>"
},
{
"name": "mac-host",
"content": "<<VALUE>>"
}
]
},
"osBuild": "",
"roles": {
"role": [
<<ROLES>>
]
},
"link": {
"type": "<<LINK_TYPE_VALUE>>"
},
"available": false|true,
"description": "<<DESCRIPTION>>",
"language": "<<LANGUAGE>>",
"imsi": "<<IMSI>>",
"assetTag": "<<ASSET_TAG_VALUE>>",
"deviceId": "<<DEVICE_ID>>",
"resolution": "<<RESOLUTION>>",
"operator": {
"country": "<<COUNTRY>>",
"code": <<CODE>>,
"name": "<<NAME>>",
"content": "<<CONTENT>>"
},
"manufacturer": "<<MANUFACTURER_VALUE>>",
"wifiMacAddress": "<<WIFI_MAC_ADDRESS_VALUE>>",
"mode": "<<MODEL_VALUE>>",
"osVersion": "<<OS_VERSION>>",
"model": "<<MODEL_VALUE>>",
"firmware": "<<FIRMWARE_VALUE>>",
"os": "<<OS_VALUE>>",
"cpuArch": "<<CPU_ARCH_VALUE>>",
"originalDeviceId": "<<ORIGINAL_DEVICE_ID>>",
"phoneNumber": "<<PHONE_NUMBER>>",
"lastCradleId": "<<LAST_CRADLE_ID>>",
"reserved": false|true,
"location": "<<LOCATION_VALUE>>",
"distributer": "<<DISTRIBUTOR_VALUE>>",
"nativeImei": "<<NATIVE_IMEI_VALUE>>",
"status": "<<STATUS_VALUE>>",
"deviceLocation": "<<DEVICE_LOCATION_VALUE>>"
}
],
"time": "2023-03-02:05-17-16 GMT",
"items": <<TOTAL_ITEM_COUNT>>
}
}
Error response
[
{
"userMessage":"ERROR_MESSAGE",
"developerMessage": "1-63dbebb1-4521fab52df9f41a578221c8"
}
]
where:
-
userMessage
is the error message to be shown. -
developerMessage
is a value that you can send to Perfecto Support to check errors if further investigation is required.
Sample error responses
A wrong securityToken is passed in the request (Unauthorized Request Code - 401)
[
{
"userMessage": "Unable to authenticate bearer token",
"developerMessage": "Unable to authenticate bearer token"
}
]
An invalid linkType is passed in the request (Bad Request Code - 400)
[
{
"userMessage": "Invalid link type 'abc'",
"developerMessage": "6abcdb41bbe648769d2ccb7d0a5a1627"
}
]
A device object is missing in the request (Bad Request Code - 400)
[
{
"userMessage": "Missing Device request object",
"developerMessage": "5419ee50fde14676a8304c588e77b389"
}
]