Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 Experitest allows device management using Rest API. The following are the supported Rest API's for managing devices.

SEO Metadata
titleDevice's Rest API

 Experitest allows managing the devices using Rest API. Following are the supported Rest API's for managing devices.

Table of Contents

Info

The role of the user performing the Rest Operation is specified by the 'Authorization' header.

For more information please visit How To Execute Rest API, for a detailed example.

Get all Devices

Get the information of all the devices the user has access to.

GET /api/v1/devices

Code Block
languagexml
titleGet Devices Response
Response Status: 200 OK
{
    "status": "SUCCESS",
    "data": [
        {
            "id": "83",
            "udid": "1115fbd4746c2f05",
            "iosUdid": "",
            "deviceName": "Samsung S6 Edge",
            "notes": "",
            "deviceOs": "Android",
            "osVersion": "7.0",
            "model": "SM-G928C",
            "manufacturer": "samsung",
            "currentUser": "None",
            "deviceCategory": "PHONE",
            "uptime": "",
            "isEmulator": false,
            "profiles": "no profiles",
            "agentName": "",
            "agentIp": "",
            "agentLocation": "",
      		"region": "Europe - Master",
            "currentStatus": "offline",
            "statusTooltip": "",
            "lastUsedDateTime": "2017-04-21T13:03:44.403+03:00",
            "previousStatus": "offline",
            "statusAgeInMinutes": "868542",
            "statusModifiedAt": "1502176646041",
            "statusModifiedAtDateTime": "2017-08-08T10:17:26.041+03:00",
            "displayStatus": "Offline",
            "isCleanupEnabledwhitelistCleanup": true,
            "defaultDeviceLanguage": null,
            "defaultDeviceRegion": null,
        }    "iosConfigurationProfiles": ["Foobar"],
            "codescreenWidth": 720,
"OK"
}

Get Device

Gets the device information of the given id.

This API is available only for cloud admin.

GET /api/v1/devices/{id}

{id} - id of the device. DeviceId can be retrieved from the 'id' attribute of the /api/v1/devices API

Code Block
languagexml
titleGet Devices Response
Response Status: 200 OK
{
    "status": "SUCCESS",            "screenHeight": 1280
            "tags": [
                "stable",
                "datanew_device_2019":
{
        "id": "12345",         "udidexpensive":
"11111",         "iosUdid": "",  ],
      "deviceName": "Google Pixel",}
        "notes": "",
  ],
     "deviceOscode": "AndroidOK",
        "osVersion": "9",
        "model": "Pixel XL",
  
}


Get Device

Gets the device information of the given id.

This API is available only for cloud admin.

GET /api/v1/devices/{id}

{id} - id of the device. DeviceId can be retrieved from the 'id' attribute of the /api/v1/devices API

Code Block
languagexml
titleResponse
Response Status: 200 OK
{
     "manufacturerstatus": "GoogleSUCCESS",
   
    "currentUserdata": "None",{
        "deviceCategoryid": "PHONE12345",
        "uptimeudid": "0d 00:0311111",
        "isEmulatoriosUdid": false"",
        "profilesdeviceName": "noGoogle profilesPixel",
        "agentNamenotes": "windowsagent",
        "agentIpdeviceOs": "192.168.0.0Android",
        "agentLocationosVersion": "29",
        "currentStatusmodel": "onlinePixel XL",
        "statusTooltip": "",
     "manufacturer": "Google",
        "currentUser": "None",
        "deviceCategory": "PHONE",
        "uptime": "0d 00:03",
        "isEmulator": false,
        "profiles": "no profiles",
        "agentName": "windowsagent",
        "agentIp": "192.168.0.0",
        "agentLocation": "2",
		"region": "Europe - Master",
        "currentStatus": "online",
        "statusTooltip": "",
        "lastUsedDateTime": "2019-04-04T10:31:29.776+03:00",
        "previousStatus": "offline",
        "statusAgeInMinutes": "3",
        "statusModifiedAt": "1554364275730",
        "statusModifiedAtDateTime": "2019-04-04T10:51:15.730+03:00",
        "displayStatus": "Available",
        "whitelistCleanup": true,
        "screenWidth": 720,
        "screenHeight": 1280,
        "project": "11111,Project2",
        "tags": [
           "stable",
           "new_device_2019",
           "expensive"
        ],
        "iosConfigurationProfiles": ["Foobar"],
        "deviceGroups": {
            "1": "Default",
            "987654": "devgroup",
        },
		"lastActivity": "2019-04-04T19:36:44.940+03:00"
    },
    "code": "OK"
}


Edit Device

Edit the device's name, notes or category.

This API is available only for cloud admin.

POST /api/v1/devices/{id}

{id} - id of the device. DeviceId can be retrieved from the 'id' attribute of the /api/v1/devices API
Parameters

Name

Type

Mandatory

Description

name

StringNoNew name of the device
notes
StringNoNew notes of the device
category
StringNoNew category of the device (allowed categories: WATCH / TABLET / PHONE / UNKNOWN)
Code Block
languagexml
titleResponse
Response Status: 200 OK
{
    "status": "SUCCESS",
    "code": "OK"
}


Get Device Reservations

Get the device reservations of the specified device.

This API is available only for the cloud admin.

GET /api/v1/devices/{id}/reservations

{id} - id of the device

Parameters

Name

Type

Mandatory

Description

start
StringYes

YYYY-MM-DD-hh-mm-ss

as (2019-04-04-13-30-00)

end
StringYesYYYY-MM-DD-hh-mm-ss
current_timestampStringYesYYYY-MM-DD-hh-mm-ss
Code Block
languagexml
titleResponse
Response Status: 200 OK
{
    "lastUsedDateTimestatus": "2019-04-04T10:31:29.776+03:00SUCCESS",
        "previousStatusdata": "offline",[
        "statusAgeInMinutes": "3",
        "statusModifiedAt": "1554364275730",{
            "statusModifiedAtDateTimestart": "2019-04-04T1004T18:51:1544.730940+03:00",
        "displayStatus": "Available",         "isCleanupEnabledend": true,
        "project": "11111,Project2",
        "deviceGroups": {"2019-04-04T19:36:44.940+03:00",
             "1id": "Default"2264433,
            "987654title": "devgroupkeerthana@NO_HOST",
        }
    }],
    "code": "OK"
}


Edit Device

Edit the device's name, notes or category

Reserve Device

Reserves a device for the current user or the user with the userId if given.

If the reservation user has one project, the reservation project will be the user's project. Otherwise, the project id must be specified.

This API is available only for the cloud admin.

POST /api/v1/devices/{id}/reservations/new

{id} - id of the deviceDeviceId can be retrieved from the 'id' attribute of the /api/v1/devices API
Parameters

Name

Type

Mandatory

Description

name

StringNoNew name of the device
notes
StringNoNew notes of the device
category
StringNoNew category of the device (allowed categories: WATCH / TABLET / PHONE / UNKNOWN)

Parameters

Name

Type

Mandatory

Description

start
StringYesYYYY-MM-DD-hh-mm-ss
end
StringYesYYYY-MM-DD-hh-mm-ss
clientCurrentTimestamp
StringYesYYYY-MM-DD-hh-mm-ss
userId
StringNo

id of a user

projectId
StringNo

id of a project

notes
StringNo

a reason for this reservation

Response Status: 200 OK {
Code Block
languagexml
titleGet Devices Response
Response
Response Status: 200 OK
{
    "status": "SUCCESS",
    "data": {
        "statusreservations": "SUCCESS"Reservation added successfully"
    },
    "code": "OK"
}


Get Device Reservations

Get the device reservations of the specified device

Reserve Multiple Devices

Reserves multiple devices for the current user or the user with the userId if given.

If the reservation user has one project, the reservation project will be the user's project. Otherwise, the project id must be specified.

This API is available only for the cloud admin.

GET POST /api/v1/devices/{id}reservations/reservations

{id} - id of the device

new


Parameters

Description

Name

Type

Mandatory

Mandatory

Description

devicesListStringYeslist of id of the device (as "8,235,54")
start
StringYesYYYY-MM-DD-hh-mm-ss

as (2019-04-04-13-30-00)

end
StringYesYYYY-MM-DD-hh-mm-ss
current_timestampclientCurrentTimestamp
StringYesYYYY-MM-DD-hh-mm-ss-mm-ss
userId
StringNo

id of a user

projectId
StringNo

id of a project

notes
StringNo

a reason for this reservation

Code Block
languagexml
titleGet Devices Response
Response Status: 200 OK
{
 
  "status": "SUCCESS",
 
  "data": [{
    "reservations for id: 123": {
            "start": "2019-04-04T18:51:44.940+03:00",
            "end": "2019-04-04T19:36:44.940+03:00",
            "id": 2264433,
       "{\"status\":\"SUCCESS\",\"data\":{\"reservations\":\"Reservation added successfully\"},\"code\":\"OK\"}"
  },
  "code": "OK"
}


Release Device

Releases the device from its current user.

POST /api/v1/devices/{id}/release

{id} - id of the device

Code Block
languagexml
titleResponse
Response Status: 200 OK
{
    "titlestatus": "keerthana@NO_HOST"
        }
    ]SUCCESS",
    "code": "OK"
}

Reserve Device

Reserves a device for the current user or the user with the userId if given.

If the reservation user has one project, the reservation project will be the user's project. Otherwise, the project id must be specified.
OK"
}


Reboot Device

Reboot the device.

This API is available only for the cloud admin.

POST /api/v1/devices/{id}/reservations/newreboot

{id} - id of the device

Parameters

Name

Type

Mandatory

Description

start
StringYesYYYY-MM-DD-hh-mm-ss
end
StringYesYYYY-MM-DD-hh-mm-ss
clientCurrentTimestamp
StringYesYYYY-MM-DD-hh-mm-ss
userId
StringNo

id of a user

projectId
StringNo

id of a project

notes
StringNoa reason for this reservation

the device

Code Block
languagexml
titleResponse
Response Status: 200 OK
{
    "status": "SUCCESS",
    "code": "OK"
}


Reset USB Connection

Resets the USB Connection.

This API is available only for c.loud admin

POST /api/v1/devices/{id}/resetusb

{id} - id of the device

Code Block
languagexml
titleGet Devices Response
Response Status: 200 OK
{
    "status": "SUCCESS",
    "data": {
        "reservations": "Reservation added
successfully"     }"status": "SUCCESS",
    "code": "OK"
}


Reserve Multiple Devices

Reserves multiple devices for the current user or the user with the userId if given.

If the reservation user has one project, the reservation project will be the user's project. Otherwise, the project id must be specified.

Download App Container

(Only for iOS) - Download app container as a zip file, file name: '{bundle-id}.zip'

  • The device must be reserved by User
  • The app must be built for debugging

This API is available only for

the

cloud admin.

POST GET /api/v1/devices/reservations/new
Parameters
a reason for this reservation

Name

Type

Mandatory

Description

devicesListStringYeslist of id of the device (as "8,235,54")
start
StringYesYYYY-MM-DD-hh-mm-ss
end
StringYesYYYY-MM-DD-hh-mm-ss
clientCurrentTimestamp
StringYesYYYY-MM-DD-hh-mm-ss
userId
StringNo

id of a user

projectId
StringNo

id of a project

notes
StringNo/{id}/app-container/{bundle-id}

{id} - id of the device

{bundle-id} - bundle id of the application

Start web control

Start web access control of the device

When choosing 'Debug' option - Grid must run (from the same user who ran the API)

This API is available only for cloud admin.

PUT /api/v1/devices/{id}/web-control

{id} - id of the device

Parameters

Name

Type

Mandatory

Description

typeStringYes0-Manual, 1 - View, 2 - Automation, 3 - Debug
emulatorInstanceNameStringNoName for the emulator
Code Block
languagexml
titleGet Devices Response
Response Status: 200 OK
{
 
"status": "SUCCESS",   "datadeviceId": {12345,
    "reservations for id: 123": "{\"status\":\"SUCCESS\",\"data\":{\"reservations\":\"Reservation added successfully\"},\"code\"regularLink":\"OK\"}" "/agent-25/#/ZqZPSfMvLHRtlXWF?1",
  },   "codeexternalLink": "OK/agent-25/#/ZqZPSUMvKHRtlXWF?1"
}

Release Device

Releases the device from its current user.

POST 


Get device tags

Get tags that were added to device.

This API is available for all user roles.

GET /api/v1/devices/{id}/
release
tags

{id} - id of the device

Response Status: 200 OK {
Code Block
languagexml
titleGet Devices Response
Response
Response Status: 200 OK
{
    "status": "SUCCESS",
    "data": [
        "stable",
        "status": "SUCCESS"new_device_2019",
        "expensive"
    ],
    "code": "OK"
}

Reboot Device

Reboot the device.

: "OK"
}


Add device tag

Add tag to device.

Tag can contain only letters, digits, and underscore character.

Maximum number of tags allowed for each device: 10

Tags are not case sensitive

This API is available

only for cloud admin

for Cloud Administrators and Project Administrators.

POST 
PUT /api/v1/devices/{id}/
reboot
tags/{tag_value}

{id}

 - id of the device

 - id of the device

{tag_value} - tag value - can contain only letters, digits, and underscore character.

Code Block
languagexml
titleGet Devices Response
Response Status: 200 OK
{"status":"SUCCESS","code":"OK"}

When tag contains invalid characters:

Code Block
languagexml
titleResponse
Response Status: 400 BAD REQUEST
{"status": "SUCCESSERROR","message":"Device tag can contain only digits, letters and underscores","code": "OK"
}

Reset USB Connection

Resets the USB Connection.

This API is available only for c.loud admin

POST /api/v1/devices/{id}/resetusb{id} - id of the device
"BAD_REQUEST"}

When device already contains 10 tags:

Code Block
languagexml
titleGet Devices Response
Response Status: 200 OK
{
    "status": "SUCCESS",
     400 BAD REQUEST
{"status":"ERROR","message":"Cannot add tag to device. Device has: 10 tags. Maximum allowed number of tags is: 10","code": "OKBAD_REQUEST"
}

Download App Container

(Only for iOS) - Download app container as a zip file, file name: '{bundle-id}.zip'

  • The device must be reserved by User
  • The app must be built for debugging
    }
    


    Remove device tag

    This API is available

    only for cloud admin

    for Cloud Administrators and Project Administrators.

    GET 
    DELETE /api/v1/devices/{id}/
    app-container
    tags/{
    bundle-id
    tag_value}

    {id} - id of the device

    {tag_value} - tag that should be deleted

    Code Block
    languagexml

    {bundle-id} - bundle id of the application

    Start web control

    Start web access control of the device

    When choosing 'Debug' option - Grid must run (from the same user who ran the API)
    titleResponse
    Response Status: 200 OK
    {"status":"SUCCESS","code":"OK"}
    


    Remove all device tags

    This API is available

    only for cloud admin

    for Cloud Administrators and Project Administrators.

    PUT 
    DELETE /api/v1/devices/{id}/
    web-control
    tags

    {id} -

    id of the device

    Parameters

    Name

    Type

    Mandatory

    Description

    typeStringYes0-Manual, 1 - View, 2 - Automation, 3 - DebugemulatorInstanceNameStringNoName for the emulator

    id of the device

    Code Block
    languagexml
    titleGet Devices Response
    Response Status: 200 OK
    {
        "deviceIdstatus": 12345,
        "regularLink": "/agent-25/#/ZqZPSfMvLHRtlXWF?1",
        "externalLink": "/agent-25/#/ZqZPSUMvKHRtlXWF?1"
    }"SUCCESS","code":"OK"}