Brandawg93 / homebridge-nest-cam_old

Use your Nest Cam as IP camera in HomeKit.
Apache License 2.0
89 stars 14 forks source link

[NestCam]Failed to request access token. Unexpected API Error - 405 #40

Open cbeale opened 5 years ago

cbeale commented 5 years ago

Hi -

Having an issue with NestCam, trying to add it to my existing homebridge setup.

Homebridge starts up and then I get

"[NestCam]Failed to request access token. Unexpected API Error - 405"

I added it as shown in the guide.

Is this known? I saw one person comment about it but no resolution was given.

Thanks

Rens93 commented 5 years ago

I didn’t ☹️

morilm commented 5 years ago

[NestCam]Failed to request access token. Unexpected API Error - 403 When I use the code in terminal I get the next error: {"url":"/session","message":"400 Bad Request"}/homebridge #

I am having this issue as well, how did you resolve it?

Use the curl expresion provided above... the one on the github doesn't work for me

You just need to put your email address and your nest password

curl -X "POST" "https://home.nest.com/session" -H 'User-Agent: iPhone iPhone OS 11.0 Dropcam/5.14.0 com.nestlabs.jasper.release Darwin' -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' --data-urlencode "email=a@b.com" --data-urlencode "password=blabla!!!!123"

djglisson2 commented 5 years ago

I saw it mentioned above, but not sure it was ever resolved: When a password ends in a ! (as mine did) it results in : -bash: !": event not found

The only way around this seems to be changing one's password to not end in a ! (which I did). Would be lovely if that wasn't required however.

felsmann commented 5 years ago

Likely your plugin is not updated

Juan Felsmann jfelsmann@gmail.com

On Dec 22, 2018, at 08:03, Harold notifications@github.com wrote:

I have upgraded the plugin, was able to get a token using 2FA method and put it in the config but I still get [NestCam]Failed to request access token. Unexpected API Error - 405

I must be missing something...

Events with specific values removed:

curl -X "POST" "https://home.nest.com/session" -H 'User-Agent: iPhone iPhone OS 11.0 Dropcam/5.14.0 com.nestlabs.jasper.release Darwin' -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' --data-urlencode "email=MYEMAIL" --data-urlencode "password=MYPASSWORD"

{"status":"VERIFICATION_PENDING","2fa_token":"2FATOKENVALUE","truncated_phone_number":"5555"}

curl -X "POST" "https://home.nest.com/api/0.1/2fa/verify_pin" -H 'User-Agent: iPhone iPhone OS 11.0 Dropcam/5.14.0 com.nestlabs.jasper.release Darwin' -H 'Content-Type: application/json; charset=utf-8' -d $'{"pin": "555555","2fa_token": "2FATOKENVALUE"}'

{"status":"ID_MATCH_POSITIVE","access_token":"TOKENVALUE"}

CONFIG:

{ "platform": "Nest-cam", "access_token": "TOKENVALUE", "useOMX": false }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

applemacgenius commented 5 years ago

I have tried this so many different ways. I keep getting: {"url":"/session","message":"400 Bad Request"}

I have not "!" in my password. I have a "@" but I don't think that matters.

I did notice there is some new info on https://developers.nest.com/guides/api/authorization-reference and https://developers.nest.com/guides/api/how-to-auth

any help would be appreciated.

JoshCash commented 5 years ago

I'm having the same exact issue as applemacgenius. No clue where to go from here sadly.

asmodeus097 commented 5 years ago

I am able to request a token using the first curl sequence and I do receive my SMS message code. When I try to send the second curl command to verify I receive {"error":"access_denied","error_description":"permission denied","instance_id":...

JoshKitson commented 5 years ago

having the same issue requesting a token - {"url":"/session","message":"400 Bad Request"}

love to hear any suggestions?

Edit - this issue requesting a token is due to copying pasting the curl command into a text editor that is altering it slightly. Now resolved

cobyalmond commented 5 years ago

Hi -

Having an issue with NestCam, trying to add it to my existing homebridge setup.

Homebridge starts up and then I get

"[NestCam]Failed to request access token. Unexpected API Error - 405"

I added it as shown in the guide.

Is this known? I saw one person comment about it but no resolution was given.

Thanks

Having same Issue. Tried all the steps. I'm wondering if using the homebridge-nest plugin causes a conflict. Any ideas?

black01gt commented 5 years ago

I’m yawing the homebridge nest plugin also with no issues. Everything is working great. Make sure you follow the steps closely.

coxfrederic commented 5 years ago

I am able to request a token using the first curl sequence and I do receive my SMS message code. When I try to send the second curl command to verify I receive {"error":"access_denied","error_description":"permission denied","instance_id":...

Did you resolve this? I'm getting the same. Even through postman nor curl can I get a token based on the verification PIN and token from previous command..

asmodeus097 commented 5 years ago

Still unresolved. I ended up having to turn off 2 factor authentication to get it to work.

wasifhuda commented 5 years ago

For those who have a "!" at the end of a password, and trying to run the command which results in the following error: !": event not found

Try running "set +H" in Terminal and then running curl express, it should fix the issue