Description Usage Arguments See Also Examples
API base url and endpoint setup
1 2 3 4 5 6 7 |
x |
A URL |
.data |
Result of a call to |
... |
Comma separated list of unquoted variable names |
.dots |
Used to work around non-standard evaluation |
template |
Template to contstruct API route |
data |
Data to pass to the template parameter |
Other dsl: api_body
,
api_config
,
api_error_handler
, api_query
,
auth
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Not run:
# Set base url
## works with full or partial URLs
api('https://api.github.com/')
api('http://api.gbif.org/v1')
api('api.gbif.org/v1')
## works with ports, full or partial
api('http://localhost:9200')
api('localhost:9200')
api(':9200')
api('9200')
api('9200/stuff')
# set paths
## NSE
api('https://api.github.com/') %>%
api_path(repos, ropensci, rgbif, issues)
## SE
api('https://api.github.com/') %>%
api_path_('repos', 'ropensci', 'rgbif', 'issues')
# template
repo_info <- list(username = 'craigcitro', repo = 'r-travis')
api('https://api.github.com/') %>%
api_template(template = 'repos/{{username}}/{{repo}}/issues', data = repo_info)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.