deanslist_api: R API for DeansList's RESTful API

Description Usage Arguments Details Value Examples

Description

R API for DeansList's RESTful API

Usage

1
2
deanslist_api(endpoint, domain, key, endpoint_version = c("v1", "beta"),
  parsed = TRUE, ...)

Arguments

endpoint

the endpoint from which to requrest data.

domain

your DearnsList domain.

key

your school specific API key.

endpoint_version

the endpoint verrsion. Default is "v1". Anything else implements "beta" endpoints, for which you should supply the table name (i.e., supply "behavavior" to hit the get-behavior-data.php endpoint).

...

optional DeansList paramaters added to query string in the GET request (e.g. sdt and edt for start and end dates).

parse

whether the response content should be parsed to a (possibly flattened) data.frame ('TRUE') or the whether the raw JSON us returned ('FALSE').

Details

This is a workhourse function that wraps the HTTP RESTful API that DeansList has implemented. You will need your school's/district's/network's domain (i.e., DOMAIN in https://DOMAIN.deanslistsoftware.com) and each schools API key, which you'll need to request from DeansList.

For requests in the v1 API you give the end of the endpoint name to he deanslist_api(). For example, the /api/v1/suspensions endpoint is accessed with deanslist_api('suspensions', domain = 'dlacademy', key = 'SUPER_SECRET_KEY'). Requests for the beta API simply require the component of the end point that unique identifies (i.e., the table name). So the get-behavior-data.php endpoint is accessed with deanslist_api('behaviors', domain = 'dlacademy', key = 'SUPER_SECRET_KEY', endpoint_version = 'beta').

Value

a deanslistr object, which is a list containing the response, endpoint path, and returned content

Examples

1
2
3
4
5
6
7
8
## Not run: 
dla_key <- Sys.getenv("KEY_DLA") # Get this key from Deanslist

x <- deanslist_api(endpoint = 'suspensions',
                   domain = 'dlacademy',
                   key = dla_key)

## End(Not run)

chrishaid/deanslistr documentation built on May 13, 2019, 6:53 p.m.