Hey,

Sorry for the short delay, here are the steps I'm using in Azure LogicApps, but 
it's basically firing off Rest API Calls, so any such tool could help 
(Postman,...)


  1.  Get Guac Token
     *   POST http://104.40.xxx.xxx:8080/guacamole/api/tokens

  2.  Create new Guac User
     *   
@http://104.40.xxx.xxx:8080/guacamole/<http://104.40.xxx.xxx:8080/guacamole/api/tokens>api/session/data/mysql/users?token=?'authToken'

where I'm using this as JSON syntax for the user creation:

{
  "attributes": {
    "access-window-end": "",
    "access-window-start": "",
    "disabled": "",
    "expired": "",
    "timezone": "",
    "valid-from": "",
    "valid-until": ""
  },
  "password": "C0mpl3xPa55w.rd",
  "username": "Display Name"
}
  3.  Create new Guac Connection
     *   
@http://104.40.xxx.xxx:8080/guacamole/<http://104.40.xxx.xxx:8080/guacamole/api/tokens>api/session/data/mysql/connections?token==?'authToken'

and this JSON

{
  "activeConnections": 0,
  "attributes": {
    "failover-only": null,
    "guacd-encryption": null,
    "guacd-hostname": null,
    "guacd-port": null,
    "max-connections": null,
    "max-connections-per-user": null,
    "weight": null
  },
  "identifier": "",
  "lastActive": 1588436949000,
  "name": "<user display name>",
  "parameters": {
    "client-name": "",
    "clipboard-encoding": "",
    "color-depth": "",
    "console": "",
    "console-audio": "",
    "create-drive-path": "",
    "create-recording-path": "",
    "cursor": "",
    "dest-port": "",
    "disable-audio": "",
    "disable-auth": "",
    "disable-bitmap-caching": "",
    "disable-copy": "",
    "disable-glyph-caching": "",
    "disable-offscreen-caching": "",
    "disable-paste": "",
    "domain": "",
    "dpi": "",
    "drive-name": "",
    "drive-path": "",
    "enable-audio": "",
    "enable-audio-input": "",
    "enable-desktop-composition": "",
    "enable-drive": "",
    "enable-font-smoothing": "",
    "enable-full-window-drag": "",
    "enable-menu-animations": "",
    "enable-printing": "",
    "enable-sftp": "",
    "enable-theming": "",
    "enable-wallpaper": "",
    "gateway-domain": "",
    "gateway-hostname": "",
    "gateway-password": "",
    "gateway-port": "",
    "gateway-username": "",
    "height": "",
    "hostname": "<enter public ip of the VM here>",
    "ignore-cert": "true",
    "initial-program": "",
    "load-balance-info": "",
    "password": "C0mpl3xPa55w.rd",
    "port": "3389",
    "preconnection-blob": "",
    "preconnection-id": "",
    "printer-name": "",
    "read-only": "",
    "recording-exclude-mouse": "",
    "recording-exclude-output": "",
    "recording-include-keys": "",
    "recording-name": "",
    "recording-path": "",
    "remote-app": "",
    "remote-app-args": "",
    "remote-app-dir": "",
    "resize-method": "",
    "security": "nla",
    "server-layout": "",
    "sftp-directory": "",
    "sftp-host-key": "",
    "sftp-hostname": "",
    "sftp-passphrase": "",
    "sftp-password": "",
    "sftp-port": "",
    "sftp-private-key": "",
    "sftp-root-directory": "",
    "sftp-server-alive-interval": "",
    "sftp-username": "",
    "static-channels": "",
    "swap-red-blue": "",
    "timezone": "",
    "username": "@{body('Get_user')?['displayName']}",
    "width": ""
  },
  "parentIdentifier": "ROOT",
  "protocol": "rdp"
}

  1.  Link Connection to User
     *   
@http://104.40.xxx.xxx:8080/guacamole/<http://104.40.xxx.xxx:8080/guacamole/api/tokens>api/session/data/mysql/users/username/permissions?token=?authToken

and the following JSON

[
  {
    "op": "add",
    "path": "/connectionPermissions/Connection/<Connectionidentifier>,
    "value": "READ"
  }

I hope this helps, ping me when having any questions,

kind regards, Peter

________________________________
From: Peter De Tender <[email protected]>
Sent: Thursday, April 29, 2021 19:14
To: [email protected] <[email protected]>; 
[email protected] <[email protected]>
Subject: Re: rest api

I'm using Rest API to create users, connections and some other base settings.

I'll share some examples later tonight or tomorrow,

Thanks Peter

Get Outlook for Android<https://aka.ms/ghei36>

________________________________
From: Nick Couchman <[email protected]>
Sent: Thursday, April 29, 2021 2:57:17 PM
To: [email protected] <[email protected]>; 
[email protected] <[email protected]>
Subject: Re: rest api

There are a few examples lurking about. Someone has written a PowerShell 
extension that's been posted to the list in a couple of different places. I've 
written a really small sample of Python code:

https://github.com/necouchman/guacamole-python

We are working on trying to document the REST API a little bit better - until 
we have that completed, the best place to go is to the Developer Console in the 
web browser, specifically the "Network" section. If you follow the calls made 
while browsing around the UI and doing things there (creating, updating, and 
deleting, users, groups, connections, adjusting permissions, etc.) you can see 
all of the various REST calls that are made.

If you have specific questions or run into issues, feel free to post back here 
and ask them.

-Nick

On Wed, Apr 28, 2021 at 6:30 PM J. Christopher Little 
<[email protected]<mailto:[email protected]>> wrote:
Are there any examples lying around for using the guacamole api in python (or 
really any scripting language)?

Reply via email to