Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ecoflow River Pro - iot-auth/app/certification endpoint fails #35

Closed
svenzik opened this issue Mar 22, 2023 · 1 comment
Closed

Ecoflow River Pro - iot-auth/app/certification endpoint fails #35

svenzik opened this issue Mar 22, 2023 · 1 comment

Comments

@svenzik
Copy link

svenzik commented Mar 22, 2023

Hi.
First of all, i'd like to thank you about all the job, well done.

I have Ecoflow River Pro and I was able to add the integration, but all values shown for the device have value 0.
Could not find any more information from home-assistant log.

I looked at the code and tried tracing back the steps to find out what goes wrong.

  1. login is ok:
curl -v https://api.ecoflow.com/auth/login -H 'lang:en_US' -H 'content-type:application/json' \
  -d '{"email": "xxx@gmail.com", "password": "xxx", "scene": "IOT_APP", "userType": "ECOFLOW"}'

Response body:

{"code":"0","message":"Success","data":{"user":{"userId":"123","email":"xxx@gmail.com","name":"EcoFlow User","icon":"https://websiteoss.ecoflow.com/user/icon/123/wave.png","state":0,"regtype":"email","createTime":"2020-01-01 00:00:00","destroyed":"NORMAL","registerLang":"en_US","source":"IOT_APP","administrator":false,"appid":123},"token":"long_token"}}  
  1. certification fails with http code 405 (method not allowed)
curl -v https://api.ecoflow.com/iot-auth/app/certification -H 'lang:en_US' \
  -H 'authorization: Bearer long_token' \
  -d '{"userId": 123}'

< HTTP/2 405 
< date: Wed, 22 Mar 2023 06:56:16 GMT
< content-type: application/json; charset=UTF-8
< content-length: 45
< vary: Origin
< vary: Access-Control-Request-Method
< vary: Access-Control-Request-Headers
< allow: GET
< strict-transport-security: max-age=15724800; includeSubDomains
< 
* Connection #0 to host api.ecoflow.com left intact
{"code":"405","message":"Method Not Allowed"}

Am I missing some configuration on ecoflow app or web page so that the certification API endpoint would work?

@svenzik
Copy link
Author

svenzik commented Mar 22, 2023

Closing issue - ecoflow api uses body with GET method.
-X GET was missing from parameters.
Sorry for unnessesary issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant