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')¶ 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 aResponse
object for the HTTP response.Note
Pagination is not handled in any of these methods (yet).
- Variables
table – The underlying
QuickBaseTable
api – The wrapped
QuickBaseApiClient
-
__init__
(table: Type[quickbase_client.orm.table.QuickBaseTable], user_token, agent='python')¶ 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.
-
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 per https://developer.quickbase.com/operation/upsert.
- Parameters
recs – A list of items that are either the raw record data to post, or the
QuickBaseTable
object/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 per https://developer.quickbase.com/operation/getApp
-
get_field
(field: Union[quickbase_client.orm.field.QuickBaseField, int])¶ Get fields for a table per https://developer.quickbase.com/operation/getField
- Parameters
field – either the field ID or a
QuickBaseField
-
get_fields_for_table
()¶ Get fields for a table per https://developer.quickbase.com/operation/getFields
-
get_report
(report)¶ Get report per https://developer.quickbase.com/operation/getReport.
- Parameters
report – Either the report name to lookup, the report id, or a
QuickBaseReport
object.
-
get_reports_for_table
()¶ Get reports for a table per https://developer.quickbase.com/operation/getTableReports
-
get_table
()¶ Get a table per https://developer.quickbase.com/operation/getTable
-
get_tables_for_app
()¶ Get an tables for an app per https://developer.quickbase.com/operation/getAppTables
-
query
(query_obj: quickbase_client.query.query_base.QuickBaseQuery = None, raw=False)¶ Do a query per https://developer.quickbase.com/operation/runQuery.
See
query
for more.- Parameters
query_obj – The
QuickBaseQuery
object to use.raw – If true, returns a requests.Response, else the data is serialized to a table object.
-
run_report
(report, skip=None, top=None)¶ Run report per https://developer.quickbase.com/operation/runReport.
- Parameters
report – Either the report name to lookup, the report id, or a
QuickBaseReport
object.
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.
-