Clients¶
There are two primary “clients”.
There is the high-level QuickBaseTableClient which wraps the lower-level
QuickBaseApiClient.
QuickBaseTableClient¶
-
class
quickbase_client.QuickBaseTableClient(table: Type[quickbase_client.orm.table.QuickBaseTable], user_token, agent='python', normalize_unicode=True)¶ Class for making API calls relative to a specific QuickBase table.
This includes making calls for the app in general.
All calls (except
query()) return aResponseobject for the HTTP response.Note
Pagination is not handled in any of these methods (yet).
- Variables
table – The underlying
QuickBaseTableapi – The wrapped
QuickBaseApiClient
-
__init__(table: Type[quickbase_client.orm.table.QuickBaseTable], user_token, agent='python', normalize_unicode=True)¶ Create a client instance.
- Parameters
table – The table this client is metaphorically “connected” to.
user_token – The user token to authenticate.
agent – The agent header to send in requests.
normalize_unicode – Whether the JSON Serializer should normalize accented characters.
-
add_record(rec, *args, **kwargs)¶ Aliased to
add_records()making rec a list.
-
add_records(recs: List[Union[quickbase_client.orm.table.QuickBaseTable, Any]], merge_field_id=None, fields_to_return=None)¶ Add record.
https://developer.quickbase.com/operation/upsert
- Parameters
recs – A list of items that are either the raw record data to post, or the
QuickBaseTableobject/record.merge_field_id – The list of fields to merge on.
fields_to_return – The list of field ID’s to return (default None which means all).
-
get_app()¶ Get an app.
-
get_field(field: Union[quickbase_client.orm.field.QuickBaseField, int])¶ Get fields for a table.
https://developer.quickbase.com/operation/getField
- Parameters
field – either the field ID or a
QuickBaseField
-
get_fields_for_table()¶ Get fields for a table.
-
get_report(report)¶ Get report.
https://developer.quickbase.com/operation/getRepor
- Parameters
report – Either the report name to lookup, the report id, or a
QuickBaseReportobject.
-
get_reports_for_table()¶ Get reports for a table.
-
get_table()¶ Get a table.
-
get_tables_for_app()¶ Get an tables for an app.
-
query(query_obj: Optional[quickbase_client.query.query_base.QuickBaseQuery] = None, raw=False, pager: Optional[quickbase_client.client.pager.ResponsePager] = None)¶ Do a query.
https://developer.quickbase.com/operation/runQuery.
See
queryfor more.See
ResponsePagerfor handling pagination.- Parameters
query_obj – The
QuickBaseQueryobject to use.raw – If true, returns a requests.Response, else the data is serialized to a table object.
pager – A
ResponsePagerto handle making paginated requests.
-
run_report(report, skip=None, top=None)¶ Run report.
https://developer.quickbase.com/operation/runReport.
- Parameters
report – Either the report name to lookup, the report id, or a
QuickBaseReportobject.
QuickBaseApiClient¶
-
class
quickbase_client.QuickBaseApiClient(user_token, realm_hostname, agent='python', allow_deletes=False)¶ The lower-level client to make API requests.
Use
request()to make an arbitrary request that forwards tomake_request()-
add_records(table_id, data=None, merge_field_id=None, fields_to_return=None)¶
-
get_app(app_id)¶
-
get_field(field_id, table_id)¶
-
get_fields_for_table(table_id)¶
-
get_report(report_id, table_id)¶
-
get_reports_for_table(table_id)¶
-
get_table(app_id, table_id)¶
-
get_tables_for_app(app_id)¶
-
query(table_id, fields_to_select=None, where_str=None, sort_by=None, group_by=None, options=None)¶
-
request(*args, **kwargs)¶
-
run_report(report_id, table_id, skip=None, top=None)¶
-
RequestFactory¶
-
class
quickbase_client.client.request_factory.QuickBaseRequestFactory(user_token, realm_hostname, agent='python', encoder=None, allow_deletes=False)¶ -
make_request(method, endpoint, additional_headers=None, params=None, data=None)¶ Make a request (synchronously) and return the Response.
- Parameters
method – The (string) HTTP method.
endpoint – The endpoint of the API (starting after “v1/” for example).
additional_headers – A dict of extra headers.
params – Query parameters.
data – The data to send in the body.
-
ResponsePager¶
-
class
quickbase_client.ResponsePager¶ Object to pass to methods (query) to manage pagination.
When calling something like QuickBaseTableClient.query, you can pass a ResponsePager, and repeatedly make requests while
more_remaining()is True.pager = ResponsePager() while pager.more_remaining(): recs = my_client.query(pager=pager)
-
more_remaining() → bool¶ Returns true if there is another request to be made.
-