Back to top

API Documentation

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://webkey.cc/_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://webkey.cc/_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://webkey.cc/_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://webkey.cc/_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://webkey.cc/_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://webkey.cc/_api/account
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "Message": "bye"
}

Update account information
PUT/account

Example URI

PUT https://webkey.cc/_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 account nick name and the name of the user
PUT/account/confirm

Example URI

PUT https://webkey.cc/_api/account/confirm
Request
HideShow
Headers
Content-Type: application/json
Body
{
    "nick": "mail@email.com"
    "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://webkey.cc/_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://webkey.cc/_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://webkey.cc/_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://webkey.cc/_api/account/pin
Response  200
HideShow
Headers
Content-Type: text/plain
Body
{
  "Pin": "BC12D"
}

Devices

Device Collection

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

List devices what associated to the account. Available fields: [DisplayName, Serial, PublicID, DeviceNick, DeviceBrand, DeviceModel, WebkeyVersion, Location, LastConnected, AndroidAPI, AndroidVersion, Rooted, Online, Build, GroupID] Default fields (if empty): [DisplayName, Serial, PublicID, DeviceNick, DeviceBrand, DeviceModel, WebkeyVersion, Location, LastConnected, AndroidAPI, AndroidVersion, Rooted, Online, Build] Groups array is empty if GroupIDs are not requested If search parameter is given, return devices which DisplayName, Serial, PublicID, DeviceNick, 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://webkey.cc/_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": [
    {
      "DeviceNick": "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"
      },
      "GroupID": 5
    }
  ],
  "TotalDevices": 5
}

Device

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

You can update device information with this action. It takes a JSON object containing device’s properties such deviceNick 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://webkey.cc/_api/devices?publicid=&serial=&devicenick=
URI Parameters
HideShow
publicid
String (optional) 

Uniq id of the device

serial
String (optional) 

Serial of the device

devicenick
String (optional) 

Nickname of the device

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "DeviceNick": "newnick"
}
Response  200
HideShow
Headers
Content-Type: text/plain
Location: /devices/newnick

Delete device
DELETE/devices{?publicid,serial,devicenick}

Example URI

DELETE https://webkey.cc/_api/devices?publicid=&serial=&devicenick=
URI Parameters
HideShow
publicid
String (optional) 

Uniq id of the device

serial
String (optional) 

Serial of the device

devicenick
String (optional) 

Nickname of the device

Response  200
HideShow
Headers
Content-Type: text/plain

Get device information

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

Example URI

GET https://webkey.cc/_api/devices/info?publicid=&serial=&devicenick=
URI Parameters
HideShow
publicid
String (optional) 

Uniq id of the device

serial
String (optional) 

Serial of the device

devicenick
String (optional) 

Nickname of the device

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "DeviceNick": "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"
  }
}

Request new remote admin token

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

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://webkey.cc/mgm?publicid=aaaaa-aaaa-bbbb-ccccc-ddddd&ratoken=eeeee-ffff-gggg-hhhh-iiiii

Example URI

GET https://webkey.cc/_api/devices/token?publicid=&serial=&devicenick=
URI Parameters
HideShow
publicid
String (optional) 

Uniq id of the device

serial
String (optional) 

Serial of the device

devicenick
String (optional) 

Nickname 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,devicenick}

Revoke the given remote admin token

Example URI

DELETE https://webkey.cc/_api/devices/token/token?publicid=&serial=&devicenick=
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

devicenick
String (optional) 

Nickname of the device

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

Device preview

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

Download a sample screenshot. This screenshot always shows the latest picture what goes trought the server.

Example URI

GET https://webkey.cc/_api/devices/preview?publicid=&serial=&devicenick=
URI Parameters
HideShow
publicid
String (optional) 

Uniq id of the device

serial
String (optional) 

Serial of the device

devicenick
String (optional) 

Nickname of the device

Response  200
HideShow
Headers
Content-Type: application/png

Get packages list

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

Get the installed packages and verison informations

Example URI

GET https://webkey.cc/_api/devices/packages?publicid=&serial=&devicenick=
URI Parameters
HideShow
publicid
String (optional) 

Uniq id of the device

serial
String (optional) 

Serial of the device

devicenick
String (optional) 

Nickname 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://webkey.cc/_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://webkey.cc/_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://webkey.cc/_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://webkey.cc/_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://webkey.cc/_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"
}

Tasks

Task creation

Create new task
POST/tasks

Create new task

Example URI

POST https://webkey.cc/_api/tasks
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33",
  "installPackage": {
    "source": "https://s3-eu-west-1.amazonaws.com/webkeytest/hello.apk"
  }
}
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "serial": "SH23TWOOP",
  "installPackage": {
    "source": "https://s3-eu-west-1.amazonaws.com/webkeytest/hello.apk"
  }
}
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "devicenick": "nickname",
  "deletePackage": {
    "packageName": "com.example.helloworld"
  }
}
Request
HideShow
Headers
Content-Type: application/json
Body
{
    "devices: [
        {
            "deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33"
        },
        {
            "serial": "SH23TWOOP"
        },
        {
            "devicenick": "nickname"
        }
    ],
    "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": "internal error"
}

Task operations

Get task report
GET/tasks/{taskId}

Example URI

GET https://webkey.cc/_api/tasks/taskId
URI Parameters
HideShow
taskId
string (required) 

Task ID in UUID format

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "",
  "taskid": "b684f565-1d27-41f9-80b6-dbb4fcb36639",
  "type": "packageinstall",
  "arguments": {
    "Source": "com.example.helloworld"
  },
  "reports": [
    {
      "deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33",
      "state": "committed"
    },
    {
      "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": "task not found"
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "internal error"
}

Delete exist task
DELETE/tasks/{taskId}

Example URI

DELETE https://webkey.cc/_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": "task not found"
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "Error": true,
  "Message": "internal error"
}

Generated by aglio on 15 Nov 2019