title: Yobit API POST request (R)
body: <p>I try to request to <a href="https://yobit.net/en/api/" rel="nofollow noreferrer">yobit API</a> wthin R. 
  To get access to some of the methods you need to complete authentication:</p>
  
  <p><strong>Each Trade API request should pass authentication.
  Authentication is fulfilled by sending the following HTTP-titles:</strong></p>
  
  <p><strong>Key - API-key, example: FAF816D16FFDFBD1D46EEF5D5B10D8A2</strong></p>
  
  <p><strong>Sign - digital signature, POST-parameters (?param0=val0 &amp; ...&amp; nonce=1) signed by secret key through HMAC-SHA512</strong></p>
  
  <p><strong>Parameter nonce (1 minimum to 2147483646 maximum) in succeeding request should exceed that in the previous one. To null nonce it is necessary to generate new key.</strong></p>
  
  <p>My code :</p>
  
  <pre><code>nonce=1   
  
  API_KEY = "0B02AD5AF57854184D68D3D1D4D980F9"
  API_SECRET = "89b20f882220b5dc6feeb33253c25ba3"
  Body=paste('method=getInfo&amp;nonce=',nonce, sep="")
  sign = hmac(API_SECRET, Body, algo="sha512")
  title=add_headers('Content-type'='application/x-www-form-urlencoded', Key = API_KEY, Sign = sign)
  rep=POST('https://yobit.net/tapi', body=Body, headers=title,  encode='form')
  nonce=nonce+1
  </code></pre>
  
  <p>Response from server:</p>
  
  <pre><code>"{\"success\":0,\"error\":\"invalid key, sign, method or nonce\"}"
  </code></pre>
  
  <p>Thanks for help!</p>