R API to retrieve data from Bluefolder

Hi to all my r programmers,

I don't know if this is possible but I was trying to use API to connect to a website. There's documentation on the site but the examples are in curl, c#, and php. I'm not sure what steps to do. I assume I can use the "httr" package but I'm not even sure. I was given a token but will use an example in my code.

Documentation:
https://support.bluefolder.com/hc/en-us/sections/200381849-API-2-0

How to Access Any RESTful API Using the R Language:
https://www.programmableweb.com/news/how-to-access-any-restful-api-using-r-language/how-to/2017/07/21

Example Code to retrieve list of all customers:

require("httr")
require("jsonlite")

username <- "Example12345"
password <- "X"

r <- GET("https://app.bluefolder.com/api/2.0/customers/list.aspx", authenticate(username, password, type = "basic"))


txt_poke <- content(r, "text", encoding = "ISO-8859-1")
json_poke <- fromJSON(txt_poke, flatten=TRUE)

I don't think I'm even connecting right. I keep getting the message:

<response status="fail">
  <error code="error_code">
    error_message
  </error>
</response>

or

Error: lexical error: invalid char in json text.
                                       <response status='fail'>       
                     (right here) ------^

Httr Package:
https://cran.r-project.org/web/packages/httr/vignettes/quickstart.html

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.