zapier/AirtableR

Name: AirtableR

Owner: Zapier

Description: R wrapper to the Airtable API

Forked from: jsng/AirtableR

Created: 2016-05-20 19:12:23.0

Updated: 2016-05-20 19:12:25.0

Pushed: 2016-06-27 16:07:38.0

Homepage:

Size: 30

Language: R

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

AirtableR

R wrapper to the Airtable API

For more information on the Airtable API see: http://api.airtable.com/

Quick Start
Installation
vtools::install_github("jsng/AirtableR")
brary(AirtableR)
Authentication

Firstly, you should enter your Airtable API key.

rtable <- Airtable(
base = "<YOUR BASE NAME>", # e.g "appZNrwXN7bsOU0ta"
tables = c("archive", "items") # table names

dn't find env var AIRTABLE_KEY. See ?airtable_key for more details.
se enter your KEY and press enter:

You can also set Airtable API Key in .Renviron file.

ABLE_KEY=<YOUR API KEY HERE>
Basic Usage
List all Records
cords <- airtable$archive$list_records()

r(records)

 of 363
List of 3
$ id         : chr "rec0E97Ze9J6iyLBW"
$ fields     :List of 19
 ..$ permalink               : chr "nogarifilm"
 ..$ is_live                 : chr "true"
 ..$ amount                  : int 700000
 ..$ count                   : int 13
 ..$ start_date              : chr "2016-02-02"
Retrieve a Record
cord <- airtable$archive$retrieve_record("rec0E97Ze9J6iyLBW")

r(record)

 of 3
d         : chr "rec0E97Ze9J6iyLBW"
ields     :List of 19
$ permalink               : chr "nogarifilm"
$ is_live                 : chr "true"
$ amount                  : int 700000
$ count                   : int 13
$ start_date              : chr "2016-02-02"
Create a Record
rtable$archive$create_record(fields = list(field_name = "foo"))

onse [https://api.airtable.com/v0/<YOUR BASE NAME>/archive/<RECORD_ID>]
te: 2016-03-13 12:57
atus: 200
ntent-Type: application/json; charset=utf-8
ze: 41 B
Update a Record
suing a PATCH request
rtable$archive$update_record("<RECORD_ID>", fields = list(field_name = "bar"))

onse [https://api.airtable.com/v0/<YOUR BASE NAME>/archive/<RECORD_ID>]
te: 2016-03-13 12:57
atus: 200
ntent-Type: application/json; charset=utf-8
ze: 41 B

suing a PUT request
rtable$archive$update_record("<RECORD_ID>", fields = list(field_name = "foobar"), method = "put")

onse [https://api.airtable.com/v0/<YOUR BASE NAME>/archive/<RECORD_ID>]
te: 2016-03-13 12:57
atus: 200
ntent-Type: application/json; charset=utf-8
ze: 41 B
Delete a Record
rtable$archive$delete_record("<RECORD_ID>")

onse [https://api.airtable.com/v0/<YOUR BASE NAME>/archive/<RECORD_ID>]
te: 2016-03-13 12:57
atus: 200
ntent-Type: application/json; charset=utf-8
ze: 41 B

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.