Page 2 of 2

Re: SOLVED 2.0.2. Unauthorized","error":"Not logged in"

Posted: 23 Jul 2015 22:29
by fableman
aivs wrote:To login with curl use this command, it saves cookie to file "cookie.txt" :

Code: Select all

curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"form":true,"login":"admin","password":"admin","keepme":false,"default_ui":1}' http://192.168.0.62:8083/ZAutomation/api/v1/login -c cookie.txt
Now you control devices with command:

Code: Select all

curl http://192.168.0.62:8083/ZAutomation/api/v1/devices/ZWayVDev_zway_6-0-37/command/on -b cookie.txt
Be sure to use cookies.
Aivs that's a great solution. Thanks alot.

Will this stop working in the future and need cookie and login?
curl -s -LN --globoff 'http://10.10.10.80:8083/ZWaveAPI/Run/de ... 37].Set(0)'

Re: SOLVED 2.0.2. Unauthorized","error":"Not logged in"

Posted: 25 Jul 2015 18:41
by AlphaX2
Hi,

Is there any kind of an offical documentation? Because I wanted to use it with Python and was not able to get something to work, because the offical Dev PDF file is missing this information - how to login - as well.

AlphaX2

Re: SOLVED 2.0.2. Unauthorized","error":"Not logged in"

Posted: 26 Jul 2015 00:19
by PoltoS
The curl example was added in FAQ on the site. We are updating the manual to include authentication.

Re: SOLVED 2.0.2. Unauthorized","error":"Not logged in"

Posted: 26 Jul 2015 00:24
by AlphaX2
Would be cool to see the apiary.io documentation updated as well. Could help a lot. For the moment the Anonymus solution is good enough, but also took some search to find the hint, how to do that. ;)

Thank you anyway.