-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Hello,
Unfortunately, I have not been able to get this working yet. Here is what I have:
let CloudAPI = require('node-unifiapi/cloudapi');
let cloud = CloudAPI({
//deviceId: '', // The cloud id of the device
username: 'unifi',
password: 'unifi',
debug: true, // More debug of the API (uses the debug module)
debugNet: true // Debug of the network requests
});
cloud.self()
.then(() => cloud.devices())
**username and password excluded for obvious reasons
I receive:
{ response:
{ debugId: 3,
headers:
{ date: 'Sat, 18 Apr 2020 10:04:08 GMT',
'content-type': 'application/json; charset=utf-8',
'content-length': '24',
connection: 'close',
'access-control-allow-origin': 'https://account.ubnt.com',
vary: 'Origin',
'access-control-allow-credentials': 'true' },
statusCode: 200,
body: '{"count":0,"devices":[]}' } }
CloudAPI Received response: string +372ms
CloudAPI now we have object +1ms
Which I know isn't correct. I looked on unifi.ui.com (The new UbiOS page) and this is in the requests:
https://cloudaccess.svc.ui.com/devices?withUserData=true
https://ubic-stabilizer.svc.ui.com/api/airos/v1/unifi/devices?page=0&page_size=1000
So the second one (which I think your API is calling) is showing 0, whereas the first one is accurate.
It also looks like there is a 'list' which is at: https://cloudaccess.svc.ui.com/list, which also returns correct info.
Also: URL for getting the new UbiOS devices (UDMs) https://cloudaccess.svc.ui.com/devices?type=ucore,ulp&withUserData=true
Any help is much appreciated :)