title: Bitfinex API Post Headers
body: <p>I am having trouble properly setting headers for the Bitfinex API (<a href="https://www.bitfinex.com/pages/api" rel="nofollow">https://www.bitfinex.com/pages/api</a>). I have no trouble with the un-authenticated Get calls but I cannot get my authenticated Post calls working. An example call that I am working with is a Post to "/balances". I am hoping that somebody who uses the API can help me with what I am doing wrong. Here is some sample input and output (fake keys of course) that I am currently generating:</p>
  
  <p>Private Key:</p>
  
  <pre><code> 012345abcdef
  </code></pre>
  
  <p>API Key:</p>
  
  <pre><code> 000111aaafff
  </code></pre>
  
  <p>Payload:</p>
  
  <pre><code> {"request": "/v1/balances","nonce": "1413737362"}
  </code></pre>
  
  <p>Base64 Payload:</p>
  
  <pre><code> e3JlcXVlc3Q6IC92MS9iYWxhbmNlcyxub25jZTogMTQxMzczNzM2Mn0=
  </code></pre>
  
  <p>Using the OpenSSL command: </p>
  
  <pre><code> echo -n 'e3JlcXVlc3Q6IC92MS9iYWxhbmNlcyxub25jZTogMTQxMzczNzM2Mn0=' | openssl dgst -hmac 012345abcdef -sha384 -hex
  </code></pre>
  
  <p>to get a signaure of</p>
  
  <pre><code>b18953370fad9bd5dd482d6ae07aeb96fdebd812e98cbf847f2d923bf66d1579eb31e10e1d79c7ae8405c54e28d0ae2a
  </code></pre>
  
  <p>So I get the Headers:</p>
  
  <pre><code> "X-BFX-APIKEY"    "000111aaafff"
   "X-BFX-PAYLOAD"   "e3JlcXVlc3Q6IC92MS9iYWxhbmNlcyxub25jZTogMTQxMzczNzM2Mn0="
   "X-BFX-SIGNATURE" "b18953370fad9bd5dd482d6ae07aeb96fdebd812e98cbf847f2d923bf66d1579eb31e10e1d79c7ae8405c54e28d0ae2a"
  </code></pre>
  
  <p>I have been trying everything I can think of and the responses I get from the API switch between "Invalid X-BFX-SIGNATURE." and "Invalid json.".</p>
  
  <p>Where is the flaw in my process? I cannot see what I am doing incorrectly.</p>