Forum Discussion

CameronHughes's avatar
CameronHughes
Qrew Trainee
8 years ago

Python API - Add Record Examples?

I am looking for an example of doing a super simple add record api call using python. I cant seem to get it to work.

I end up getting "Max retries exceeded..." 

If anyone can help out, it would be super appreciated.
  • I am not sure why or when you got that particular error, but I had my own issues with API_AddRecord in the Python SDK from https://github.com/QuickbaseAdmirer/Quickbase-Python-SDK.

    These are the bugs I found:


    1. "realmhost" variable must be left blank. Just send the url to the url parameter ending with /db/. No need to populate the realmhost, as it is not being used correctly in this SDK.
    2. You need to comment out the lines that are not relevant to your Python version. There are a total of 3 instances in the pybase.py file where you need to comment out the line of code that is not relevant to your version of Python.
    3. You should send the fieldname (without spaces and other special characters) when referring to your fields in the data variable. Do not send the FID, Send the field label and the SDK is reverse mapping the FID based on this field name. 

    That needs to be fixed in the SDK. Presently the SDK is getting all the field names and its FIDs for every API Call and then to parse your data parameter, it reverse maps the fieldname you send to the FIDs from what it got from the quickbase database. Instead of taking fieldnames from you, it should take the FIDs and simply trust you to know that it is valid. The advantage of this is that a) You need not send field names, which is cumbersome. People change field names all the time. b) The SDK does not need to get all the field names and all the tables names for every single CRUD operation, thereby making it much faster.