I have some AC-Pro aps, and cloudkey G2. i have configured the key, included the aps, and turned on the portal (for voucher auth)
Now in my web app i need to create vouchers using cloud api. That my app running on my server (that is on remote network, could generate the voucher, and this voucher would be available on the remote network where cloudkey g2 is.
I have connected the cloudkey to the ubnt cloud account and i can manage it , add voucher and everything works.
The problem is with using that nodejs api.
let cloud = require('node-unifiapi/cloudapi');
let r = cloud({
deviceId: '801bb78e12c80000000001a22aea000000000203c905000000066660aaaa', // The cloud id of the device
username: 'clouduser',
password: 'cloudpass',
// debug: true, // More debug of the API (uses the debug module)
// debugNet: true // Debug of the network requests
});
r.api.stat_sessions()
.then((data) => {
console.log('Stat sessions', data);
return r.api.stat_allusers();
})
.then((data) => {
console.log('AP data', data);
})
.catch((err) => {
console.log('Error', err);
})
questions:
do I have to use the device ID from the website url ? or is it possible just to use macadress ?
username is username that i log in to my ubnt account ?
as above the ubnt password ?
site is it shortsite name or the name shown in the website ?
If someone has got working code example that connects to account, runst auth, and calls the api for voucher generation, than i would be very happy to have a look on that, i do not have much expierience, and working example would be perfect to see.
Hello,
I'm looking for example and explanation how to use :
https://github.com/delian/node-unifiapi
I have some AC-Pro aps, and cloudkey G2. i have configured the key, included the aps, and turned on the portal (for voucher auth)
Now in my web app i need to create vouchers using cloud api. That my app running on my server (that is on remote network, could generate the voucher, and this voucher would be available on the remote network where cloudkey g2 is.
I have connected the cloudkey to the ubnt cloud account and i can manage it , add voucher and everything works.
The problem is with using that nodejs api.
let cloud = require('node-unifiapi/cloudapi'); let r = cloud({ deviceId: '801bb78e12c80000000001a22aea000000000203c905000000066660aaaa', // The cloud id of the device username: 'clouduser', password: 'cloudpass', // debug: true, // More debug of the API (uses the debug module) // debugNet: true // Debug of the network requests }); r.api.stat_sessions() .then((data) => { console.log('Stat sessions', data); return r.api.stat_allusers(); }) .then((data) => { console.log('AP data', data); }) .catch((err) => { console.log('Error', err); }) questions:
do I have to use the device ID from the website url ? or is it possible just to use macadress ? username is username that i log in to my ubnt account ? as above the ubnt password ? site is it shortsite name or the name shown in the website ? If someone has got working code example that connects to account, runst auth, and calls the api for voucher generation, than i would be very happy to have a look on that, i do not have much expierience, and working example would be perfect to see.