Title: | Access the 'Quickbase' JSON API |
---|---|
Description: | Programmatically access the 'Quickbase' JSON API <https://developer.quickbase.com>. You supply parameters for an API call, 'qbr' delivers an http request to the API endpoint and returns its response. Outputs follow 'tidyverse' philosophy. |
Authors: | John Erdmann [aut, cre], Keene State College [cph, fnd] |
Maintainer: | John Erdmann <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.3.0.9000 |
Built: | 2025-02-12 06:12:45 UTC |
Source: | https://github.com/bhii-ksc/qbr |
Make a copy of the supplied token and returns its value.
clone_token( subdomain, auth, agent = NULL, clone_name = NULL, clone_desc = NULL )
clone_token( subdomain, auth, agent = NULL, clone_name = NULL, clone_desc = NULL )
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
clone_name |
Optional. Character vector with one element. Name the token clone. |
clone_desc |
Optional. Character vector with one element. Provide a description for the token clone. |
A character vector with one element containing the token clone.
## Not run: x <- clone_token(subdomain = "abc", auth = keyring::key_get("qb_example"), clone_name = "My new token", clone_desc = "This clone was created using R") ## End(Not run)
## Not run: x <- clone_token(subdomain = "abc", auth = keyring::key_get("qb_example"), clone_name = "My new token", clone_desc = "This clone was created using R") ## End(Not run)
Copy an app. Provides options to copy data and users.
copy_app( subdomain, auth, app_id, app_name, app_desc = NULL, agent = NULL, users_and_roles = FALSE, keep_data = FALSE, exclude_files = TRUE, assign_user_token = TRUE )
copy_app( subdomain, auth, app_id, app_name, app_desc = NULL, agent = NULL, users_and_roles = FALSE, keep_data = FALSE, exclude_files = TRUE, assign_user_token = TRUE )
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
app_id |
Character vector with one element. Unique identifier of an app. Found in the URL of the app's homepage after /db/ |
app_name |
Character vector with one element. Name the app's copy. |
app_desc |
Optional. Character vector with one element. Describe the app's copy. |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
users_and_roles |
Logical. If true, users will be copied along with their assigned roles. If false, users and roles will be copied but roles will not be assigned. |
keep_data |
Logical. Whether to copy the app's data along with the schema. |
exclude_files |
Logical. If keep_data is true, whether to copy the file attachments as well. If keep_data is false, this parameter is ignored. |
assign_user_token |
Logical. Whether to add the user token used to make this request to the new app. |
A list.
## Not run: copy_app(subdomain = "abc", auth = keyring::key_get("qb_example"), app_id = "bn9d8f78g", app_name = "Copy of my app", keep_data = TRUE) ## End(Not run)
## Not run: copy_app(subdomain = "abc", auth = keyring::key_get("qb_example"), app_id = "bn9d8f78g", app_name = "Copy of my app", keep_data = TRUE) ## End(Not run)
Make an active user token inactive.
deactivate_token(subdomain, auth, agent = NULL)
deactivate_token(subdomain, auth, agent = NULL)
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
A message confirming deactivation was successful.
## Not run: x <- deactivate_token(subdomain = "abc", auth = keyring::key_get("qb_example")) ## End(Not run)
## Not run: x <- deactivate_token(subdomain = "abc", auth = keyring::key_get("qb_example")) ## End(Not run)
Delete an entire app, including all of the tables and data.
delete_app(subdomain, auth, app_id, app_name, agent = NULL)
delete_app(subdomain, auth, app_id, app_name, agent = NULL)
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
app_id |
Character vector with one element. Unique identifier of an app. Found in the URL of the app's homepage after /db/ |
app_name |
Character vector with one element. The name of the app to be delete. Confirms you want to delete the app. |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
A list.
## Not run: delete_app(subdomain = "abc", auth = keyring::key_get("qb_example"), app_id = "bsf5hphe5", app_name = "R Testing copy") ## End(Not run)
## Not run: delete_app(subdomain = "abc", auth = keyring::key_get("qb_example"), app_id = "bsf5hphe5", app_name = "R Testing copy") ## End(Not run)
Delete a list of one or more fields in a table.
delete_fields(subdomain, auth, table_id, field_ids, agent = NULL)
delete_fields(subdomain, auth, table_id, field_ids, agent = NULL)
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
table_id |
Character vector with one element. Found in the URL of a Quickbase table. |
field_ids |
Character or numeric vector. Field identifier for fields to delete. |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
A tibble with the status of the fields passed to field_ids.
## Not run: delete_fields(subdomain = "abc", auth = keyring::key_get("qb_example"), table_id = "bsf5hphe5", field_ids = c(40:43, 45)) ## End(Not run)
## Not run: delete_fields(subdomain = "abc", auth = keyring::key_get("qb_example"), table_id = "bsf5hphe5", field_ids = c(40:43, 45)) ## End(Not run)
Delete one or more records from a table.
delete_records(subdomain, auth, from, where, agent = NULL)
delete_records(subdomain, auth, from, where, agent = NULL)
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
from |
Character vector. Identifier of the target table. |
where |
Character vector. Condition(s) which target one or more records for deletion. Use the Quickbase query language to construct your condition(s). |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
Named integer vector
## Not run: delete_records(subdomain = "abc", auth = keyring::key_get("qb_example"), from = "bn9d8iesz", where = "{6.EX.'105'}") ## End(Not run)
## Not run: delete_records(subdomain = "abc", auth = keyring::key_get("qb_example"), from = "bn9d8iesz", where = "{6.EX.'105'}") ## End(Not run)
Permanently delete an active user token.
delete_token(subdomain, auth, agent = NULL)
delete_token(subdomain, auth, agent = NULL)
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
A message confirming deactivation was successful.
## Not run: x <- delete_token(subdomain = "abc", auth = keyring::key_get("qb_example")) ## End(Not run)
## Not run: x <- delete_token(subdomain = "abc", auth = keyring::key_get("qb_example")) ## End(Not run)
Get metadata for an app.
get_app( subdomain, auth, app_id, agent = NULL, include_sec = T, include_vars = T )
get_app( subdomain, auth, app_id, agent = NULL, include_sec = T, include_vars = T )
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
app_id |
Character vector with one element. Unique identifier of an app. Found in the URL of the app's homepage after /db/ |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
include_sec |
Logical. Includes security properties if true. |
include_vars |
Logical. Includes app variables if true. |
A tibble.
## Not run: get_app(subdomain = "abc", auth = keyring::key_get("qb_example"), app_id = "bsf5hphe5") ## End(Not run)
## Not run: get_app(subdomain = "abc", auth = keyring::key_get("qb_example"), app_id = "bsf5hphe5") ## End(Not run)
Get a tibble of events that can be triggered based on data or user actions in this application, includes: Email notification, Reminders, Subscriptions, QB Actions, Webhooks, record change triggered Automations (does not include scheduled).
get_app_events(subdomain, auth, app_id, agent = NULL)
get_app_events(subdomain, auth, app_id, agent = NULL)
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
app_id |
Character vector with one element. Unique identifier of an app. Found in the URL of the app's homepage after /db/ |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
A tibble.
## Not run: get_app_events(subdomain = "abc", auth = keyring::key_get("qb_example"), app_id = "bn9d8f78g") ## End(Not run)
## Not run: get_app_events(subdomain = "abc", auth = keyring::key_get("qb_example"), app_id = "bn9d8f78g") ## End(Not run)
Get metadata for all fields in a table.
get_fields( subdomain, auth, table_id, agent = NULL, include_props = T, include_perms = F )
get_fields( subdomain, auth, table_id, agent = NULL, include_props = T, include_perms = F )
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
table_id |
Character vector with one element. Found in the URL of a Quickbase table. |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
include_props |
Logical. Includes field properties if true. |
include_perms |
Logical. Includes custom field permissions if true. Only returns data if custom permissions exist for at least 1 field in the table. |
A tibble.
## Not run: get_fields(subdomain = "abc", auth = keyring::key_get("qb_example"), table_id = "bsf5hphe5") ## End(Not run)
## Not run: get_fields(subdomain = "abc", auth = keyring::key_get("qb_example"), table_id = "bsf5hphe5") ## End(Not run)
Get metadata about a report.
get_report(subdomain, auth, table_id, report_id, agent = NULL)
get_report(subdomain, auth, table_id, report_id, agent = NULL)
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
table_id |
Character vector with one element. Found in the URL of a Quickbase table. |
report_id |
Character vector with one element. Found in the 'Reports & Charts' page in Quickbase and in the report URL. |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
A named list.
## Not run: get_report(subdomain = "abc", auth = keyring::key_get("qb_example"), table_id = "bn9d8iesz", report_id = "7") ## End(Not run)
## Not run: get_report(subdomain = "abc", auth = keyring::key_get("qb_example"), table_id = "bn9d8iesz", report_id = "7") ## End(Not run)
get_reports
retrieves metadata for each report in a table.
get_reports(subdomain, auth, table_id, agent = NULL)
get_reports(subdomain, auth, table_id, agent = NULL)
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
table_id |
Character vector with one element. Found in the URL of a Quickbase table. |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
A tibble.
## Not run: get_reports(subdomain = "abc", auth = keyring::key_get("qb_example"), table_id = "bn9d8iesz") ## End(Not run)
## Not run: get_reports(subdomain = "abc", auth = keyring::key_get("qb_example"), table_id = "bn9d8iesz") ## End(Not run)
Get metadata for all tables in an app.
get_tables(subdomain, auth, app_id, agent = NULL)
get_tables(subdomain, auth, app_id, agent = NULL)
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
app_id |
Character vector with one element. Unique identifier of an app. Found in the URL of the app's homepage after /db/ |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
A tibble.
## Not run: get_tables(subdomain = "abc", auth = keyring::key_get("qb_example"), app_id = "bsf5hphe5") ## End(Not run)
## Not run: get_tables(subdomain = "abc", auth = keyring::key_get("qb_example"), app_id = "bsf5hphe5") ## End(Not run)
Get all users in an account. Provides options to limit values to a set of users and/or apps.
get_users( subdomain, auth, agent = NULL, account_id = NULL, user_emails = NULL, app_ids = NULL )
get_users( subdomain, auth, agent = NULL, account_id = NULL, user_emails = NULL, app_ids = NULL )
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
account_id |
Optional. Positive integer. The account ID being used to get users. If no value is specified, the first account associated with the requesting user token is chosen. |
user_emails |
Optional. List of characters. Limit returned users to those specified in this list. |
app_ids |
Optional. List of characters. Limit returned users to those assigned to these app ID's. The provided app ID's should belong to the same account. |
A tibble.
## Not run: get_users(subdomain = "abc", auth = keyring::key_get("qb_example")) ## End(Not run)
## Not run: get_users(subdomain = "abc", auth = keyring::key_get("qb_example")) ## End(Not run)
Run a report and get its data.
qb_run( subdomain, token, table_id, report_id, agent = NULL, skip = 0, top = 0, type_suffix = FALSE, paginate = TRUE )
qb_run( subdomain, token, table_id, report_id, agent = NULL, skip = 0, top = 0, type_suffix = FALSE, paginate = TRUE )
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
token |
Character vector with one element. Created in 'My Preferences' under 'Manage user tokens' link. |
table_id |
Character vector with one element. Found in the URL of a Quickbase table between /db/ and ? |
report_id |
Character vector with one element. Found in the 'Reports & Charts' page in Quickbase and in the report URL. |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
skip |
Optional. Integer. The number of rows to skip from the top of a record set. |
top |
Optional. Integer. The limit on the number of records to pull starting at the top of a record set. |
type_suffix |
Optional. Logical. Set TRUE to append each field label with its Quickbase data type. |
paginate |
Optional. Logical. Set TRUE to recursively call the API until all report pages are collected |
A tibble.
## Not run: # Get all data in a report my_tibble <- qb_run(subdomain = "abc", token = keyring::key_get("qb_example"), table_id = "bn9d8iesz", report_id = "1") # Get rows 3 to 6 from a report my_tibble <- qb_run(subdomain = "abc.quickbase.com", token = keyring::key_get("qb_example"), table_id = "bn9d8iesz", report_id = "1", skip = 2, top = 3) ## End(Not run)
## Not run: # Get all data in a report my_tibble <- qb_run(subdomain = "abc", token = keyring::key_get("qb_example"), table_id = "bn9d8iesz", report_id = "1") # Get rows 3 to 6 from a report my_tibble <- qb_run(subdomain = "abc.quickbase.com", token = keyring::key_get("qb_example"), table_id = "bn9d8iesz", report_id = "1", skip = 2, top = 3) ## End(Not run)
Get tabular data from a Quickbase table using a query.
query_records( subdomain, auth, from, select = as.numeric(), where = NULL, group_by = NULL, sort_by = NULL, agent = NULL, skip = 0, top = 0, local_time = FALSE, type_suffix = FALSE )
query_records( subdomain, auth, from, select = as.numeric(), where = NULL, group_by = NULL, sort_by = NULL, agent = NULL, skip = 0, top = 0, local_time = FALSE, type_suffix = FALSE )
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
from |
Character vector with one element. Table identifier. |
select |
Optional. Numeric vector containing field identifiers for columns to return. If omitted, the default columns for the table will be returned. |
where |
Optional. Character vector with one element. Use the Quickbase query language to set criteria for records to returned. |
group_by |
Optional. Nested named list with 'fieldId' and 'grouping' pairs for each field to group by. |
sort_by |
Optional. Nested named list with 'fieldId' and sort 'order' pairs for each field to sort by. See Quickbase JSON API documentation for details on sort order configuration. |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
skip |
Optional. Integer. The number of rows to skip from the top of a record set. |
top |
Optional. Integer. The limit on the number of records to pull starting at the top of a record set. |
local_time |
Logical. When true, date time fields are returned using app's local time. When false, date time fields are returned using UTC time. |
type_suffix |
Optional. Logical. Set TRUE to append each field label with its Quickbase data type. |
A tibble.
## Not run: # Get all data matching query specification my_tibble <- query_records(subdomain = "abc", auth = keyring::key_get("qb_example"), from = "bn9d8iesz", select = c(3, 6:9), where = "{8.EX.'6-month'}") # Query data, group, then sort it my_tibble <- query_records(subdomain = "bhi", auth = keyring::key_get("qb_example"), from = "bn9d8iesz", select = c(3, 8:12), sort_by = list(list(fieldId = 12, order = "ASC"), list(fieldId = 3, order = "DESC")), group_by = list(list(fieldId = 4, grouping = "equal-values"), list(fieldId = 9, grouping = "equal-values"))) ## End(Not run)
## Not run: # Get all data matching query specification my_tibble <- query_records(subdomain = "abc", auth = keyring::key_get("qb_example"), from = "bn9d8iesz", select = c(3, 6:9), where = "{8.EX.'6-month'}") # Query data, group, then sort it my_tibble <- query_records(subdomain = "bhi", auth = keyring::key_get("qb_example"), from = "bn9d8iesz", select = c(3, 8:12), sort_by = list(list(fieldId = 12, order = "ASC"), list(fieldId = 3, order = "DESC")), group_by = list(list(fieldId = 4, grouping = "equal-values"), list(fieldId = 9, grouping = "equal-values"))) ## End(Not run)
Run a report and get its data.
run_report( subdomain, auth, table_id, report_id, agent = NULL, skip = 0, top = 0, type_suffix = FALSE, paginate = TRUE )
run_report( subdomain, auth, table_id, report_id, agent = NULL, skip = 0, top = 0, type_suffix = FALSE, paginate = TRUE )
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
table_id |
Character vector with one element. Found in the URL of a Quickbase table. |
report_id |
Character vector with one element. Found in the 'Reports & Charts' page in Quickbase and in the report URL. |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
skip |
Optional. Integer. The number of rows to skip from the top of a record set. |
top |
Optional. Integer. The limit on the number of records to pull starting at the top of a record set. |
type_suffix |
Optional. Logical. Set TRUE to append each field label with its Quickbase data type. |
paginate |
Optional. Logical. Set TRUE to recursively call the API until all report pages are collected. |
A tibble.
## Not run: # Get all data in a report my_tibble <- run_report(subdomain = "abc", auth = keyring::key_get("qb_example"), table_id = "bn9d8iesz", report_id = "1") # Get rows 3 to 6 from a report my_tibble <- run_report(subdomain = "abc.quickbase.com", auth = keyring::key_get("qb_example"), table_id = "bn9d8iesz", report_id = "1", skip = 2, top = 3) ## End(Not run)
## Not run: # Get all data in a report my_tibble <- run_report(subdomain = "abc", auth = keyring::key_get("qb_example"), table_id = "bn9d8iesz", report_id = "1") # Get rows 3 to 6 from a report my_tibble <- run_report(subdomain = "abc.quickbase.com", auth = keyring::key_get("qb_example"), table_id = "bn9d8iesz", report_id = "1", skip = 2, top = 3) ## End(Not run)
Get metadata for an app, its tables, and its fields.
summarize_app(subdomain, auth, app_id, agent = NULL)
summarize_app(subdomain, auth, app_id, agent = NULL)
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
app_id |
Character vector with one element. Unique identifier of an app. Found in the URL of the app's homepage after /db/ |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
A list of tibbles.
## Not run: summarize_app(subdomain = "abc", auth = keyring::key_get("qb_example"), app_id = "bsf5hphe5") ## End(Not run)
## Not run: summarize_app(subdomain = "abc", auth = keyring::key_get("qb_example"), app_id = "bsf5hphe5") ## End(Not run)
Insert and/or update record(s) in a table. Update can use the key field on the table, or any other supported unique field. Refer to the Field types page for more information about how each field type should be formatted. This operation allows for incremental processing of successful records, even when some of the records fail. This endpoint supports a maximum payload size of 10MB.
update_records( subdomain, auth, to, records, mergeFieldId = 3, fieldsToReturn = list(3), agent = NULL )
update_records( subdomain, auth, to, records, mergeFieldId = 3, fieldsToReturn = list(3), agent = NULL )
subdomain |
Character vector with one element. Found at the beginning of the Quickbase URL. Realm specific. |
auth |
Character vector with one element. The Quickbase authentication scheme you are using to authenticate the request (e.g., user token). |
to |
Character vector. Identifier of the target table. |
records |
Tibble containing the data you want to insert/update in the target table, where column names correspond to field identifiers. Alternatively, a list containing record data as json if your data contain User or List-user data types. |
mergeFieldId |
Character vector. Field identifier of the key field or unique field to merge upon. Defaults to 3, representing Record ID#. |
fieldsToReturn |
Character vector of field identifiers. Returns data for field 3 (Record ID#) in addition to any field identifiers supplied. |
agent |
Optional. Character vector with one element. Describes user/agent making API call. |
List of JSON containing return data requested via the fieldsToReturn argument and metadata regarding created/updated records, referenced but unchanged records, and records having any errors while being processed.
## Not run: new_data <- dplyr::tibble(`3` = c(5, 7), `6` = c("A", "B")) update_records(subdomain = "bhi", auth = keyring::key_get("qb_example"), to = "bn9d8iesz", records = new_data) ## End(Not run)
## Not run: new_data <- dplyr::tibble(`3` = c(5, 7), `6` = c("A", "B")) update_records(subdomain = "bhi", auth = keyring::key_get("qb_example"), to = "bn9d8iesz", records = new_data) ## End(Not run)