Discussions

Expand all | Collapse all

add data to Quickbase using python requests library

  • 1.  add data to Quickbase using python requests library

    Posted 04-08-2019 20:26
    Does anyone know how to send data to Quickbase using Python?  I'm trying to upload a CSV object to a table.  I'd be happy to start with the simplest example of a working GET or POST to send even one record to QB.

    I want to ask the question generally, but ultimately I want to be able to POST a csv object to a Quickbase table for the purpose of running a Machine Learning model outside of Quickbase and posting the results back to the table's records.

    Thanks!







  • 2.  RE: add data to Quickbase using python requests library

    Posted 04-08-2019 21:31
    Resolved this.  Can share if anyone is interested.  If you use Python with QB please reach out.  Would love to know about how you're using it!


  • 3.  RE: add data to Quickbase using python requests library

    Posted 04-25-2019 16:12
    How were you able to get this in python?


  • 4.  RE: add data to Quickbase using python requests library

    Posted 04-25-2019 19:08
    Besides this, there are SDKs for Python and QuickBase that I wrote an article about in linkedin in the past, But I think the response = request() construct is probably the best way.

    @Jake, please feel free to share how you did it.


  • 5.  RE: add data to Quickbase using python requests library

    Posted 04-25-2019 19:49
    1. I imported 'Requests' and used the Quickbase API.
    2. I defined a csv object based on my data model and called it 'Test'
    3. Then I retrieved my application data looking for my authorization ticket using: 
      request = requests.get('https://domainquickbase.com/db/main?a=api_authenticate&username=X&password=X�
    4. I then used regex to extract the ticket from the returned xml and called the ticket 'found'
    5. I then posted the data from my csv object 'test' and passed in my auth ticket 'found':
      headers = {'Content-Type':'application/xml','QUICKBASE-ACTION':'api_importfromcsv'}  data = '<qdbapi><ticket>'+found+'</ticket><records_csv><![CDATA['+test+']]></records_csv>  <clist>1.2.3</clist><apptoken>TOKEN</apptoken></qdbapi>'
      r = requests.post(url = �END_PT_URL�, data = data, headers=headers) 

    I'm sure there are even better ways to do this. If anyone has a method I would love to know. 


    Jake Rattner | Solutions Architect
    (847) 927-1427 | jrattner@quandarycg.com
    Quandary Knowledge Base