irritanterik / homey-http-request-actions

HTTP request actions for flows on Homey by Athom
16 stars 14 forks source link

error 302 #16

Closed Daaann closed 5 years ago

Daaann commented 5 years ago

Want to send https://webehome.com/Public/login.aspx?LoginName=xxxxx&Password=xxxxxx&Action=home to my alarm but can not make it work. should I use GET or GET (querty) or something else? Receives error code 302.

irritanterik commented 5 years ago

Hi @Daaann. Use the GET Query card (A21) with the url query as a json. Example:

url parameter: https://webehome.com/Public/login.aspx
query parameter: {"LoginName": "xxxxx", "Password": "xxxxxx", "Action": "home"}
Daaann commented 5 years ago

Have tested to go just as you wrote but became no difference. Got green ok but nothing happens.

irritanterik commented 5 years ago

What debug info do you get in the Homey Logger app (https://apps.athom.com/app/gov.nsa.logger)? A green ok on the card in the flow editor means the API does not return an error.

Daaann commented 5 years ago

{"datetime":"2018-11-19T19:31:21.314Z","message":"A21 action.http_get_json","data":{"status":302,"response":"\r\nObject moved to here.

Daaann commented 5 years ago

Cannot GET /%22/error.html?aspxerrorpath=/Public/login.aspx\%22

irritanterik commented 5 years ago

%22 converts to " in html. Are you sure the first parameters in Homey with the URL does not contains the " character?

Daaann commented 5 years ago

Copy and paste this

Skickat från min Samsung Galaxy-smartphone.

-------- Originalmeddelande -------- Från: Erik van Dongen notifications@github.com Datum: 2018-11-19 21:34 (GMT+01:00) Till: irritanterik/homey-http-request-actions homey-http-request-actions@noreply.github.com Kopia: Daaann christiansson_dan@hotmail.com, Mention mention@noreply.github.com Rubrik: Re: [irritanterik/homey-http-request-actions] error 302 (#16)

%22 converts to " in html. Are you sure the first parameters in Homey with the URL does not contains the " character?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/irritanterik/homey-http-request-actions/issues/16#issuecomment-440032533, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Ao4DqZQAPY683xWqjpKNe1uXCwgyaBBzks5uwxXBgaJpZM4YoAWH.

Daaann commented 5 years ago

Didn't find any solution to this yet. No more ideas? The log still says: Cannot GET /%22/error.html?aspxerrorpath=/Public/login.aspx\%22.

Sent looks like this: {"datetime": "2019-01-08T16: 15: 29.008Z", "message": "A21 action.http_getjson", "data": {"args": {"url": " https://webehome.com/Public/login.aspx "," data ":" {\ "LoginName": "xxxxxx", "Password": "xxxxxxxx", "Action") "clear"} "," method ":" get "," urlOptions ": {" uri ":" https://webehome.com/Public/login.aspx "," query ": {" LoginName ":" xxxxxx "," Password ":" xxxxxxxx "," Action "," clear "}," timeout ": 30000}}}

irritanterik commented 5 years ago

Looks like jou have some spaces in the request field before and after the url

Daaann commented 5 years ago

Looks like this now but is the same error. {"datetime": "2019-01-08T16: 51: 21.813Z", "message": "A21 action.http_get_json", "data": {"args": {"url": "https: // webehome. com / public / login.aspx "" data ":" {\ "Accommodations Name \": \ "xxxxxx \", \ "Password \": \ "xxxxxxxxxxx \", \ "Action \": \ "clear \" } "}," method ":" get "," urlOptions ": {" uri ":" https://webehome.com/Public/login.aspx "," query ": {" Accommodations Name ":" xxxxxx " "Password": "xxxxxxxxxxx", "Action", "clear"}, "timeout": 30000}}}

irritanterik commented 5 years ago

302 is a http redirect code. To what endpoint do you get redirected when requesting the url in a browser?

Daaann commented 5 years ago

If I take both rows and put it together it will be like this in the browser: Something went wrong, please tell us about it. Click on this link to get back to WeBeHome (b3307).

Daaann commented 5 years ago

But this is how it works in your browser: https://webehome.com/Public/login.aspx?LoginName=XXXXX&Password=XXXXX&Action=home

and then I enter my alarm page logged in and selected mode activated

irritanterik commented 5 years ago

Does the browser gets a http 302 redirect? You can check this with the browser debug tools and then network monitor.

Daaann commented 5 years ago

Now I don't really understand .. is there in all browsers?

Daaann commented 5 years ago

Now I found out if I put the line in the browser so there is get 302

irritanterik commented 5 years ago

Fixed with 90e74192bffa9758fc9ed3afc7df42f5afb6ac41

irritanterik commented 5 years ago

App store approval is awaiting Athom code review.

Daaann commented 5 years ago

Okay so you've fixed an update! Looking forward to this! Thanks! How long does it usually take before approval?

irritanterik commented 5 years ago

Up to a week, but considering homey v2 stable launch I expect it to be shorter

Daaann commented 5 years ago

Okay tried to install directly from your zip file but came in error at the end.

Pre-processing app ... ✓ Validating app ... ✓ Homey App validated successfully against level debug ✓ Packing Homey App ...

irritanterik commented 5 years ago

Wait 4 days, install Homey v2 then try again ;)

Daaann commented 5 years ago

Unfortunately 2.0 did not solve my problems. You do not have any other ideas about what might be wrong

irritanterik commented 5 years ago

So new app version installed? You could try homey v2 native web request action.

Daaann commented 5 years ago

excuse me but where do I find it?

Skickat från min Samsung Galaxy-smartphone.

-------- Originalmeddelande -------- Från: Erik van Dongen notifications@github.com Datum: 2019-01-17 07:52 (GMT+01:00) Till: irritanterik/homey-http-request-actions homey-http-request-actions@noreply.github.com Kopia: Daaann christiansson_dan@hotmail.com, Mention mention@noreply.github.com Ämne: Re: [irritanterik/homey-http-request-actions] error 302 (#16)

So new app version installed? You could try homey v2 native web request action.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/irritanterik/homey-http-request-actions/issues/16#issuecomment-455062118, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Ao4Dqd52xy8-loGL7k62e2Pd3Mlhm37Pks5vEB2rgaJpZM4YoAWH.

Daaann commented 5 years ago

where do I find this? "homey v2 native web request action"

irritanterik commented 5 years ago

https://blog.athom.com/homey-v2-0-insights-alarms-logic/