Page tree
Skip to end of metadata
Go to start of metadata

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

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

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": "",
            "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",
            "isCleanupEnabled": true,
            "defaultDeviceLanguage": null,
            "defaultDeviceRegion": null,
            "iosConfigurationProfiles": ["Foobar"]
        }
    ],
    "code": "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

Response
Response Status: 200 OK
{
    "status": "SUCCESS",
    "data": {
        "id": "12345",
        "udid": "11111",
        "iosUdid": "",
        "deviceName": "Google Pixel",
        "notes": "",
        "deviceOs": "Android",
        "osVersion": "9",
        "model": "Pixel XL",
        "manufacturer": "Google",
        "currentUser": "None",
        "deviceCategory": "PHONE",
        "uptime": "0d 00:03",
        "isEmulator": false,
        "profiles": "no profiles",
        "agentName": "windowsagent",
        "agentIp": "192.168.0.0",
        "agentLocation": "2",
        "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",
        "isCleanupEnabled": true,
        "project": "11111,Project2",
        "iosConfigurationProfiles": ["Foobar"],
        "deviceGroups": {
            "1": "Default",
            "987654": "devgroup",
        }
    },
    "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)
Response
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
Response
Response Status: 200 OK
{
    "status": "SUCCESS",
    "data": [
        {
            "start": "2019-04-04T18:51:44.940+03:00",
            "end": "2019-04-04T19:36:44.940+03:00",
            "id": 2264433,
            "title": "keerthana@NO_HOST"
        }
    ],
    "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.

This API is available only for the cloud admin.

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

{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
StringNo

a reason for this reservation

Response
Response Status: 200 OK
{
    "status": "SUCCESS",
    "data": {
        "reservations": "Reservation added successfully"
    },
    "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.

This API is available only for the cloud admin.

POST /api/v1/devices/reservations/new


Parameters

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

a reason for this reservation

Response
Response Status: 200 OK
{
  "status": "SUCCESS",
  "data": {
    "reservations for id: 123": "{\"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

Response
Response Status: 200 OK
{
    "status": "SUCCESS",
    "code": "OK"
}


Reboot Device

Reboot the device.

This API is available only for cloud admin.

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

{id} - id of the device

Response
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

Response
Response Status: 200 OK
{
    "status": "SUCCESS",
    "code": "OK"
}


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 cloud admin.

GET /api/v1/devices/{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
Response
Response Status: 200 OK
{
    "deviceId": 12345,
    "regularLink": "/agent-25/#/ZqZPSfMvLHRtlXWF?1",
    "externalLink": "/agent-25/#/ZqZPSUMvKHRtlXWF?1"
}


Get device tags

Get tags that were added to device.

This API is available for all user roles.

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

{id} - id of the device

Response
Response Status: 200 OK
{
    "status": "SUCCESS",
    "data": [
        "stable",
        "new_device_2019",
        "expensive"
    ],
    "code": "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 for Cloud Administrators and Project Administrators.

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

{id} - id of the device

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

Response
Response Status: 200 OK
{"status":"SUCCESS","code":"OK"}

When tag contains invalid characters:

Response
Response Status: 400 BAD REQUEST
{"status":"ERROR","message":"Device tag can contain only digits, letters and underscores","code":"BAD_REQUEST"}

When device already contains 10 tags:

Response
Response Status: 400 BAD REQUEST
{"status":"ERROR","message":"Cannot add tag to device. Device has: 10 tags. Maximum allowed number of tags is: 10","code":"BAD_REQUEST"}


Remove device tag

This API is available for Cloud Administrators and Project Administrators.

DELETE /api/v1/devices/{id}/tags/{tag_value}

{id} - id of the device

{tag_value} - tag that should be deleted

Response
Response Status: 200 OK
{"status":"SUCCESS","code":"OK"}


Remove all device tags

This API is available for Cloud Administrators and Project Administrators.

DELETE /api/v1/devices/{id}/tags

{id} - id of the device

Response
Response Status: 200 OK
{"status":"SUCCESS","code":"OK"}


  • No labels