How do I import data via webhook?

October 5, 2019 200 views
API PostgreSQL

I have a service that emails me a dataset daily. However, I would like to house all of my exported data in a single database.

My data service has an webhook export option (rather than the email option I use now). The export config settings seem straightforward. They need a webhook URL and request method (POST) and some dataset formatting options.

Is this something I can set up with a managed database with Digital Ocean?

(My use of the database is intended just for querying with Microsoft PowerBI/PowerQuery)

1 Answer

Yes, however you will need to have some semblance of middleware running in a droplet (or other server/machine) that would manage querying the service, consume the result, and store it in the DO Managed DB. The language you choose is your choice.

An example is recently a co-developer and I wrote a script (PHP) that from a droplet queried our CRM service via a webhook that returned a JSON object of the tasks he and I had completed during the week, formats it, and sends the data to our department manager via email. The reason we did this is for a “Bragging” email that is sent to our sales department weekly.

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!