Title: | Access the Trello API |
---|---|
Description: | An R client for the Trello API. Supports free-tier features such as access to private boards, creating and updating cards and other resources, and downloading data in a structured way. |
Authors: | Jakub Chromec [aut, cre] |
Maintainer: | Jakub Chromec <[email protected]> |
License: | GPL-3 |
Version: | 0.8.0 |
Built: | 2024-10-31 20:26:44 UTC |
Source: | https://github.com/jchrom/trellor |
Add board.
add_board(name, body = NULL, ...)
add_board(name, body = NULL, ...)
name |
Name of the board. |
body |
A named list of query parameters. |
... |
Additional arguments passed to |
Other functions to create resources:
add_card_attachment()
,
add_card()
,
add_checkitem()
,
add_checklist()
,
add_comment()
,
add_label()
,
add_list()
,
add_member()
,
create_resource()
Add card to a list.
add_card(list, body = list(name = "New card"), ...)
add_card(list, body = list(name = "New card"), ...)
list |
List id. |
body |
A named list of query parameters. |
... |
Additional arguments passed to |
Other functions to create resources:
add_board()
,
add_card_attachment()
,
add_checkitem()
,
add_checklist()
,
add_comment()
,
add_label()
,
add_list()
,
add_member()
,
create_resource()
Add attachment to a card.
add_card_attachment( card, file = NULL, url = NULL, cover = FALSE, name = NULL, ... )
add_card_attachment( card, file = NULL, url = NULL, cover = FALSE, name = NULL, ... )
card |
Card id. |
file , url
|
Path to a file to be attached, or a URL. |
cover |
Whether the attached file should be set as cover. |
name |
Name of the attachment, shown inside the card. |
... |
Additional arguments passed to |
Other functions to create resources:
add_board()
,
add_card()
,
add_checkitem()
,
add_checklist()
,
add_comment()
,
add_label()
,
add_list()
,
add_member()
,
create_resource()
Add item to a checklist.
add_checkitem(checklist, name, checked = FALSE, position = "bottom", ...)
add_checkitem(checklist, name, checked = FALSE, position = "bottom", ...)
checklist |
Checklist id. |
name |
Item name (text). |
checked |
Whether item should be checked; defaults to |
position |
Position in the checklist; defaults to |
... |
Additional arguments passed to |
Other functions to create resources:
add_board()
,
add_card_attachment()
,
add_card()
,
add_checklist()
,
add_comment()
,
add_label()
,
add_list()
,
add_member()
,
create_resource()
Add checklist to a card.
add_checklist(card, name, source = NULL, ...)
add_checklist(card, name, source = NULL, ...)
card |
Card id. |
name |
Checklist name. |
source |
Items from this checklist id will be copied to the new one.
Defaults to |
... |
Additional arguments passed to |
Other functions to create resources:
add_board()
,
add_card_attachment()
,
add_card()
,
add_checkitem()
,
add_comment()
,
add_label()
,
add_list()
,
add_member()
,
create_resource()
Add comment to a card.
add_comment(card, text, ...)
add_comment(card, text, ...)
card |
Card id. |
text |
Comment text. |
... |
Additional arguments passed to |
Other functions to create resources:
add_board()
,
add_card_attachment()
,
add_card()
,
add_checkitem()
,
add_checklist()
,
add_label()
,
add_list()
,
add_member()
,
create_resource()
Create a new custom field definition and attach it to the board.
add_field(id, type, name = "New field", body = NULL, ...) add_field_checkbox(id, name = "New checkbox", body = NULL, ...) add_field_date(id, name = "New date", body = NULL, ...) add_field_dropdown(id, name = "New dropdown", body = NULL, ...) add_field_number(id, name = "New number", body = NULL, ...) add_field_text(id, name = "New text", body = NULL, ...)
add_field(id, type, name = "New field", body = NULL, ...) add_field_checkbox(id, name = "New checkbox", body = NULL, ...) add_field_date(id, name = "New date", body = NULL, ...) add_field_dropdown(id, name = "New dropdown", body = NULL, ...) add_field_number(id, name = "New number", body = NULL, ...) add_field_text(id, name = "New text", body = NULL, ...)
id |
Board ID |
type |
Custom field type |
name |
Custom field name |
body |
Named list with additional parameters |
... |
Additional arguments passed to |
For add_field_dropdown
- options can be provided using a single (optionally
named) vector:
body = list(options = c(red = "Alert", green = "Ok", "Nothing"))
Other functions to handle custom fields:
add_field_option()
,
delete_field_option()
,
delete_field()
,
update_card_field()
,
update_field()
Add dropdown (custom field) option.
add_field_option(id, text, color = "none", position = "bottom", ...)
add_field_option(id, text, color = "none", position = "bottom", ...)
id |
Custom field ID (see |
text |
Option text |
color |
Option color |
position |
Option position |
... |
Additional arguments passed to |
Other functions to handle custom fields:
add_field()
,
delete_field_option()
,
delete_field()
,
update_card_field()
,
update_field()
Add label to a card.
add_label(card, color, name = NULL, ...)
add_label(card, color, name = NULL, ...)
card |
Card id. |
color |
Label color. |
name |
Label name; choosing different non-existing name will create new
label. Defaults to |
... |
Additional arguments passed to |
Other functions to create resources:
add_board()
,
add_card_attachment()
,
add_card()
,
add_checkitem()
,
add_checklist()
,
add_comment()
,
add_list()
,
add_member()
,
create_resource()
Add list to a board.
add_list(board, name, position = NULL, ...)
add_list(board, name, position = NULL, ...)
board |
Board id. |
name |
List name. |
position |
List position. One of |
... |
Additional arguments passed to |
Other functions to create resources:
add_board()
,
add_card_attachment()
,
add_card()
,
add_checkitem()
,
add_checklist()
,
add_comment()
,
add_label()
,
add_member()
,
create_resource()
Add member to a card.
add_member(card, member, ...)
add_member(card, member, ...)
card |
Card id. |
member |
Member id. |
... |
Additional arguments passed to |
Other functions to create resources:
add_board()
,
add_card_attachment()
,
add_card()
,
add_checkitem()
,
add_checklist()
,
add_comment()
,
add_label()
,
add_list()
,
create_resource()
Convert hex string into POSIXct
as_POSIXct_hex(x)
as_POSIXct_hex(x)
x |
Vector of strings, each 8 characters long |
Create resources via Trello API.
create_resource( resource, id = NULL, path = NULL, body = list(name = "New"), token = NULL, on.error = c("stop", "warn", "message"), verbose = FALSE, handle = NULL, encode, response )
create_resource( resource, id = NULL, path = NULL, body = list(name = "New"), token = NULL, on.error = c("stop", "warn", "message"), verbose = FALSE, handle = NULL, encode, response )
resource |
Model name, eg. |
id |
Model id. |
path |
Path. |
body |
A named list. |
token |
An object of class
|
on.error |
Behavior when HTTP status >= 300, defaults to |
verbose |
Whether to pass |
handle |
Passed to |
encode , response
|
Deprecated. |
See Trello API reference for more info about what elements can be included in POST request body.
Other functions to create resources:
add_board()
,
add_card_attachment()
,
add_card()
,
add_checkitem()
,
add_checklist()
,
add_comment()
,
add_label()
,
add_list()
,
add_member()
## Not run: # Get token with write access key = Sys.getenv("MY_TRELLO_KEY") secret = Sys.getenv("MY_TRELLO_SECRET") token = get_token("my_app", key = key, secret = secret, scope = c("read", "write")) # Get board ID url = "Your board URL" bid = get_id_board(url, token) # Get lists on that board, extract ID of the first one lid = get_board_lists(bid, token)$id[1] # Content for the new card payload = list( idList = lid, name = "A new card", desc = "#This card has been created by trelloR", pos = "bottom" ) # Create card and store the response (to capture the ID # of the newly created resource) r = create_resource("card", body = payload, token = token) # Get ID of the new card r$id ## End(Not run)
## Not run: # Get token with write access key = Sys.getenv("MY_TRELLO_KEY") secret = Sys.getenv("MY_TRELLO_SECRET") token = get_token("my_app", key = key, secret = secret, scope = c("read", "write")) # Get board ID url = "Your board URL" bid = get_id_board(url, token) # Get lists on that board, extract ID of the first one lid = get_board_lists(bid, token)$id[1] # Content for the new card payload = list( idList = lid, name = "A new card", desc = "#This card has been created by trelloR", pos = "bottom" ) # Create card and store the response (to capture the ID # of the newly created resource) r = create_resource("card", body = payload, token = token) # Get ID of the new card r$id ## End(Not run)
DELETE card.
delete_card(card, ...)
delete_card(card, ...)
card |
Card id |
... |
Additional arguments passed to |
DELETE checklist item.
delete_checkitem(checklist, checkitem, ...)
delete_checkitem(checklist, checkitem, ...)
checklist |
Checklist id |
checkitem |
Checklist item id |
... |
Additional arguments passed to |
DELETE checklist.
delete_checklist(checklist, ...)
delete_checklist(checklist, ...)
checklist |
Checklist id |
... |
Additional arguments passed to |
Delete custom field - this will remove it from all cards on the board.
delete_field(id, ...)
delete_field(id, ...)
id |
Custom field ID (see |
... |
Additional arguments passed to |
Other functions to handle custom fields:
add_field_option()
,
add_field()
,
delete_field_option()
,
update_card_field()
,
update_field()
Delete dropdown (custom field) option - this will remove it from all cards on the board.
delete_field_option(id, option, ...)
delete_field_option(id, option, ...)
id |
Custom field ID (see |
option |
Dropdown option ID |
... |
Additional arguments passed to |
Other functions to handle custom fields:
add_field_option()
,
add_field()
,
delete_field()
,
update_card_field()
,
update_field()
Delete resources via Trello API.
delete_resource( resource, id = NULL, path = NULL, token = NULL, on.error = c("stop", "warn", "message"), verbose = FALSE, handle = NULL, encode, response )
delete_resource( resource, id = NULL, path = NULL, token = NULL, on.error = c("stop", "warn", "message"), verbose = FALSE, handle = NULL, encode, response )
resource , id
|
Resource name (eg. |
path |
Path (optional). |
token |
An object of class
|
on.error |
Behavior when HTTP status >= 300, defaults to |
verbose |
Whether to pass |
handle |
Passed to |
encode , response
|
Deprecated. |
See Trello API reference for more info about DELETE requests.
See response
.
## Not run: # Get token with write access key = Sys.getenv("MY_TRELLO_KEY") secret = Sys.getenv("MY_TRELLO_SECRET") token = get_token("my_app", key = key, secret = secret, scope = c("read", "write")) # Get board ID url = "Your board URL" bid = get_id_board(url, token) # Get cards and extract ID of the first one cid = get_board_cards(bid, token)$id[1] # Delete it delete_resource(resource = "card", id = cid, token = token) ## End(Not run)
## Not run: # Get token with write access key = Sys.getenv("MY_TRELLO_KEY") secret = Sys.getenv("MY_TRELLO_SECRET") token = get_token("my_app", key = key, secret = secret, scope = c("read", "write")) # Get board ID url = "Your board URL" bid = get_id_board(url, token) # Get cards and extract ID of the first one cid = get_board_cards(bid, token)$id[1] # Delete it delete_resource(resource = "card", id = cid, token = token) ## End(Not run)
Use get_resource()
instead of get_model()
or trello_get()
Use update_resource()
instead of put_model()
Use create_resource()
instead of post_model()
Use delete_resource()
instead of delete_model()
Use get_token()
instead of trello_get_token()
Use search_resource()
instead of trello_search()
trello_get(...) get_model(...) post_model(...) put_model(...) delete_model(...) trello_get_token(...) trello_search(...) search_model(...) trello_search_actions(...) trello_search_cards(...) trello_search_boards(...) trello_search_members(...) trello_search_teams(...)
trello_get(...) get_model(...) post_model(...) put_model(...) delete_model(...) trello_get_token(...) trello_search(...) search_model(...) trello_search_actions(...) trello_search_cards(...) trello_search_boards(...) trello_search_members(...) trello_search_teams(...)
... |
See current functions for argument names and defaults. |
Extract resource ID from its URL. If input is not a valid URL, it is returned as is.
extract_id(x)
extract_id(x)
x |
character vector of length 1 |
Perform 1 to 10 GET requests at once.
get_batch( parent, child, ids, token = NULL, query = NULL, on.error = c("stop", "warn", "message"), retry.times = 1, handle = NULL, verbose = FALSE )
get_batch( parent, child, ids, token = NULL, query = NULL, on.error = c("stop", "warn", "message"), retry.times = 1, handle = NULL, verbose = FALSE )
parent |
Parent resource, e.g. |
child |
Child resource, eg. |
ids |
A vector of resource IDs, with maximum length of 10. |
token |
An object of class
|
query |
Named list of key-value pairs, appended to each component
of the batch request. See |
on.error |
Whether to |
retry.times |
How many times to re-try when a request fails. Defaults to 1. |
handle |
The handle to use with this request, see |
verbose |
Set to |
A data frame (or a tibble, if installed).
get_token()
, get_id()
, httr::GET()
, jsonlite::fromJSON()
demo_board <- "https://trello.com/b/wVWPK9I4/r-client-for-the-trello-api" if (FALSE) { # Download custom field values for 10 cards. cards <- get_board_cards(demo_board, limit = 10) values <- get_batch( parent = "card", child = "customFieldItems", ids = cards$id ) values }
demo_board <- "https://trello.com/b/wVWPK9I4/r-client-for-the-trello-api" if (FALSE) { # Download custom field values for 10 cards. cards <- get_board_cards(demo_board, limit = 10) values <- get_batch( parent = "card", child = "customFieldItems", ids = cards$id ) values }
Returns a flat data frame with board-related data.
get_board_actions(id, ...) get_board_cards(id, ...) get_board_checklists(id, ...) get_board_comments(id, ...) get_board_labels(id, ...) get_board_lists(id, ...) get_board_members(id, ...) get_board_fields(id, ...) get_board_prefs(id, ...)
get_board_actions(id, ...) get_board_cards(id, ...) get_board_checklists(id, ...) get_board_comments(id, ...) get_board_labels(id, ...) get_board_lists(id, ...) get_board_members(id, ...) get_board_fields(id, ...) get_board_prefs(id, ...)
id |
Board ID |
... |
Additional arguments passed to |
## Not run: #Get cards with custom fields cards = get_board_cards(board_id, query = list(customFieldItems = "true")) ## End(Not run)
## Not run: #Get cards with custom fields cards = get_board_cards(board_id, query = list(customFieldItems = "true")) ## End(Not run)
Returns a flat data frame with card-related data.
get_card_actions(id, ...) get_card_checklists(id, ...) get_card_comments(id, ...) get_card_labels(id, ...) get_card_members(id, ...) get_card_fields(id, ...) get_card_fields_values(id, ...)
get_card_actions(id, ...) get_card_checklists(id, ...) get_card_comments(id, ...) get_card_labels(id, ...) get_card_members(id, ...) get_card_fields(id, ...) get_card_fields_values(id, ...)
id |
Card ID |
... |
Additional arguments passed to |
Get ID of a resource.
get_id_board(url, token = NULL) get_id_card(url, token = NULL)
get_id_board(url, token = NULL) get_id_card(url, token = NULL)
url |
Complete url, short url or just the url ID part of a Trello board |
token |
Secure token, see |
# Get Trello Development Roadmap board ID url = "https://trello.com/b/nC8QJJoZ/trello-development-roadmap" tdr_id = get_id_board(url) # Also works: url = "nC8QJJoZ" tdr_id = get_id_board(url)
# Get Trello Development Roadmap board ID url = "https://trello.com/b/nC8QJJoZ/trello-development-roadmap" tdr_id = get_id_board(url) # Also works: url = "nC8QJJoZ" tdr_id = get_id_board(url)
Returns a flat data frame with list-related data.
get_list_actions(id, ...) get_list_cards(id, ...) get_list_comments(id, ...)
get_list_actions(id, ...) get_list_cards(id, ...) get_list_comments(id, ...)
id |
Board ID |
... |
Additional arguments passed to |
Returns a flat data frame with member-related data.
get_member_boards(id, ...)
get_member_boards(id, ...)
id |
member ID or username |
... |
Additional arguments passed to |
Returns a flat data frame with member-related data.
get_member_fields( id, fields = c("fullName", "username", "memberType", "bio"), ... )
get_member_fields( id, fields = c("fullName", "username", "memberType", "bio"), ... )
id |
member ID or username |
fields |
by default fetches fullName, username, memberType, bio |
... |
Additional arguments passed to |
Returns a flat data frame, containing the authenticated user's boards.
get_my_boards(...)
get_my_boards(...)
... |
Additional arguments passed to |
Fetch resources using Trello API.
get_resource( parent = NULL, child = NULL, id = NULL, token = NULL, query = NULL, url = NULL, filter = NULL, limit = 100, on.error = c("stop", "warn", "message"), retry.times = 1, handle = NULL, verbose = FALSE, response, paging, bind.rows )
get_resource( parent = NULL, child = NULL, id = NULL, token = NULL, query = NULL, url = NULL, filter = NULL, limit = 100, on.error = c("stop", "warn", "message"), retry.times = 1, handle = NULL, verbose = FALSE, response, paging, bind.rows )
parent |
Parent resource, e.g. |
child |
Child resource, eg. |
id |
Resource ID or |
token |
An object of class
|
query |
Named list of key-value pairs, see |
url |
Url for the GET request. Can be |
filter |
Defaults to |
limit |
Defaults to |
on.error |
Whether to |
retry.times |
How many times to re-try when a request fails. Defaults to 1. |
handle |
The handle to use with this request, see |
verbose |
Set to |
response , paging , bind.rows
|
Deprecated. |
A data frame with API responses.
At maximum, the API can retrieve 1000 results in a single call. Setting
limit > 1000
will activate paging. When paging is used, the request will
be issued repeatedly, retrieving new batch of results each time until
the limit
is reached or there is nothing else to fetch. Results are fetched
chronologically, ie. newest results are retrieved first (eg. newest cards).
Use limit = Inf
to make sure you get all.
If the request fails, server error messages are reprinted on the console.
Depending on the value of on.error
, the request call can throw an error
in R (this is the default), or can issue a warning/message. If the latter,
the function returns a data frame containing the failed URL, HTTP status
and an informative message (produced by the server).
The API returns JSON objects which are parsed using jsonlite::fromJSON()
.
Non-JSON results throw an error, but these should never happen anyway. The
result is always a data frame, or a tibble
if the package is installed.
Both filter
and limit
exist as explicitly defined arguments, but you can
ignore them in favor of supplying their values as query parameters, eg.
query = list(filter = "filter_value", limit = "limit_value")
.
get_token()
, get_id()
, httr::GET()
, jsonlite::fromJSON()
# Public boards can be accessed without authorization, so there is no need # to create a token, just the board id: url = "https://trello.com/b/wVWPK9I4/r-client-for-the-trello-api" bid = get_id_board(url) # Getting resources from the whole board. `filter="all"` fetches archived # cards as well. labels = get_board_labels(bid) cards = get_board_cards(bid, filter = "all") # It is possible to call `get_resource()` directly: lists = get_resource(parent = "board", child = "lists", id = bid) # As with boards, cards can be queried for particular resources, in this case # to obtain custom fields: card = cards$id[5] acts = get_card_fields(card) # Set `limit` to specify the number of results. Pagination will be used # whenever limit exceeds 1000. Use `limit=Inf` to make sure you get all. ## Not run: all_actions = get_board_actions(bid, limit = Inf) ## End(Not run) # For private and team boards, a secure token is required: ## Not run: key = Sys.getenv("MY_TRELLO_KEY") secret = Sys.getenv("MY_TRELLO_SECRET") token = get_token("my_app", key = key, secret = secret, scope = c("read", "write")) # Token is now cached, no need to pass it explicitly. cards_open = get_board_cards(board_id, filter = "open") ## End(Not run)
# Public boards can be accessed without authorization, so there is no need # to create a token, just the board id: url = "https://trello.com/b/wVWPK9I4/r-client-for-the-trello-api" bid = get_id_board(url) # Getting resources from the whole board. `filter="all"` fetches archived # cards as well. labels = get_board_labels(bid) cards = get_board_cards(bid, filter = "all") # It is possible to call `get_resource()` directly: lists = get_resource(parent = "board", child = "lists", id = bid) # As with boards, cards can be queried for particular resources, in this case # to obtain custom fields: card = cards$id[5] acts = get_card_fields(card) # Set `limit` to specify the number of results. Pagination will be used # whenever limit exceeds 1000. Use `limit=Inf` to make sure you get all. ## Not run: all_actions = get_board_actions(bid, limit = Inf) ## End(Not run) # For private and team boards, a secure token is required: ## Not run: key = Sys.getenv("MY_TRELLO_KEY") secret = Sys.getenv("MY_TRELLO_SECRET") token = get_token("my_app", key = key, secret = secret, scope = c("read", "write")) # Token is now cached, no need to pass it explicitly. cards_open = get_board_cards(board_id, filter = "open") ## End(Not run)
Returns a flat data frame with team/organization-related data
get_team_members(id, ...) get_team_boards(id, ...)
get_team_members(id, ...) get_team_boards(id, ...)
id |
team ID, short name or URL |
... |
Additional arguments passed to |
Previously, teams were called "organizations", and the correct parent/child name in API calls remains "organization", "organizations".
Authorize access to Trello API, required for private boards and write access (see details).
get_token( app = NULL, key = NULL, secret = NULL, scope = c("read", "write", "account"), expiration = c("30days", "1day", "1hour", "never"), cache = getOption("httr_oauth_cache"), appname )
get_token( app = NULL, key = NULL, secret = NULL, scope = c("read", "write", "account"), expiration = c("30days", "1day", "1hour", "never"), cache = getOption("httr_oauth_cache"), appname )
app |
A string,
|
key , secret
|
Developer credentials from |
scope |
Can be one or several of |
expiration |
Can be |
cache |
Passed to |
appname |
Deprecated, use |
An object of class "Trello_API_token"
(a Token).
To access private data, a secure token is required. In order to create it,
you will need your developer key
and secret
which you can get by visiting
https://trello.com/app-key
after logging in to Trello. You may also
want to set at least one allowed origin there. If you are using trelloR
locally (ie. from your laptop or PC), http://localhost:1410
is a good value
to use.
Once back in R, run this function the following way:
my_token = get_token("my_app", key = key, secret = secret)
passing the values you have obtained on the developer page. First time you
create a token, you will be prompted to confirm the authorization
in a browser. If you chose to store the token locally as prompted, you won't
have to do this anymore until your token expires (see expiration
) or your
local cache file is deleted.
Tokens are stored inside a hidden .httr-oauth
cache file and automatically
read when any function in the package is called. Optionally, you can specify
a different cache path using the cache
argument, or avoid caching the token
completely with cache = FALSE
. See httr::oauth1.0_token()
for details.
If you opt out of storing the token, then it will only be held until your
R session is over, and you will have to pass it to the token
argument, eg.
get_my_boards(token = my_token)
each time you are fetching data.
Remember to store your credentials in a secure, non-shared location. To
minimize the risk of unwanted disclosure when using remote code
repositories, .httr-oauth
(or whatever cache path you have specified
using the cache
argument) is automatically added to .gitignore
.
httr::oauth_app()
, httr::oauth_endpoint()
,
httr::oauth1.0_token()
# This example assumes you are reading your key and secret from environment # variables. This is not obligatory, but wherever you read them from, make # sure it is a secure, non-shared location. ## Not run: key = Sys.getenv("MY_TRELLO_KEY") secret = Sys.getenv("MY_TRELLO_SECRET") token = get_token("my_app", key = key, secret = secret, scope = c("read", "write")) ## End(Not run)
# This example assumes you are reading your key and secret from environment # variables. This is not obligatory, but wherever you read them from, make # sure it is a secure, non-shared location. ## Not run: key = Sys.getenv("MY_TRELLO_KEY") secret = Sys.getenv("MY_TRELLO_SECRET") token = get_token("my_app", key = key, secret = secret, scope = c("read", "write")) ## End(Not run)
Move card to another list.
move_card(card, list, ...)
move_card(card, list, ...)
card |
Card id. |
list |
List id. |
... |
Additional arguments passed to |
Objects of class "Trello_API_token"
posses some additional attributes to
make it easier to see the app name, its scope and expiration. If you want to
print the bare token object as generated by [httr::oauth1.0_token()]
, call
its own print method, eg: my_token$print()
.
## S3 method for class 'Trello_API_token' print(x, ...)
## S3 method for class 'Trello_API_token' print(x, ...)
x |
An object of class |
... |
Unused. |
Search for resources.
search_resource( string, resource = "all", boards = "mine", partial = FALSE, query = list(), modeltype, ... ) search_cards(string, boards = "mine", partial = FALSE, query = list(), ...) search_actions(string, boards = "mine", partial = FALSE, query = list(), ...) search_boards(string, boards = "mine", partial = FALSE, query = list(), ...) search_members(string, boards = "mine", partial = FALSE, query = list(), ...) search_teams(string, boards = "mine", partial = FALSE, query = list(), ...)
search_resource( string, resource = "all", boards = "mine", partial = FALSE, query = list(), modeltype, ... ) search_cards(string, boards = "mine", partial = FALSE, query = list(), ...) search_actions(string, boards = "mine", partial = FALSE, query = list(), ...) search_boards(string, boards = "mine", partial = FALSE, query = list(), ...) search_members(string, boards = "mine", partial = FALSE, query = list(), ...) search_teams(string, boards = "mine", partial = FALSE, query = list(), ...)
string |
Text to search for. |
resource |
Type of resource to return; typically |
boards |
Boards to limit the search to - defaults to |
partial |
Should partial matching be used? Defaults to |
query |
Name list of additional query parameters; consult search API reference |
modeltype |
Deprecated, use |
... |
Additional arguments passed to |
Search can be narrowed down by resource type and will return a single data
frame per each type (if anything is found). The value of the resource
argument is passed on modelTypes
- see other attributes
at search API reference.
A data frame.
## Not run: search_resource("Anything with this text") search_cards("A card with this text") ## End(Not run)
## Not run: search_resource("Anything with this text") search_cards("A card with this text") ## End(Not run)
Update name, description, assigned members and other fields.
update_card(card, body = NULL, ...)
update_card(card, body = NULL, ...)
card |
Card id |
body |
A named list of query parameters. |
... |
Additional arguments passed to |
Set custom field value on a single card.
update_card_field(card, field, key, value, ...) update_card_checkbox(card, field, value, ...) update_card_date(card, field, value, ...) update_card_dropdown(card, field, value, ...) update_card_number(card, field, value, ...) update_card_text(card, field, value, ...) clear_card_field(card, field, ...)
update_card_field(card, field, key, value, ...) update_card_checkbox(card, field, value, ...) update_card_date(card, field, value, ...) update_card_dropdown(card, field, value, ...) update_card_number(card, field, value, ...) update_card_text(card, field, value, ...) clear_card_field(card, field, ...)
card |
Card ID |
field |
Custom field ID |
key |
Key for the value, e.g. |
value |
New value |
... |
Additional arguments passed to |
update_card_date
requires ISO Formatted Datetime String. "YYYY-MM-DD"
is
fine, but if you want also hour and timezone, use "YYYY-MM-DD hh:mm UTC+X"
,
e.g. "2018-12-24 16:00 UTC+1"
clear_card_field
does not remove the field, but replaces its value with
the equivalent of "No selection"
Other functions to handle custom fields:
add_field_option()
,
add_field()
,
delete_field_option()
,
delete_field()
,
update_field()
Replace currently assigned labels.
update_card_labels(card, labels, ...)
update_card_labels(card, labels, ...)
card |
Card id. |
labels |
A character vector of one or more label id. |
... |
Additional arguments passed to |
Replace currently assigned members.
update_card_members(card, members, ...)
update_card_members(card, members, ...)
card |
Card id. |
members |
A character vector of one or more member id. |
... |
Additional arguments passed to |
Update checklist item state, name, position and which checklist it is in.
update_checkitem(card, checkitem, body = list(state = "complete"), ...)
update_checkitem(card, checkitem, body = list(state = "complete"), ...)
card |
Card id. |
checkitem |
Checklist item id. |
body |
A named list of query parameters. Defaults to
|
... |
Additional arguments passed to |
Update custom field definition.
update_field(id, body = list(name = "New name"), ...)
update_field(id, body = list(name = "New name"), ...)
id |
Board ID |
body |
Named list with additional parameters |
... |
Additional arguments passed to |
Other functions to handle custom fields:
add_field_option()
,
add_field()
,
delete_field_option()
,
delete_field()
,
update_card_field()
Update resources via Trello API.
update_resource( resource, id = NULL, path = NULL, body = NULL, token = NULL, on.error = c("stop", "warn", "message"), verbose = FALSE, handle = NULL, encode, response )
update_resource( resource, id = NULL, path = NULL, body = NULL, token = NULL, on.error = c("stop", "warn", "message"), verbose = FALSE, handle = NULL, encode, response )
resource |
Model name, eg. |
id |
Model id. |
path |
Path. |
body |
A named list. |
token |
An object of class
|
on.error |
Behavior when HTTP status >= 300, defaults to |
verbose |
Whether to pass |
handle |
Passed to |
encode , response
|
Deprecated. |
See Trello API reference for more info about what elements can be included in PUT request body.
## Not run: # Get token with write access key = Sys.getenv("MY_TRELLO_KEY") secret = Sys.getenv("MY_TRELLO_SECRET") token = get_token("my_app", key = key, secret = secret, scope = c("read", "write")) # Get board ID url = "Your board URL" bid = get_id_board(url, token) # Get cards and extract ID of the first one cid = get_board_cards(bid, token)$id[1] # Content for the new card payload = list( id = cid, name = "A new card name", desc = "Description - updated by trelloR", pos = "top" #put card on the top of a list ) # Update card's name, descriptionand position update_resource("card", id = cid, body = payload, token = token) ## End(Not run)
## Not run: # Get token with write access key = Sys.getenv("MY_TRELLO_KEY") secret = Sys.getenv("MY_TRELLO_SECRET") token = get_token("my_app", key = key, secret = secret, scope = c("read", "write")) # Get board ID url = "Your board URL" bid = get_id_board(url, token) # Get cards and extract ID of the first one cid = get_board_cards(bid, token)$id[1] # Content for the new card payload = list( id = cid, name = "A new card name", desc = "Description - updated by trelloR", pos = "top" #put card on the top of a list ) # Update card's name, descriptionand position update_resource("card", id = cid, body = payload, token = token) ## End(Not run)