title: How to authenticate to Icobench.com API with 2 keys in R
body: <p>I just received a public and private key to connect to ICObench api. I'm quite used to use R, but I admit i found no accurate info on how to authenticate to an API that asks for a public an private key. </p>
  
  <p><a href="https://icobench.com/developers#manage_api_access" rel="nofollow noreferrer">Here is their api page</a> telling how to authenticate (though not with R). </p>
  
  <p>I tried the following code (using httr package), which i found on this <a href="https://stackoverflow.com/questions/23286900/rcurl-basic-authentication-with-api-key">stackoverflow post</a> :</p>
  
  <pre><code>req &lt;- GET("https://icobench.com/api/v1/icos/ratings",
             authenticate("user@gmail.com" , "password"),
             add_headers(privateKey = privatekey ),
             add_headers(publicKey = publickey))
  stop_for_status(req)
  content(req
  </code></pre>
  
  <p>)</p>
  
  <p>But this code does not seem to work with 2 keys/2 headers. I get the following error message : </p>
  
  <pre><code>"Not provided or missing X-ICObench-Key"
  </code></pre>
  
  <p>Any idea how to authenticate properly to this API ? There's some nice tutorials for the rest :) </p>
  
  <p>Thanks for your help </p>