title: Plaid API php cURL not sending post data
body: <p>I am trying to translate the below cURL to php cURL:</p>
  
  <p>$ curl -X POST <a href="https://tartan.plaid.com/exchange_token" rel="nofollow">https://tartan.plaid.com/exchange_token</a> \</p>
  
  <blockquote>
    <p>-d client_id="$plaid_client_id" \
      -d secret="$plaid_secret" \
      -d public_token="$public_token_from_plaid_link_module"</p>
  </blockquote>
  
  <p>using this code: </p>
  
  <pre><code>    $data = array(
          "cliend_id"=&gt;"test_id",
          "secret"=&gt;"test_secret",
          "public_token"=&gt;"test,fidelity,connected");
      $string = http_build_query($data);
  
      echo $string;
  
      //initialize session
      $ch=curl_init("https://tartan.plaid.com/exchange_token");
  
      //set options
      curl_setopt($ch, CURLOPT_POST, true);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $string);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  
      //execute session
      $exchangeToken = curl_exec($ch);
      echo $exchangeToken;
      //close session
      curl_close($ch);
  </code></pre>
  
  <p>and I am getting this response:</p>
  
  <p>cliend_id=test_id&amp;secret=test_secret&amp;public_token=test%2Cfidelity%2Cconnected{ "code": 1100, "message": "client_id missing", "resolve": "Include your Client ID so we know who you are." }</p>
  
  <p>I am not sure what is wrong with my format that is keeping plaid from recognizing the client_id portion of the post.  For further reference, I have more detail below.</p>
  
  <p>The below is taken from the plaid site that can be found by searching "plaid api quickstart":</p>
  
  <hr>
  
  <p>Reference
  /exchange_token Endpoint</p>
  
  <p>The /exchange_token endpoint is available in both the tartan and production environments.
  Method  Endpoint    Required Parameters     Optional Parameters
  POST    /exchange_token     client_id, secret, public_token     account_id</p>
  
  <p>The /exchange_token endpoint has already been integrated into the plaid-node, plaid-go, plaid-ruby, and plaid-python client libraries. Support for plaid-java is coming soon.</p>
  
  <p>If you are working with a library that does not yet support the /exchange_token endpoint you can simply make a standard HTTP request:</p>
  
  <p>$ curl -X POST <a href="https://tartan.plaid.com/exchange_token" rel="nofollow">https://tartan.plaid.com/exchange_token</a> \</p>
  
  <blockquote>
    <p>-d client_id="$plaid_client_id" \
      -d secret="$plaid_secret" \
      -d public_token="$public_token_from_plaid_link_module"</p>
  </blockquote>
  
  <p>For a valid request, the API will return a JSON response similar to:</p>
  
  <p>{
    "access_token": "foobar_plaid_access_token"
  }</p>
  
  <hr>