Comments (4)
It looks like there is a solution:
In the terminal:
curl 'http://192.168.1.1/ajax/fetch_collection.php'
-H 'Cookie: PHPSESSID=gt5cbcbsd8dookf6rq58aqtic1'
--data-raw 'selected_collection_method=list_devices&selected_collection_label=+list+devices+&selected_collection_key=&selected_collection_params=%5B%5D&selected_collection_group=Devices&selected_site_id=abcdef&selected_output_method=json'
PHPSESSID->you can find in the apache server /var/lib/php/sessions/sess_gt5cbcbsd8dookf6rq58aqtic1
selected_site_id->which is the short site "name" (usually 8 characters long)
Finally, just make sure that the sess_gt5cbcbsd8dookf6rq58aqtic1 file is always there, you can now type the CURL command directly into any other machine and output the JSON results you need
In fact, this need of mine is for rest or command Line integration can be used in home assistant to monitor Unifi devices
from unifi-api-browser.
Thank you for this project anyway :-)
from unifi-api-browser.
That isn’t an intended use case for this tool. You can however create a utility for this yourself using the PHP API client. Direct curl access to the API is quite tricky because of the authentication mechanism that is used by the UniFi controller API.
from unifi-api-browser.
Nice approach but it’s more of a hack IMHO. But hey, if it works for you that’s fine👍
from unifi-api-browser.
Related Issues (20)
- 24hr usage HOT 2
- Any documentation available? HOT 2
- All devices HOT 3
- Removing users across all sites HOT 1
- UI Cloud Controller integration HOT 3
- Permission denied (13) when loading sites HOT 9
- Unable to get list of sites from local UCG Ultra HOT 1
- Default Site / Collection HOT 4
- Connection Error HOT 2
- How can I see all energy (watts) being usage on the network HOT 1
- UniFi controller login failure HOT 4
- API IP from VPN HOT 7
- UDM Pro firmware beta version 1.11.0-14 and 1.11.0-15 HOT 2
- API does'nt work need help HOT 7
- Access to WLAN password HOT 15
- Possible issue with CORS HOT 3
- Demo not working HOT 2
- Unifi 7.0 Controller API Issue HOT 3
- Node lacks support for Ubiquiti power strips and plugs. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unifi-api-browser.