0

I am looking to send data from a SQL server to a third party api via Python. I was wondering if anyone could provide any references to follow that work through this process.

P.S - I've looked online but, suprisingly haven't found anything - perhaps I am not searching for the correct terms.

Any help would be appreciated.

jonplaca
  • 797
  • 4
  • 16
  • 34
  • 1
    IMHO, you may first need to search for some library that allows you to make SQL requests (which database are you using?), and then try to find out some other library for accessing the third party APIs (what technology does the API use? REST? SOAP?). Then, you will just have to use Python to write the glue logic. – Haroldo_OK Aug 01 '16 at 14:42
  • MySQL 2016 server using Docusign's REST API. Ideally, the Database would push a new row to the API when the new row is added - would this logic be in Python or a SQL procedure? – jonplaca Aug 01 '16 at 14:43

1 Answers1

1

Well, this tells you how to connect to MySQL via Python: How do I connect to a MySQL Database in Python?

And this tells you how to consume a REST API via Python: How do I get JSON data from RESTful service using Python?

You could access a REST API from MySQL via UDF, but that's not the kind of logic one should put in the database.

Community
  • 1
  • 1
Haroldo_OK
  • 6,612
  • 3
  • 43
  • 80
  • So, if I understand correctly, I access my own SQL database and obtain JSON data that I could then forward to the third-party API? I assume I would have to configure my own SQL database to format the JSON data correctly? Please confirm - thanks! – jonplaca Aug 01 '16 at 15:16
  • That's the idea. Your application would take the information from the database, and then forward it to the API; the database wouldn't even need to format the JSON data: the application could do that. – Haroldo_OK Aug 01 '16 at 16:37