rate_limit: Get the number of requests left

Description Usage Arguments Value Examples

Description

This function displays the information about how many API requests are left and when the rate limit will be reset.

Usage

1
rate_limit(token, show_message = TRUE)

Arguments

token

Fitbit API token generated with get_fitbit_token.

show_message

Boolean scalar; Should the function print the message?

Value

List containing the information about the number of requests left returned invisibly.

Examples

1
2
3
4
5
6
7
## Not run: 
resp <- fitbit_GET("1/user/-/sleep/date/2015-12-12.json", token = fitbit_token )
rate_limit(fitbit_token)
## Requests left:
## 120 / 150 (reset in 22 min, at 18:00:01)

## End(Not run)

Avsecz/fitbitr documentation built on May 5, 2019, 9:22 a.m.