API Access - API documentation and example scripts

Follow

RealVNC Connect provides APIs for managing your RealVNC Connect team. To enable APIs for your RealVNC Connect subscription you will need to contact our Sales team.

If you have enabled API Access for your subscription, please refer to this guide to create an Access Key: API Access - managing API Access Keys

API documentation

Click here to access the RealVNC Connect API documentation.

Example script


Powershell

Download

*This script looks for a file named accesskey.json in the same directory as the script. The format is: {"accessKey": "XXXXX", "accessKeyId": "YYYYY"}

You can use this Powershell script for a demonstration of the capabilities of the RealVNC Connect APIs. To use it, you need to have API Access enabled for your RealVNC Connect subscription and an API Access Key.

Note, the script is provided purely for sample purposes and is not supported by RealVNC. Exercise caution when using this script as it may modify your RealVNC Connect service.

Usage
-listcomputers [-lastseentime]
[-entryid] [-withgroups] [-ungroupedonly]
[-csv] [-table] [-gridview]
Prints list of computers in your Team to the console.
  • If -lastseentime is specified then the last time the computer completed a daily check-in is included.
  • If -entryid is specified then the entryId of the computer is included.
  • If -withgroups is specified then the computer group memberships of the computer are included.
  • If -csv is specified the information is output to Computers.csv in the script directory.
  • If -table is specified the information is output in tabular format.
  • If -gridview is specified the information is output to the graphical Grid View application.


Requires Access Key with LIST_ENTRIES permission
-renamecomputer "currentcomputername,newcomputername" Renames the computer named currentcomputername to newcomputername. Names should be comma separated and enclosed in quotes.

Requires Access Key with LIST_ENTRIES, UPDATE_ENTRY permissions
-renamecomputerlistbyname "filename" Renames the computer names in the file filename. The file must be in comma separated format currentcomputername,newcomputername - 1 per line.

Requires Access Key with LIST_ENTRIES, UPDATE_ENTRY permissions
-findcomputer "computername" Find the computer named computername in the Team. Name should be enclosed in quotes.

Requires Access Key with LIST_ENTRIES permission
-removecomputer "computername" [-force] Removes the computer named computername from the Team. Name should be enclosed in quotes.

Specify -force to bypass the confirmation prompt.

Requires Access Key with LIST_ENTRIES, DELETE_ENTRY permissions
-removecomputerlistbyname "filename" [-force] Removes the computer names listed in the file filename. The file must have 1 computer name per line.

Specify -force to bypass the confirmation prompt.

Requires Access Key with LIST_ENTRIES, DELETE_ENTRY permissions
-removecomputerlistbyid "filename" [-force] Removes the computer entryIDs listed in the file filename. The file must have 1 computer entryId per line.

Specify -force to bypass the confirmation prompt.

Requires Access Key with DELETE_ENTRY permission
-cleanduplicates "computername" [-force] Finds all duplicated Computer entries for a given computer name prefix in the Team, removes all old/invalid entries and renames the working entry.

Specify -force to bypass the confirmation prompt.

Requires Access Key with LIST_ENTRIES, UPDATE_ENTRY, DELETE_ENTRY permissions
-cleanallduplicates [-force] Finds all duplicated Computer entries in the Team, removes all old/invalid entries and renames the working entry.

Specify -force to bypass the confirmation prompt.

Requires Access Key with LIST_ENTRIES, UPDATE_ENTRY, DELETE_ENTRY permissions
-cleanstalecomputers "timeperiod" [-force] Finds all Computer entries that haven't been seen online for the specified time period and removes them.

timeperiod can be specified as a numeric value in seconds or with a time-period suffix (s = seconds, m = minutes, h = hours, d = days, w = weeks, M = months, y = years)

Specify -force to bypass the confirmation prompt.

Requires Access Key with LIST_ENTRIES, DELETE_ENTRY permissions
-listcomputergroups   Prints list of computer group names to the console.

Requires Access Key with LIST_ENTRY_GROUPS permission
-findcomputergroup "computergroupname" Find the computer group named computergroupname in the Team. Name should be enclosed in quotes.

Requires Access Key with LIST_ENTRY_GROUPS permission
-listgroupsforcomputer "computername"   Prints list of computer group names that the computer named computername belongs to. Name should be enclosed in quotes.

Requires Access Key with LIST_ENTRY_GROUPS permission
-groupaddcomputer "computergroupname,computername" Adds the computer named computername to the computer group named computergroupname. Names should be comma separated and enclosed in quotes.

Requires Access Key with LIST_ENTRIES, LIST_ENTRY_GROUPS, UPDATE_ENTRY_GROUP permission
-bulkgroupaddcomputer "filename" Processes a CSV file to add computers to the specified groups. The file must be a CSV with 3 columns named GroupName, Name and EntryID.

EntryID can be retrieved using -listcomputers. The file must have a header row.

Requires Access Key with UPDATE_ENTRY_GROUP permission
-groupremovecomputer "computergroupname,computername" Removes the computer named computername from the computer group named computergroupname. Names should be comma separated and enclosed in quotes.

Requires Access Key with LIST_ENTRIES, LIST_ENTRY_GROUPS, UPDATE_ENTRY_GROUP permission
-listauditevents
[-daterange "startdate,enddate"]
[-connectionsonly] [-csv] [-table] [-gridview]
Prints list of audit events for your Team to the console.

  • If -daterange is specified, the events are filtered to only display those between the specified dates.
  • Dates should be comma separated and enclosed in quotes.
  • If -connectionsonly is specified then only Session Log events are displayed.
  • If -csv is specified the information is output to Events.csv in the script directory.
  • If -table is specified the information is output in tabular format.
  • If -gridview is specified the information is output to the graphical Grid View application.
Requires Access Key with LIST_AUDIT_EVENTS permission
-listpresence [-csv] [-table] [-gridview] Prints list of Presence status for computers on your Team to the console.

  • If -csv is specified the information is output to Presence.csv in the script directory.
  • If -table is specified the information is output in tabular format.
  • If -gridview is specified the information is output to the graphical Grid View application.
Requires Access Key with LIST_PRESENCE permission
-listusers [-userid] [-withgroups]
[-ungroupedonly] [-csv] [-table]
[-gridview]
Prints list of users in your Team to the console.

  • If -userid is specified then the id of the user is included.
  • If -withgroups is specified then the user group memberships of the user are included.
  • If -csv is specified the information is output to Users.csv in the script directory.
  • If -table is specified the information is output in tabular format.
  • If -gridview is specified the information is output to the graphical Grid View application.
Requires Access Key with LIST_TEAM_MEMBERS permission
-inviteuser "useremail userroles" [-groups] Invites the user with email address useremail to the team with the role(s) userroles.

The argument must be enclosed in quotes, with useremail and userroles separated by a space. Multiple roles can be specified using a comma separated list.

If -groups is specified, the invited user will be added to the group names provided. Multiple group names can be specified using a comma separated list.

Valid userroles: USER, MANAGER, TECHNICIAN

Requires Access Key with ADD_TEAM_MEMBER permission
-updateuserroles "useremail userroles" Invites the user with email address useremail to the team with the role(s) userroles.

The argument must be enclosed in quotes, with useremail and userroles separated by a space. Multiple roles can be specified using a comma separated list.

Valid userroles: USER, MANAGER, TECHNICIAN

Requires Access Key with LIST_TEAM_MEMBERS,UPDATE_TEAM_MEMBER_ROLES permissions
-finduser "useremail" Find the user with email address useremail in the Team. Email address should be enclosed in quotes.

Requires Access Key with LIST_TEAM_MEMBERS permission
-removeuser "useremail" Removes the user with email address useremail from the Team. Email address should be enclosed in quotes.

Requires Access Key with LIST_TEAM_MEMBERS, REMOVE_TEAM_MEMBER permissions
-listusergroups Prints list of user group names to the console.

Requires Access Key with LIST_USER_GROUPS permission
-findusergroup "usergroupname" Find the user group named usergroupname in the Team. Name should be enclosed in quotes.

Requires Access Key with LIST_USER_GROUPS permission
-listgroupsforuser "useremail" Prints list of user group names that the user with email address useremail belongs to. Name should be enclosed in quotes.

Requires Access Key with LIST_USER_GROUPS permission
-groupadduser "usergroupname,useremail" Adds the user with email address useremail to the user group named usergroupname. Names should be comma separated and enclosed in quotes.

Requires Access Key with LIST_TEAM_MEMBERS, LIST_USER_GROUPS, UPDATE_USER_GROUP permission
-bulkgroupadduser "filename" Processes a CSV file to add users to the specified groups.

The file must be a CSV with 3 columns named GroupName, Email and UserID. UserID can be retrieved using -listusers. The file must have a header row.

Requires Access Key with UPDATE_USER_GROUP permission
-groupremoveuser "usergroupname,useremail" Removes the user with email address useremail from the user group named usergroupname. Names should be comma separated and enclosed in quotes.

Requires Access Key with LIST_TEAM_MEMBERS, LIST_USER_GROUPS, UPDATE_USER_GROUP permissions
Was this article helpful?
7 out of 17 found this helpful

Comments

0 comments

Article is closed for comments.