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 keyGET/account/apikey
Return the current API key.
Example URI
200
Headers
Content-Type: text/plain
Body
{
"apikey": "123e4567-e89b-12d3-a456-426655440000"
}
Renew the API keyPUT/account/apikey
Return a new API key and invalidate the old key.
Example URI
200
Headers
Content-Type: text/plain
Body
{
"apikey": "12dd07da-3401-11e8-b467-0ed5f89f718b"
}
Account managemenet ¶
Account login ¶
Account loginPOST/account/login
This method logs in a user into the dashboard and opens a session for the logged-in user on success.
Example URI
Headers
Content-Type: application/json
Body
{
"nick": "john@mail.com",
"pwd": "secretpassword"
}
200
Headers
Content-Type: application/json
Body
{
"Message":"login ok"
"Confirmed": true
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reason of the error"
}
Account manipulation ¶
Get account informationGET/account
Example URI
200
Headers
Content-Type: application/json
Body
{
"nick": "myaccount@mail.com",
"fleetid": "123e4567-e89b-12d3-a456-426655440000",
"firstname": "John",
"lastname": "Wick"
}
Account registrationPOST/account
Example URI
Headers
Content-Type: application/json
Body
{
"nick": "john.wick@mail.com",
"pwd": "secretpassword"
}
Headers
Content-Type: application/json
Body
{
"nick": "john.wick@mail.com",
"pwd": "secretpassword",
"firstname": "John",
"lastname": "Wick"
}
200
Headers
Content-Type: application/json
Body
{
"Message": "Registration successful"
}
400
Headers
Content-Type: application/json
Body
{
"Message": "reason of the error"
}
500
Headers
Content-Type: application/json
Body
{
"Message": "internal server error"
}
Account logoutDELETE/account
Destroys session.
Example URI
200
Headers
Content-Type: application/json
Body
{
"Message": "bye"
}
Update account informationPUT/account
Example URI
Headers
Content-Type: application/json
Body
{
"firstname": "John",
"lastname": "Wick",
}
200
Headers
Content-Type: application/json
Body
{
"Message": "Updated"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "invalid name"
}
500
Headers
Content-Type: application/json
Body
{
"Message": "internal server error"
}
Account confirmation request ¶
Update the name of the user and request confirmationPUT/account/confirm
Example URI
Headers
Content-Type: application/json
Body
{
"firstname": "John",
"lastname": "Wick"
}
200
Headers
Content-Type: application/json
Body
{
"Message": "Updated"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reason of the error"
}
500
Headers
Content-Type: application/json
Body
{
"Message": "internal server error"
}
Request password reset link ¶
Forgot passwordPOST/account/pwd/forgot
Send password reset link in e-mail.
Example URI
Headers
Content-Type: application/json
Body
{
"address": "john@email.com",
}
200
Headers
Content-Type: application/json
Body
{
"Message": "Email sent"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reason of the error"
}
Reset password ¶
Reset password by password reset linkPOST/account/pwd/reset
Set new password and invalidate the password reset link.
Example URI
Headers
Content-Type: application/json
Body
{
"token": "a416dd1e-4174-11e7-a919-92ebcb67fe33",
"pwd": "secretpassword"
}
200
Headers
Content-Type: application/json
Body
{
"Message": "password has been updated"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reason of the error"
}
Change password ¶
Set new passwordPOST/account/pwd/change
Set new password.
Example URI
Headers
Content-Type: application/json
Body
{
"current": "thecurrentpwd",
"new": "newsecretpwd"
}
200
Headers
Content-Type: application/json
Body
{
"Message": "password has been updated"
}
400
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 pinGET/account/pin
Return the current pin. This code will be renewed after timeout (default: 3 hours)
Example URI
200
Headers
Content-Type: text/plain
Body
{
"Pin": "A12BC"
}
Renew the PINPUT/account/pin
Return a new pin code and the previous will be invalidated.
Example URI
200
Headers
Content-Type: text/plain
Body
{
"Pin": "BC12D"
}
Screen monitoring ¶
Configure screen monitoringPUT/account/screenmonitoring
Example URI
Headers
Content-Type: application/json
Body
{
"enabled": true,
"reqpermission": true
}
200
Headers
Content-Type: application/json
Body
{
"Message": "Updated"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reasone of the error"
}
Location tracking ¶
Configure location trackingPUT/account/locationtracking
Example URI
Headers
Content-Type: application/json
Body
{
"enabled": true,
"days": 31,
"from": 57600,
"duration": 28800,
"saveFrequency": 10,
"pushFrequency": 30
}
200
Headers
Content-Type: application/json
Body
{
"Message": "Updated"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reasone of the error"
}
Location tracking status ¶
Enable/disable location trackingPUT/account/locationtracking/status
Example URI
Headers
Content-Type: application/json
Body
{
"enabled": true
}
200
Headers
Content-Type: application/json
Body
{
"Message": "Updated"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reasone of the error"
}
Devices ¶
Device Collection ¶
List all devicesGET/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
- limit
Number
(required)Limit
- offset
Number
(required)Offset
- fields
Array
(optional)Requested fields
- search
String
(optional)Search pattern
200
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 settingsPUT/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
- publicid
String
(optional)Uniq id of the device
- serial
String
(optional)Serial of the device
Headers
Content-Type: application/json
Body
{
"Name": "new name"
}
200
Headers
Content-Type: text/plain
Body
{
"Message": "updated"
}
Delete deviceDELETE/devices{?publicid,serial}
Example URI
- publicid
String
(optional)Uniq id of the device
- serial
String
(optional)Serial of the device
200
Headers
Content-Type: text/plain
Get device information ¶
Get device informationGET/devices/info{?publicid,serial}
Example URI
- publicid
String
(optional)Uniq id of the device
- serial
String
(optional)Serial of the device
200
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 tokenGET/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
- publicid
String
(optional)Uniq id of the device
- serial
String
(optional)Serial of the device
200
Headers
Content-Type: application/json
Body
{
"token": "b352aa3a-4174-11e7-a919-92ebcb67fe33"
}
Revoke remote admin token ¶
Revoke RA tokenDELETE/devices/token/{token}{?publicid,serial}
Revoke the given remote admin token
Example URI
- token
String
(required)Uniq id of the token
- publicid
String
(optional)Uniq id of the device
- serial
String
(optional)Serial of the device
200
Headers
Content-Type: application/json
Body
{
"Message": "done"
}
Device preview ¶
Get preview image urlGET/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
- publicid
String
(optional)Uniq id of the device
- serial
String
(optional)Serial of the device
200
Headers
Content-Type: image/jpeg
301
Headers
Content-Type: application/json
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "preview not exists"
}
Get packages list ¶
Get packages listGET/devices/packages{?publicid,serial}
Get the installed packages and verison informations
Example URI
- publicid
String
(optional)Uniq id of the device
- serial
String
(optional)Serial of the device
200
Headers
Content-Type: application/json
Body
{
"apps": [
{
"appName": "Webkey",
"packageName": "com.webkey",
"versionCode": 245,
"versionName": "1.0"
}
]
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "device not exist"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "facts not found"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "internal error"
}
Device invitation ¶
Send device invitationPOST/devices/invite
Send device pairing invitation e-mail.
Example URI
Headers
Content-Type: application/json
Body
{
"address": "alma@mail.com",
}
200
Headers
Content-Type: application/json
Body
{
"Message": "Email sent"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "internal error"
}
Device group ¶
Create new device groupPOST/devices/group
Create a new device group for the given devices
Example URI
Headers
Content-Type: application/json
Body
{
"name": "devicegroupname",
"devices": [
"a416dd1e-4174-11e7-a919-92ebcb67fe33"
]
}
200
Headers
Content-Type: application/json
Body
{
"groupid": 1
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "bad request"
}
500
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "internal error"
}
Device group operations ¶
Add devices to device groupPOST/devices/group/{groupid}
Add devices to an existing device group If groupid is 0, devices will be removed from their groups
Example URI
- groupid
int
(required)The ID of the device group
Headers
Content-Type: application/json
Body
{
"devices": [
"a416dd1e-4174-11e7-a919-92ebcb67fe33"
]
}
200
Headers
Content-Type: application/json
Body
{
"Message": "done"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "bad request"
}
500
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "internal error"
}
Rename device groupPUT/devices/group/{groupid}
Rename device group
Example URI
- groupid
int
(required)The ID of the device group
Headers
Content-Type: application/json
Body
{
"name": "devicegroupname"
}
200
Headers
Content-Type: application/json
Body
{
"Message": "done"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "bad request"
}
500
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "internal error"
}
Delete device groupDELETE/devices/group/{groupid}
Delete device group
Example URI
- groupid
int
(required)The ID of the device group
200
Headers
Content-Type: application/json
Body
{
"Message": "done"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "bad request"
}
500
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "internal error"
}
Device Location ¶
Get locations for a device between 2 datesGET/devices/location{?publicid,serial,from,to}
Response is limited to 1000 data
Example URI
- 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
200
Headers
Content-Type: application/json
Body
{
"Locations": [
{
"Longitude": 28.1590955,
"Latitude": 49.2623185,
"Timestamp": 1588074438
},
{
"Longitude": 28.1591951,
"Latitude": 49.2623614,
"Timestamp": 1588074408
},
...
]
}
400
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 parameterGET/devices/location/last{?publicid,groupid}
Only one of the parameters can be used at a time
Example URI
- publicid
Array
(optional)Array of uniq id of the devices
- groupid
Number
(optional)Uniq id of a device group
200
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
}
]
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reasone of the error"
}
500
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 taskPOST/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
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
}
}
}
Headers
Content-Type: application/json
Body
{
"assign": {
"account": true
},
"task": {
"name: "examplename",
"kioskMode": {
"enabled": true,
"package": com.example.player
}
}
}
Headers
Content-Type: application/json
Body
{
"assign": {
"group": 11074
},
"task": {
"remoteLogging": {
"enabled": true
}
}
}
200
Headers
Content-Type: application/json
Body
{
"taskid": "b684f565-1d27-41f9-80b6-dbb4fcb36639"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reason of the error"
}
Install packagePOST/tasks
Example URI
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"
}
}
}
200
Headers
Content-Type: application/json
Body
{
"taskid": "b684f565-1d27-41f9-80b6-dbb4fcb36639"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reason of the error"
}
Remove packagePOST/tasks
Example URI
Headers
Content-Type: application/json
Body
{
"assign": {
"devices: [
{
"deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33"
}
]
},
"task": {
"deletePackage": {
"packageName": "com.example.helloworld"
}
}
}
200
Headers
Content-Type: application/json
Body
{
"taskid": "b684f565-1d27-41f9-80b6-dbb4fcb36639"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reason of the error"
}
Screen monitoringPOST/tasks
Example URI
Headers
Content-Type: application/json
Body
{
"assign": {
"devices: [
{
"deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33"
}
]
},
"task": {
"screenMonitoring": {
"enabled": true,
"reqpermission": false
}
}
}
200
Headers
Content-Type: application/json
Body
{
"taskid": "b684f565-1d27-41f9-80b6-dbb4fcb36639"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reason of the error"
}
Kiosk modePOST/tasks
Example URI
Headers
Content-Type: application/json
Body
{
"assign": {
"devices: [
{
"deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33"
}
]
},
"task": {
"kioskMode": {
"enabled": true,
"package": com.example.player
}
}
}
200
Headers
Content-Type: application/json
Body
{
"taskid": "b684f565-1d27-41f9-80b6-dbb4fcb36639"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reason of the error"
}
Task operations ¶
Get task infoGET/tasks{?id,type}
Example URI
- id
string
(optional)Task ID in UUID format
- type
string
(optional)Task type
200
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
}
}
]
}
200
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
}
}
]
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reason of the error"
}
Update existing taskPUT/tasks
Update existing task by ID, type cannot be changed
Example URI
Headers
Content-Type: application/json
Body
{
"name: "examplename",
"installPackage": {
"source": "https://s3-eu-west-1.amazonaws.com/webkeytest/hello.apk"
}
}
Headers
Content-Type: application/json
Body
{
"screenMonitoring": {
"enabled": true,
"reqpermission": true
}
}
200
Headers
Content-Type: application/json
Body
{
"Message": "Updated"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reason of the error"
}
Task delete ¶
Delete existing taskDELETE/tasks/{taskId}
Example URI
- taskId
string
(required)Task ID in UUID format
200
Headers
Content-Type: application/json
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "reason of the error"
}
Task report ¶
Get task reportGET/tasks/report/{taskId}
Example URI
- taskId
string
(required)Task ID in UUID format
200
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"
}
]
}
400
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 methodPOST/remotemethod
Create new screenshot (preview image)
Example URI
Headers
Content-Type: application/json
Body
{
"assign": {
"devices: [
{
"deviceid": "a416dd1e-4174-11e7-a919-92ebcb67fe33"
}
]
},
"method": {
"name": "CREATE_SCREENSHOT",
"arguments": {},
"waitforresult": true
}
}
200
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
}
]
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "timeout"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "device (serial) not found by serial"
}
Send IntentPOST/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
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
}
}
200
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
}
]
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "timeout"
}
400
Headers
Content-Type: application/json
Body
{
"Error": true,
"Message": "device (nickname) not found by nick"
}