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.
How to Access Any RESTful API Using the R Language:
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) ------^