title: {“message”:“invalid signature”} Coinbase Pro API
body: <p>I've been tearing my hair out for a while now. What I have so far is cribbed from the Coinbase Pro API documentation.</p>
  <p>The Coinbase Pro API requires four different headers, one of them being a signature that's encrypted. I'm having issues forming a valid signature. According to the Coinbase Pro API Documentation:</p>
  <pre><code>&lt;?php
  // Your code here!
  
  $request_path = &quot;/accounts&quot;;
  
  $secret = &quot;ZSTJxPU6g9+QLITr5U4IeKWiaoCMqs9TFnCEavdvIjQOO/TqS4ZuRirtKLKUI4UBAen0TyBEsyDmzOZQQ6SC1w==&quot;;
  
  $ch = curl_init(&quot;https://api.pro.coinbase.com/time&quot;);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, &quot;GET&quot;);
    curl_setopt($ch,CURLOPT_USERAGENT,'CoinbaseProAPI');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $result = json_decode(curl_exec($ch));
    curl_close($ch);
    
    
    
    $timestamp = $result-&gt;epoch;
    $timestamp_rounded = intval(ceil($timestamp));
  
  $what = $timestamp_rounded.'GET'.$request_path;
  
  $sig =  base64_encode(hash_hmac(&quot;sha256&quot;, $what, base64_decode($secret), true));
  
  $ch = curl_init(&quot;https://api.pro.coinbase.com&quot;.$request_path) ;
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ;
      curl_setopt($ch,CURLOPT_USERAGENT,'CoinbaseProAPI');
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, &quot;GET&quot;);
      curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      'CB-ACCESS-KEY: 513194d14d510c48fd3ba86edef54969',
      'CB-ACCESS-SIGN: '.$sig,
      'CB-ACCESS-PASSPHRASE: bbujnpclpsv',
      'CB-ACCESS-TIMESTAMP: '.$timestamp,
      'Content-Type: application/json'));
      $coinbasepro_response = curl_exec($ch) ;
      curl_close($ch) ;
  
  echo $coinbasepro_response;
  ?&gt;
  </code></pre>
  <p>The response I'm getting is an invalid signature. I'm stumped, and any help is appreciated.</p>