title: cURL NONCE_NOT_PROVIDED
body: <p>I had found these steps for use with a different API. They do not appear to work.</p>
  
  <p>My understanding of nonce is that it is just a random hash you use once. so the creation method should matter little.
  I think my issue is with my cURL formatting.</p>
  
  <p>session:</p>
  
  <pre><code># echo -n "/0" &gt; tmp.bin
  
  # echo -n "123nonce=123" | openssl sha256 -binary &gt;&gt; tmp.bin
  
  # cat tmp.bin | openssl sha512 -binary -hmac $(echo -n "mmyykkeeyy" | base64 -d) | base64 -w long_hash
  
  # curl -X GET -H "Accept: application/json" -H "long_hash" -d "nonce=123" "https://bittrex.com/Api/v2.0/key/market/GetOrderHistory?market=BTC-TRX&amp;apikey=mmyyykkeeyy"
  </code></pre>
  
  <p>return data:</p>
  
  <pre><code>{"success":false,"message":"NONCE_NOT_PROVIDED","result":null}
  </code></pre>
  
  <p>also tried:</p>
  
  <pre><code>echo -n "/0/key" &gt; tmp.bin
  </code></pre>
  
  <p>and I also tried creating nonce without the tmp.bin, outputing it to the buffer and using it raw. same nonce error.</p>
  
  <p>adding</p>
  
  <pre><code>-H "Content-Type: application/json"
  </code></pre>
  
  <p>yields a server 500 error.</p>
  
  <p>known working api v2.0 library, only python and does not suit my needs  <a href="https://github.com/mondeja/bittrex_v2/blob/master/bittrex_v2/bittrex.py" rel="nofollow noreferrer">v2.0 python library</a></p>
  
  <p>How do I correctly deliver the nonce to the bittrex api using cURL?</p>
  
  <p>UPDATE:</p>
  
  <p>I changed the url in the Bittrex python library to webserver not running https and captured the dead outbound packet in the raw (non encapsulated). Now I can at least see what the know good python library is throwing</p>
  
  <p><a href="http://pix.toile-libre.org/upload/original/1524244865.png" rel="nofollow noreferrer">GET packet from known good Python library request in wireshark</a></p>
  
  <pre><code>$ echo -n "/0" &gt; tmp.bin
  
  $ echo -n "123nonce=123" | openssl sha256 -hex
  (stdin)= 353f9df92ab1d5e5afe06bb7d1bb42a8ef6654b633d94818007aeafbaf03ca3d
  
  $ echo 353f9df92ab1d5e5afe06bb7d1bb42a8ef6654b633d94818007aeafbaf03ca3d| openssl sha512 -binary -hmac $(echo -n "mmyykkeeyy" | base64 -d) | base64 -w 0
  
  biglonghash
  
  
  $ curl -X GET -H "Accept: application/json" -H "biglonghash" "https://bittrex.com/Api/v2.0/key/market/GetOrderHistory?apikey=mmyykkeeyy&amp;nonce=353f9df92ab1d5e5afe06bb7d1bb42a8ef6654b633d94818007aeafbaf03ca3d&amp;market=BTC-TRX"
  </code></pre>
  
  <p>response:</p>
  
  <pre><code>{"success":false,"message":"APISIGN_NOT_PROVIDED","result":null}
  </code></pre>
  
  <p>update2:</p>
  
  <pre><code>$ echo -n "/key" &gt; tmp.bin
  
  $ echo -n "123nonce=123" | openssl sha256 -binary &gt;&gt; tmp.bin
  
  $ cat tmp.bin | openssl sha512 -binary -hmac $(echo -n "mmyysseeccrreett" | base64 -d) | base64 -w 0
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>biglonghash
  </code></pre>
  
  <p>session:</p>
  
  <pre><code>$ curl --get -H "Accept: application/json" -H "apisign:biglonghash" "https://bittrex.com/Api/v2.0/key/market/GetOrderHistory?apikey=mmyyaappiikkeeyy&amp;nonce=353f9df92ab1d5e5afe06bb7d1bb42a8ef6654b633d94818007aeafbaf03ca3d&amp;market=BTC-TRX"
  
  {"success":false,"message":"INVALID_SIGNATURE","result":null}
  </code></pre>