Back to top

Webkey Dashboard API

Webkey Dashboard REST API

Dashboard side API documentation of the Webkey system. If you’re looking for the Webkey Client integration (Android/Java), you can find it on our Github page. https://github.com/webkeydev

Manage API key

You can get and renew the API key. You can use this key for REST API authentication. Set it in to the request header as API-key=SECRET-KEY

Get current API key
GET/account/apikey

Return the current API key.

Example URI

GET https://api.webkeyapp.com/_api/account/apikey
Response  200
HideShow
Headers
Content-Type: text/plain
Body
{
  "apikey": "123e4567-e89b-12d3-a456-426655440000"
}

Renew the API key
PUT/account/apikey

Return a new API key and invalidate the old key.

Example URI

PUT https://api.webkeyapp.com/_api/account/apikey
Response  200
HideShow
Headers
Content-Type: text/plain
Body
{
  "apikey": "12dd07da-3401-11e8-b467-0ed5f89f718b"
}

Account managemenet

Account login

Account login
POST/account/login

This method logs in a user into the dashboard and opens a session for the logged-in user on success.

Example URI

POST https://api.webkeyapp.com/_api/account/login
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "nick": "john@mail.com",
  "pwd": "secretpassword"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{ 
    "Message":"login ok"
    "Confirmed": true
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reason of the error"
}

Account manipulation

Get account information
GET/account

Example URI

GET https://api.webkeyapp.com/_api/account
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "nick": "myaccount@mail.com",
  "fleetid": "123e4567-e89b-12d3-a456-426655440000",
  "firstname": "John",
  "lastname": "Wick"
}

Account registration
POST/account

Example URI

POST https://api.webkeyapp.com/_api/account
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "nick": "john.wick@mail.com",
  "pwd": "secretpassword"
}
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "nick": "john.wick@mail.com",
  "pwd": "secretpassword",
  "firstname": "John",
  "lastname": "Wick"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "Registration successful"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "reason of the error"
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "internal server error"
}

Account logout
DELETE/account

Destroys session.

Example URI

DELETE https://api.webkeyapp.com/_api/account
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "bye"
}

Update account information
PUT/account

Example URI

PUT https://api.webkeyapp.com/_api/account
Request
HideShow
Headers
Content-Type: application/json
Body
{ 
    "firstname": "John",
    "lastname": "Wick",
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "Updated"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "invalid name"
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "internal server error"
}

Account confirmation request

Update the name of the user and request confirmation
PUT/account/confirm

Example URI

PUT https://api.webkeyapp.com/_api/account/confirm
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "firstname": "John",
  "lastname": "Wick"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "Updated"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reason of the error"
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "internal server error"
}

Reset password

Reset password by password reset link
POST/account/pwd/reset

Set new password and invalidate the password reset link.

Example URI

POST https://api.webkeyapp.com/_api/account/pwd/reset
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "token": "a416dd1e-4174-11e7-a919-92ebcb67fe33",
  "pwd": "secretpassword"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "password has been updated"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reason of the error"
}

Change password

Set new password
POST/account/pwd/change

Set new password.

Example URI

POST https://api.webkeyapp.com/_api/account/pwd/change
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "current": "thecurrentpwd",
  "new": "newsecretpwd"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "password has been updated"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reasone of the error"
}

Manage pairing PIN code

The device owner can pair his device to the account with the pin code.

Get current pin
GET/account/pin

Return the current pin. This code will be renewed after timeout (default: 3 hours)

Example URI

GET https://api.webkeyapp.com/_api/account/pin
Response  200
HideShow
Headers
Content-Type: text/plain
Body
{
  "Pin": "A12BC"
}

Renew the PIN
PUT/account/pin

Return a new pin code and the previous will be invalidated.

Example URI

PUT https://api.webkeyapp.com/_api/account/pin
Response  200
HideShow
Headers
Content-Type: text/plain
Body
{
  "Pin": "BC12D"
}

Screen monitoring

Configure screen monitoring
PUT/account/screenmonitoring

Example URI

PUT https://api.webkeyapp.com/_api/account/screenmonitoring
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "enabled": true,
  "reqpermission": true
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "Updated"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reasone of the error"
}

Location tracking

Configure location tracking
PUT/account/locationtracking

Example URI

PUT https://api.webkeyapp.com/_api/account/locationtracking
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "enabled": true,
  "days": 31,
  "from": 57600,
  "duration": 28800,
  "saveFrequency": 10,
  "pushFrequency": 30
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "Updated"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reasone of the error"
}

Location tracking status

Enable/disable location tracking
PUT/account/locationtracking/status

Example URI

PUT https://api.webkeyapp.com/_api/account/locationtracking/status
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "enabled": true
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "Updated"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reasone of the error"
}

Devices

Device Collection

List all devices
GET/devices{?limit,offset,fields,search}

List devices what associated to the account. Available fields: [DisplayName, Serial, PublicID, Name, DeviceBrand, DeviceModel, WebkeyVersion, Location, LastConnected, AndroidAPI, AndroidVersion, Rooted, Online, Build, GroupID, Ip] Default fields (if empty): [DisplayName, Serial, PublicID, Name, DeviceBrand, DeviceModel, WebkeyVersion, Location, LastConnected, AndroidAPI, AndroidVersion, Rooted, Online, Build, PreviewHost, Ip] Groups array is empty if GroupIDs are not requested If search parameter is given, return devices which DisplayName, Serial, PublicID, Name, DeviceBrand, DeviceModel or device’s group name contains the parameter. Note: Search return all groups of user, if GroupID field is requested.

Example URI

GET https://api.webkeyapp.com/_api/devices?limit=&offset=&fields=&search=
URI Parameters
HideShow
limit
Number (required) 

Limit

offset
Number (required) 

Offset

fields
Array (optional) 

Requested fields

search
String (optional) 

Search pattern

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Groups": [
    {
      "id": 5,
      "name": "my device group"
    }
  ],
  "Devices": [
    {
      "Name": "mydevice",
      "DisplayName": "mydevice",
      "DeviceBrand": "motorola",
      "DeviceModel": "XT1032",
      "WebkeyVersion": "406",
      "Location": "47.4730165,47.4730165",
      "LastConnected": 1470051936,
      "AndroidAPI": 22,
      "AndroidVersion": "5.1",
      "Rooted": false,
      "Online": false,
      "PublicID": "a416dd1e-4174-11e7-a919-92ebcb67fe33",
      "Serial": "SH23TWOOP",
      "PreviewHost": "eu-1.webkeyapp.com",
      "Build": {
        "Type": "debug",
        "FlavorGlobal": "production",
        "FlavorVariant": "normal"
      },
      "GroupID": 5,
      "Ip": "90.116.212.98"
    }
  ],
  "TotalDevices": 5
}

Device

Update device settings
PUT/devices{?publicid,serial}

You can update device information with this action. It takes a JSON object containing device’s properties such ‘name’ to rename the device. The :public_id in the url means the edited device. After rename the url should be changed.

Example URI

PUT https://api.webkeyapp.com/_api/devices?publicid=&serial=
URI Parameters
HideShow
publicid
String (optional) 

Uniq id of the device

serial
String (optional) 

Serial of the device

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "Name": "new name"
}
Response  200
HideShow
Headers
Content-Type: text/plain
Body
{
  "Message": "updated"
}

Delete device
DELETE/devices{?publicid,serial}

Example URI

DELETE https://api.webkeyapp.com/_api/devices?publicid=&serial=
URI Parameters
HideShow
publicid
String (optional) 

Uniq id of the device

serial
String (optional) 

Serial of the device

Response  200
HideShow
Headers
Content-Type: text/plain

Get device information

Get device information
GET/devices/info{?publicid,serial}

Example URI

GET https://api.webkeyapp.com/_api/devices/info?publicid=&serial=
URI Parameters
HideShow
publicid
String (optional) 

Uniq id of the device

serial
String (optional) 

Serial of the device

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Name": "mydevice",
  "DisplayName": "mydevice",
  "DeviceBrand": "motorola",
  "DeviceModel": "XT1032",
  "WebkeyVersion": "406",
  "Location": "47.4730165,47.4730165",
  "LastConnected": 1470051936,
  "AndroidAPI": 22,
  "AndroidVersion": "5.1",
  "Rooted": false,
  "Online": false,
  "PublicID": "a416dd1e-4174-11e7-a919-92ebcb67fe33",
  "Serial": "SH23TWOOP",
  "Build": {
    "Type": "debug",
    "FlavorGlobal": "production",
    "FlavorVariant": "normal"
  },
  "Ip": "90.116.212.98"
}

Request new remote admin token

Get new RA token
GET/devices/token{?publicid,serial}

Request new remote admin token for the given device. You can use the remote admin token to login to the managed device. I.e: https://webkeyapp.com/mgm?publicid=aaaaa-aaaa-bbbb-ccccc-ddddd&ratoken=eeeee-ffff-gggg-hhhh-iiiii

Example URI

GET https://api.webkeyapp.com/_api/devices/token?publicid=&serial=
URI Parameters
HideShow
publicid
String (optional) 

Uniq id of the device

serial
String (optional) 

Serial of the device

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "token": "b352aa3a-4174-11e7-a919-92ebcb67fe33"
}

Revoke remote admin token

Revoke RA token
DELETE/devices/token/{token}{?publicid,serial}

Revoke the given remote admin token

Example URI

DELETE https://api.webkeyapp.com/_api/devices/token/token?publicid=&serial=
URI Parameters
HideShow
token
String (required) 

Uniq id of the token

publicid
String (optional) 

Uniq id of the device

serial
String (optional) 

Serial of the device

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "done"
}

Device preview

Get preview image url
GET/devices/preview{?publicid,serial}

Redirect to an URL where the latest sample screenshot can be downloaded or provide the image data. This screenshot always shows the latest picture what goes trought the server.

Example URI

GET https://api.webkeyapp.com/_api/devices/preview?publicid=&serial=
URI Parameters
HideShow
publicid
String (optional) 

Uniq id of the device

serial
String (optional) 

Serial of the device

Response  200
HideShow
Headers
Content-Type: image/jpeg
Response  301
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "preview not exists"
}

Get packages list

Get packages list
GET/devices/packages{?publicid,serial}

Get the installed packages and verison informations

Example URI

GET https://api.webkeyapp.com/_api/devices/packages?publicid=&serial=
URI Parameters
HideShow
publicid
String (optional) 

Uniq id of the device

serial
String (optional) 

Serial of the device

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "apps": [
    {
      "appName": "Webkey",
      "packageName": "com.webkey",
      "versionCode": 245,
      "versionName": "1.0"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "device not exist"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "facts not found"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "internal error"
}

Device invitation

Send device invitation
POST/devices/invite

Send device pairing invitation e-mail.

Example URI

POST https://api.webkeyapp.com/_api/devices/invite
Request
HideShow
Headers
Content-Type: application/json
Body
{ 
    "address": "alma@mail.com",
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "Email sent"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "internal error"
}

Device group

Create new device group
POST/devices/group

Create a new device group for the given devices

Example URI

POST https://api.webkeyapp.com/_api/devices/group
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "devicegroupname",
  "devices": [
    "a416dd1e-4174-11e7-a919-92ebcb67fe33"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "groupid": 1
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "bad request"
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "internal error"
}

Device group operations

Add devices to device group
POST/devices/group/{groupid}

Add devices to an existing device group If groupid is 0, devices will be removed from their groups

Example URI

POST https://api.webkeyapp.com/_api/devices/group/groupid
URI Parameters
HideShow
groupid
int (required) 

The ID of the device group

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "devices": [
    "a416dd1e-4174-11e7-a919-92ebcb67fe33"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "done"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "bad request"
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "internal error"
}

Rename device group
PUT/devices/group/{groupid}

Rename device group

Example URI

PUT https://api.webkeyapp.com/_api/devices/group/groupid
URI Parameters
HideShow
groupid
int (required) 

The ID of the device group

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "devicegroupname"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "done"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "bad request"
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "internal error"
}

Delete device group
DELETE/devices/group/{groupid}

Delete device group

Example URI

DELETE https://api.webkeyapp.com/_api/devices/group/groupid
URI Parameters
HideShow
groupid
int (required) 

The ID of the device group

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "done"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "bad request"
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "internal error"
}

Device Location

Get locations for a device between 2 dates
GET/devices/location{?publicid,serial,from,to}

Response is limited to 1000 data

Example URI

GET https://api.webkeyapp.com/_api/devices/location?publicid=&serial=&from=&to=
URI Parameters
HideShow
publicid
String (optional) 

Uniq id of the device

serial
String (optional) 

Serial of the device

from
int (required) 

Start date as timestamp in seconds

to
int (required) 

Stop date as timestamp in seconds

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    "Locations": [
        {
            "Longitude": 28.1590955,
            "Latitude": 49.2623185,
            "Timestamp": 1588074438
        },
        {
            "Longitude": 28.1591951,
            "Latitude": 49.2623614,
            "Timestamp": 1588074408
        },
        ...
    ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reason of the error"
}

Get last locations for devices/group

Get last locations for the devices/group given in the URL parameter
GET/devices/location/last{?publicid,groupid}

Only one of the parameters can be used at a time

Example URI

GET https://api.webkeyapp.com/_api/devices/location/last?publicid=&groupid=
URI Parameters
HideShow
publicid
Array (optional) 

Array of uniq id of the devices

groupid
Number (optional) 

Uniq id of a device group

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Locations": [
    {
      "PublicID": "a416dd1e-4174-11e7-a919-92ebcb67fe33",
      "Longitude": 28.1590955,
      "Latitude": 49.2623185,
      "Timestamp": 1588074438
    },
    {
      "PublicID": "a7505906-7f32-419b-bc0b-62a9179b21d4",
      "Longitude": null,
      "Latitude": null,
      "Timestamp": null
    },
    {
      "PublicID": "d4f6d789-a9d4-43f9-aaa7-b637b91cffe1",
      "Longitude": null,
      "Latitude": null,
      "Timestamp": null
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reasone of the error"
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "internal error"
}

Tasks

Task creation

With the tasks you can enforce settings and behavior for your devices.

Create new task
POST/tasks

Create new task. You can assign task to

  • list of devices

  • group

  • account

These list describe the precedence. With the account level assignment you cen define a default behavior of your all devices. But you can overwrite these rule with group or device level assignment. Task name is optional field.

Example URI

POST https://api.webkeyapp.com/_api/tasks
Request
HideShow
Headers
Content-Type: application/json
Body
{ 
    "assign": {
        "devices: [
            {
                "deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33"
            },
            {
                "serial": "SH23TWOOP"
            }
        ]
    },
    "task": {
        "name: "examplename",
        "kioskMode": {
            "enabled": true,
            "package": com.example.player
        }
    }
}
Request
HideShow
Headers
Content-Type: application/json
Body
{ 
    "assign": {
        "account": true
    },
    "task": {
        "name: "examplename",
        "kioskMode": {
            "enabled": true,
            "package": com.example.player
        }
    }
}
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "assign": {
    "group": 11074
  },
  "task": {
    "remoteLogging": {
      "enabled": true
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "taskid": "b684f565-1d27-41f9-80b6-dbb4fcb36639"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reason of the error"
}

Install package
POST/tasks

Example URI

POST https://api.webkeyapp.com/_api/tasks
Request
HideShow
Headers
Content-Type: application/json
Body
{
    "assign": {
        "devices: [
            {
                "deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33"
            }
        ]
    },
    "task": {
        "installPackage": {
            "source": "https://s3-eu-west-1.amazonaws.com/webkeytest/hello.apk"
        }
    }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "taskid": "b684f565-1d27-41f9-80b6-dbb4fcb36639"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reason of the error"
}

Remove package
POST/tasks

Example URI

POST https://api.webkeyapp.com/_api/tasks
Request
HideShow
Headers
Content-Type: application/json
Body
{
    "assign": {
        "devices: [
            {
                "deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33"
            }
        ]
    },
    "task": {
        "deletePackage": {
            "packageName": "com.example.helloworld"
        }
    }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "taskid": "b684f565-1d27-41f9-80b6-dbb4fcb36639"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reason of the error"
}

Screen monitoring
POST/tasks

Example URI

POST https://api.webkeyapp.com/_api/tasks
Request
HideShow
Headers
Content-Type: application/json
Body
{
    "assign": {
        "devices: [
            {
                "deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33"
            }
        ]
    },
    "task": {
         "screenMonitoring": {
            "enabled": true,
            "reqpermission": false
         }
    }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "taskid": "b684f565-1d27-41f9-80b6-dbb4fcb36639"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reason of the error"
}

Kiosk mode
POST/tasks

Example URI

POST https://api.webkeyapp.com/_api/tasks
Request
HideShow
Headers
Content-Type: application/json
Body
{
    "assign": {
        "devices: [
            {
                "deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33"
            }
        ]
    },
    "task": {
         "kioskMode": {
            "enabled": true,
            "package": com.example.player
         }
    }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "taskid": "b684f565-1d27-41f9-80b6-dbb4fcb36639"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reason of the error"
}

Task operations

Get task info
GET/tasks{?id,type}

Example URI

GET https://api.webkeyapp.com/_api/tasks?id=&type=
URI Parameters
HideShow
id
string (optional) 

Task ID in UUID format

type
string (optional) 

Task type

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    tasks: [
        {
            "taskid": "b684f565-1d27-41f9-80b6-dbb4fcb36639",
            "type": "packageinstall",
            "name: "examplename",
            "arguments": {
                "Source": "com.example.helloworld"
            },
            "assigned": {
                "devices": [
                    "a416dd1e-4174-11e7-a919-92ebcb67fe33",
                    "145ad820-f39f-4be1-9898-8dcf6c691b15",
                    "88a5fe06-350f-4e77-929a-58822a050ddd"
                ],
                "all": false
            }
        }
    ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    tasks: [
        {
            "taskid": "b684f565-1d27-41f9-80b6-dbb4fcb36639",
            "type": "packageinstall",
            "name: null,
            "arguments": {
                "Source": "com.example.helloworld"
            },
            "assigned": {
                "devices": null
                "all": true
            }
        }
    ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reason of the error"
}

Update existing task
PUT/tasks

Update existing task by ID, type cannot be changed

Example URI

PUT https://api.webkeyapp.com/_api/tasks
Request
HideShow
Headers
Content-Type: application/json
Body
{
    "name: "examplename",
    "installPackage": {
        "source": "https://s3-eu-west-1.amazonaws.com/webkeytest/hello.apk"
    }
}
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "screenMonitoring": {
    "enabled": true,
    "reqpermission": true
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "Updated"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reason of the error"
}

Task delete

Delete existing task
DELETE/tasks/{taskId}

Example URI

DELETE https://api.webkeyapp.com/_api/tasks/taskId
URI Parameters
HideShow
taskId
string (required) 

Task ID in UUID format

Response  200
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reason of the error"
}

Task report

Get task report
GET/tasks/report/{taskId}

Example URI

GET https://api.webkeyapp.com/_api/tasks/report/taskId
URI Parameters
HideShow
taskId
string (required) 

Task ID in UUID format

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    "taskid": "b684f565-1d27-41f9-80b6-dbb4fcb36639",
    "type": "packageinstall",
    "name: "examplename",
    "arguments": {
        "Source": "com.example.helloworld"
    },
    "reports": [
        {
            "deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe34",
            "state": "done"
        },
        {
            "deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe35",
            "state": "failed"
        }
    ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "reason of the error"
}

Remote methods

Remote method

Create and run new remote method on Android device. You can refer to your devices by “deviceid” (UUID), “serial”. If “waitforresult” is true, the request is await until device process the method, or timeout occurs. In the response message has infromation about the method results. Currently can be assigned to only one device at a time.

Create new remote method
POST/remotemethod

Create new screenshot (preview image)

Example URI

POST https://api.webkeyapp.com/_api/remotemethod
Request
HideShow
Headers
Content-Type: application/json
Body
{ 
    "assign": {
        "devices: [
            {
                "deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33"
            }
        ]
    },
    "method": {
        "name": "CREATE_SCREENSHOT",
        "arguments": {},
        "waitforresult": true
    }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "CREATE_SCREENSHOT",
  "id": "eeed4886-00a3-4771-9295-8bf29807b935",
  "reports": [
    {
      "deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33",
      "success": true,
      "exception": "Device is offline",
      "result": null
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "timeout"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "device (serial) not found by serial"
}

Send Intent
POST/remotemethod

An intent is an abstract description of an operation to be performed. Intent type can be used with “startActivity” to launch an Activity, “broadcast” to send it to any interested BroadcastReceiver components, and “startService”.

Example URI

POST https://api.webkeyapp.com/_api/remotemethod
Request
HideShow
Headers
Content-Type: application/json
Body
{ 
    "assign": {
        "devices: [
            {
                "deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33"
            }
        ]
    },
    "method": {
        "name": "SEND_INTENT",
        "arguments": {
            "name": "com.app.intent.action.EXAMPLE",
            "intExtras": {"com.app.intent.extra.alarm.INT": 7},
            "floatExtras": {"com.app.intent.extra.alarm.FLOAT": 3.7},
            "stringExtras": {"com.app.intent.extra.alarm.STRING": "hello world"},
            "categories": ["privateintent"],
            "type": "startActivity"
        },
        "waitforresult": true
    }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "SEND_INTENT",
  "id": "8357b99a-0bc6-42b5-a3cf-405bb747572f",
  "reports": [
    {
      "deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33",
      "success": true,
      "exception": null,
      "result": null
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "timeout"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "device (nickname) not found by nick"
}

Generated by aglio on 31 Jan 2024