Connect R to Knack API

I found the answer to my own question. Here is the code:

library(httr)
library(jsonlite)

result <- GET("https://api.knack.com/v1/objects/object_xx/records",
    add_headers("X-Knack-Application-Id" = "YOUR-APP-ID",
                "X-Knack-REST-API-Key" = "YOUR-API-KEY"))

data = fromJSON(content(result, as = "text"))