Bearer auth works with GET but not with POST #87
Unanswered
riccardoriva
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thanks for the project! I've created a simple shell script to get the bearer token but it seems that I can use the token for GET the status with for example:
curl --cacert cacert.pem --header "Authorization: Bearer my_token" https://powerwall/api/operation
and had the answer with the correct value configured on mobile app
{"real_mode":"autonomous","backup_reserve_percent":33.5}
but if I try to use the same method for a POST with for example
curl --cacert cacert.pem --header "Authorization: Bearer my_token" -X POST -d '{"mode":"self_consumption","backup_reserve_percent":100}' https://powerwall/api/operation
or
curl --cacert cacert.pem --header "Authorization: Bearer my_token" -X POST -d '{"mode":"autonomous","backup_reserve_percent":100}' https://powerwall/api/operation
or even
curl --cacert cacert.pem --header "Authorization: Bearer my_token" -X POST -d '{"backup_reserve_percent":100}' https://powerwall/api/operation
I had a 403 error with unadequate access rights
{"code":403,"error":"Unable to POST to resource","message":"User does not have adequate access rights"}
what I’m missing ?
Thank you in advance
Beta Was this translation helpful? Give feedback.
All reactions