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
Uh oh!
There was an error while loading. Please reload this page.
-
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/operationand 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/operationor
curl --cacert cacert.pem --header "Authorization: Bearer my_token" -X POST -d '{"mode":"autonomous","backup_reserve_percent":100}' https://powerwall/api/operationor even
curl --cacert cacert.pem --header "Authorization: Bearer my_token" -X POST -d '{"backup_reserve_percent":100}' https://powerwall/api/operationI 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