get_batch: Dispatch a Batch Request

View source: R/get_batch.R

get_batchR Documentation

Dispatch a Batch Request

Description

Perform 1 to 10 GET requests at once.

Usage

get_batch(
  parent,
  child,
  ids,
  token = NULL,
  query = NULL,
  on.error = c("stop", "warn", "message"),
  retry.times = 1,
  handle = NULL,
  verbose = FALSE
)

Arguments

parent

Parent resource, e.g. "board".

child

Child resource, eg. "card".

ids

A vector of resource IDs, with maximum length of 10.

token

An object of class "Trello_API_token", a path or NULL.

  • If a Token, it is passed as is.

  • If NULL and a cache file called ".httr-oauth" exists, the newest token is read from it. If the file is not found, an error is thrown.

  • If a character vector of length 1, it will be used as an alternative path to the cache file.

query

Named list of key-value pairs, appended to each component of the batch request. See httr::GET() for details. NOTE: If you require different query with each batch component, build the list of URLs yourself using get_resource(), as per Trello API reference.

on.error

Whether to "stop", "warn" or "message" on API error.

retry.times

How many times to re-try when a request fails. Defaults to 1.

handle

The handle to use with this request, see httr::RETRY().

verbose

Set to TRUE for verbose output.

Value

A data frame (or a tibble, if installed).

See Also

get_token(), get_id(), httr::GET(), jsonlite::fromJSON()

Examples


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
}

jchrom/trello documentation built on Aug. 30, 2023, 6:56 p.m.