Using curl to get status of camera - always 'unauthorised'

gr4z
edited August 2018 in SecuritySpy
HI

I am trying to get some more logic into my home assistant automation software for SS. I would like to try and get the current status of the cameras using the following command:

curl -k "http://username:password@IP:8000/++cameramodes?cameraNum=0"

All I ever get is the response '401 unauthorized'. I know my username and password are correct, any other suggestions?

Thanks

Comments

  • Try using an "auth" parameter instead of specifying the username and password before the IP address. Here is an example to illustrate:

    http://IP:8000/++cameramodes?cameraNum=0&auth=dXNlcjpwYXNz

    Set the value of the auth parameter to the Base64-encoded string username:password
  • I have tried to use the auth parameter and get the same error '401 unauthorised'
  • Ben
    Ben
    edited August 2018
    In that case, either the username and password is being specified incorrectly, or the account has insufficient access privileges to access that data. Check the account settings under Preferences -> Web. The required permission is "Arm and disarm, set schedules". So either this must be set for the camera(s) in question, or you could set the permission level to "Administrator", in which case the account will have full access.
  • gr4z
    edited August 2018
    OK I have two accounts, one read only and one full admin. Even if I use the full admin I still get a 401. I have confirmed my username and password and used Base64 format of username:password. Still no luck :(

    EDIT: OK I think I have sorted it by using a different URL, I was using my external address. I changed it to my internal IP and it seems to have worked!