Receives parcelLab webhooks and writes them to a CSV
Get help at [email protected]
It receives parcelLab webhooks (or actually any webhook) and transforms any received JSON payload to CSV files. It writes a new file approx every 30 seconds. The generated CSV will have headings in the order of the keys of the received payloads.
You can set different URL query parameters to change the behaviour:
?id=
: where to store files, defaults todefault
&prefix=
: a prefix for all CSV file names&headers=
: sets whether CSV has header row and can betrue
orfalse
, defaults totrue
&delimiter=
: delimiter to use in CSV, defaults to;
"e=
: quote char to use for CSV, defaults to"
&token=
: the token as specified in.env
(required)
Running a POST
request against this service:
http://localhost:8080/webhook/?id=someid&prefix=webhook&headers=true&delimiter=|&token=some-token
With this body:
{
"test": "okay",
"anothertest": "notokay"
}
Will generate a local file named ./someid/webhook_<timestamp>.csv
with these contents:
test;anothertest
okay;notokay
Just git clone
this repo, then cd webhook-to-csv
and install dependecies with npm i
.
You'll need a reverse proxy pointing to localhost:8080
and probably something to keep the app alive, like PM2.