lukasroegner / homebridge-philips-hue-sync-box

Homebridge plugin for the Philips Hue Sync Box.
MIT License
57 stars 13 forks source link

How to get "Your-Token" #6

Closed Ghitafjorback closed 4 years ago

Ghitafjorback commented 4 years ago

Hi again, I am sorry for being such a noob, but I really cannot get my head around how to find "Your-Token". I set the "isApiEnabled" to "true" in my json in Homebridge, and I tried different things in the app "Postman" in order to get the "Your-Token", but Postman keeps giving me an error. I tried, GET, POST and create API and all sorts of things... all wrong, I am sure. Can you explain how to retrieve it for a noob like me?

I am using "http://"my homebridge raspberry IP":40220"

Thank you in advance Ghita

lukasroegner commented 4 years ago

You just have to specify a token. Sample config.json part:

"isApiEnabled": true,
"apiPort": 40220,
"apiToken": "abc-my-secret-123"

Let's assume the IP address of the Raspberry is 192.168.0.2. Then, you can access the state of the sync box via API at:

Method: 
GET

URL: 
http://192.168.0.2:40220/state

Headers:
Authorization -> abc-my-secret-123
(tab "Headers" in Postman, add a new entry with Authorization in the left column and abc-my-secret-123 in the right column)

You will receive the state of the Sync Box as JSON

Ghitafjorback commented 4 years ago

Aaaaaah... now I get it! thanks, I can now start playing around with the IOS Shortcuts. :) Thank you very much Ghita