create_api_package: Create API package

Description Usage Arguments Details Value Examples

View source: R/build.R

Description

Create API package

Usage

1
create_api_package(path, site, base_url, ...)

Arguments

path

A path. If it exists, it is used. If it does not exist, it is created, provided that the parent path exists.

site

Name of the site/app/platform. This is how it will be referenced in function documentation.

base_url

Base URL to the site/app/platform of interest.

...

Other arguments passed on to create_package.

Details

In addition to create_package defaults, this function provides useful starter functions for creating an R client for interacting with a web API. The functions are saved in two files in the path's R directory. api.R contains functions for sending/receiving HTTP requests. utils.R contains functions for setting environment variables and parsing response objects.

Value

Creates or uses existing directory and builds the basic infastructure for an API client R package.

Examples

1
2
3
4
5
6
## Not run: 
## create API client package for Instagram API
create_api_package("example/useapitest",
  "Use API Test Site", "https://api.useapitest.com/v1")

## End(Not run)

mkearney/useapi documentation built on May 22, 2019, 3:51 p.m.