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

Added Requisition Hook Guidance #60

Merged
merged 3 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,28 @@ docker run \
ghcr.io/martinohansen/ynabber:latest
```


### Requisition URL Hooks

In order to allow bank account data to flow to YNAB, this application requires an authentication with Nordigen. That URL is called "requistion URL" and is available in the docker logs. For some banks, this access is only valid for 90 days. This application requires a relogin after. In order to make that process easier (i.e. by sending the requistion URL to the phone) ynabber supports hooks when creating a requisition URL. In order to set it up, one first creates a shell-script, for example named `hook.sh`:

```bash
#! /bin/sh

echo "Hi from hook 👋
status: $1
link: $2
at: $(date)"
fi
```

And then configures a hook in the configuration file:
```bash
NORDIGEN_REQUISITION_HOOK=/data/hook.sh
```

When using ynabber throuch docker, keep in mind that the docker container does not support a vast array of command line tools (i.e. no bash, wget instead of cURL).

## Readers

Currently tested readers and verified banks, but any bank supported by Nordigen
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash
#! /bin/sh

echo "Hi from hook 👋
status: $1
Expand Down
11 changes: 11 additions & 0 deletions reader/nordigen/hooks/logsnag-example.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
reqURL=$2

logsnagToken="<your-logsnag-token>"
logsnagProject="<your-project>"
logsnagChannel="<your-channel>"

wget --header 'Content-Type: application/json' \
--header "Authorization: Bearer ${logsnagToken}" \
--post-data "{\"project\":\"${logsnagProject}\",\"channel\":\"${logsnagChannel}\",\"event\":\"Confirm requisition URL\",\"description\":\"${reqURL}\",\"icon\":\"❤️\",\"notify\":true}" \
'https://api.logsnag.com/v1/log'
Loading