diff --git a/fava_client.py b/fava_client.py index f7f9983..38e932a 100644 --- a/fava_client.py +++ b/fava_client.py @@ -10,7 +10,9 @@ Fava provides a REST API for: - Querying balances (GET /api/query) - Balance sheets (GET /api/balance_sheet) - Account reports (GET /api/account_report) -- Updating/deleting entries (PUT/DELETE /api/source_slice) +- Getting entry context (GET /api/context) +- Updating entries (PUT /api/source_slice) +- Deleting entries (DELETE /api/source_slice) See: https://github.com/beancount/fava/blob/main/src/fava/json_api.py """ @@ -1098,7 +1100,8 @@ class FavaClient: """ Get entry source text and sha256sum for editing. - Uses /source_slice endpoint which returns the editable source. + Uses /context endpoint which returns the editable source slice. + Note: Fava's API uses get_context for reading, put_source_slice for writing. Args: entry_hash: Entry hash from get_journal_entries() @@ -1117,7 +1120,7 @@ class FavaClient: try: async with httpx.AsyncClient(timeout=self.timeout) as client: response = await client.get( - f"{self.base_url}/source_slice", + f"{self.base_url}/context", params={"entry_hash": entry_hash} ) response.raise_for_status()