Skip to contents

A DELETE request is used to remove a record from the database. This function will remove a single record from the database using the record's ID.

Usage

api_delete(
  api_name,
  endpoint,
  id,
  dry_run = FALSE,
  verbosity = 0,
  timeout = 300
)

Arguments

api_name

the name of the API to call

endpoint

the API endpoint to make the request to

id

The ID of the record to delete.

dry_run

if TRUE, the call is printed to the console instead of being sent to the API, which is useful for debugging

verbosity

How much information to print to the console. Defaults to 0.

  • 0: no output

  • 1: show headers

  • 2: show headers and body

  • 3: show headers, body, and curl status messages

timeout

request timeout in seconds (default is 300)

Value

A list parsed from the JSON response body.

See also

api_get() to retrieve data, api_post() to create records, api_patch() to update records

Examples

if (FALSE) { # \dontrun{
api_delete("counts", "projects/age-classes", id = 42)
} # }