Giter VIP home page Giter VIP logo

Comments (4)

bluehj777 avatar bluehj777 commented on June 26, 2024 1

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.

bluehj777 avatar bluehj777 commented on June 26, 2024 1

Thank you for this project anyway :-)

from unifi-api-browser.

malle-pietje avatar malle-pietje commented on June 26, 2024

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.

malle-pietje avatar malle-pietje commented on June 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.