title: Bash curl sign hmac
body: <p>I'm trying to use the Bittrex API. The only example provided is the following. I'm not even sure what language this is. I'm trying to replicate this in bash. Full API detail is located here <a href="https://bittrex.com/Home/Api" rel="nofollow noreferrer">https://bittrex.com/Home/Api</a></p>
  
  <pre><code>$apikey='xxx';
  $apisecret='xxx';
  $nonce=time();
  $uri='https://bittrex.com/api/v1.1/market/getopenorders?apikey='.$apikey.'&amp;nonce='.$nonce;
  $sign=hash_hmac('sha512',$uri,$apisecret);
  $ch = curl_init($uri);
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign:'.$sign));
  $execResult = curl_exec($ch);
  $obj = json_decode($execResult);
  </code></pre>
  
  <p>I have tried several things but here is the latest I tried.</p>
  
  <pre><code>#Bash
  apikey="mykey"
  secret="mysecret"
  nonce=`date +%s`
  uri="https://bittrex.com/api/v1.1/market/getopenorders?apikey=$apikey&amp;nonce=$nonce"
  apisig=`echo -n "$uri" | openssl dgst -sha512 -hmac "$secret"`
  
  curl -sG https://bittrex.com/api/v1.1/market/getopenorders?nonce="$nonce"&amp;apikey="$apikey"&amp;apisig="$apisig"
  </code></pre>
  
  <p>I get "{"success":false,"message":"APIKEY_NOT_PROVIDED","result":null}"</p>