title: How to post a job on LinkedIn using the API in PHP?
body: <p>I want to post a job on LinkedIn using the API in PHP, but when I send the request it throws me a 403 error. The error message is:</p>
  
  <blockquote>
    <p>Write access to job posting denied.</p>
  </blockquote>
  
  <p>What is wrong with my code?</p>
  
  <pre><code>$status_url = 'https://api.linkedin.com/v1/jobs';
  $xml = file_get_contents('http://developer.linkedin.com/sites/default/files/job.xml');
  $request = OAuthRequest::from_consumer_and_token($this-&gt;consumer, $this-&gt;access_token, "POST", $status_url);
  $request-&gt;sign_request($this-&gt;signature_method, $this-&gt;consumer, $this-&gt;access_token);
  $auth_header = $request-&gt;to_header("https://api.linkedin.com");
  $response = $this-&gt;httpRequest($status_url, $auth_header, "POST", $xml);
  
  
  function httpRequest($url, $auth_header, $method, $body = NULL)
  {
      $curl = curl_init();
      curl_setopt($curl, CURLOPT_URL, $url);
      curl_setopt($curl, CURLOPT_HEADER, 0);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($curl, CURLOPT_POST, 1);
      curl_setopt($curl, CURLOPT_POSTFIELDS, $body);
      curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
      curl_setopt($curl, CURLOPT_HTTPHEADER, array($auth_header, "Content-Type: text/xml;charset=utf-8"));
      $data = curl_exec($curl);
      curl_close($curl);
      return $data;
  }
  </code></pre>
  
  <p>Why is it not working?</p>