title: How to convert raw request into php post curl request
body: <p>I am trying to use outreach API for my PHP website. On outreach, this is request they mentioned:</p>
  
  <p>POST <a href="https://api.outreach.io/api/v2/prospects" rel="nofollow noreferrer">https://api.outreach.io/api/v2/prospects</a></p>
  
  <p>{
      "data": 
  {
          "attributes": {
              "firstName": "Test_3",
              "lastName": "API"
          },
          "type": "prospect"
      }
  }</p>
  
  <p>In PHP , i converted this to following code but it gives error "Bad Request". Please help me what i am doing wrong, accessToken in below code is having correct value.</p>
  
  <pre><code>$urlCreateAccount = "https://api.outreach.io/api/v2/prospects";
  $attributes = array("firstName"=&gt; "Sally","lastName"=&gt; "Biu");
  $paramsCreateAccount = "type=prospect$attributes=".$attributes;
  $headr[] = "Authorization:bearer $accessToken";
  
  $curl = curl_init($urlCreateAccount);
  curl_setopt($curl, CURLOPT_HTTPHEADER,$headr);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curl, CURLOPT_POST, true);
  curl_setopt($curl, CURLOPT_POSTFIELDS, $paramsCreateAccount);
  
  $jsonResponseCreateAccount = curl_exec($curl);
  
  $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
  curl_close($curl);
  </code></pre>