I am trying to get data from API web server using httr package. For the API URL, it has API key with username & password. Also, URL has multiple parameters to pass. Below is the code & I get this error. Please through some expert advice to get data from API server.
req <- GET("https://ananomyususer.org/api/run-report?api_key=EWRER&report={"reportType":"multipleparameters"));
Error in curl::curl_fetch_memory(url, handle = handle) :
Unable to communicate securely with peer: requested domain name does not match the server's certificate.
This isn't really a reproducible example. And you probably don't want to be sharing your api username and password anyway. I first notice that ananomyususer.org does not seem to be registered to anyone. Did you mask this? Also your api call doesn't include a username, but you suggest it should have one.
Yes, I did mask the website name in the post. Also, This API has authentication with API Key.
I passed the username as variable & tried as below, still got the same error.
repost <- GET(url = paste0(url_ben,'users/',username,'/repost'))
Error in curl::curl_fetch_memory(url, handle = handle) :
Unable to communicate securely with peer: requested domain name does not match the server's certificate.
Thanks for pointing me the post, but it's not relevant to this issue.
I think if you google around, you'll find that this is a common error when trying to communicate with a website whose SSL certificate is not set up properly (the discussion @EconomiCurtis linked is among web site admins talking about how to fix the problem from their end). So it seems most likely that this is something that ideally needs to be solved by the administrators of the site you're trying to connect to.