jhonderson / actual-http-api

Basic Actual Budget API exposed through HTTP endpoints
MIT License
43 stars 13 forks source link

api denied with 'forbidden' error response #9

Closed laker-93 closed 4 months ago

laker-93 commented 8 months ago

I am running actual budget as a docker container. It is accessible on localhost:5006.

However, when trying to use actual-http-api on port 5007 I get the following response:

{
  "error": "Forbidden"
}

I have correctly configured actual-http-api with my username and password of my actual budget login. Is there some additional configuration I need to make to my actual budget docker instance to get the API to work?

jhonderson commented 8 months ago

Hey, so there are 2 environment variables you need to configure when deploying actual http api:

  1. ACTUAL_SERVER_PASSWORD: Here you put the actual budget server password
  2. API_KEY: This is a custom random string value that you create. There are some special characters that can cause problems, see issue 8.

Then when you call the api you have to pass the random string (API_KEY) as header:

curl -X 'GET' 'http://localhost:5007/v1/budgets/{BUDGET-SYNC-ID}/accounts' \
 -H 'accept: application/json' \
 -H 'x-api-key: {API_KEY}'
jhonderson commented 4 months ago

Closing for inactivity, feel free to re-open if more help is needed.