$url, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 0, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $xmlContent, CURLOPT_HTTPHEADER => array( 'Content-Type: application/xml', 'Authorization: Bearer '.$token ), )); $response = curl_exec($curl); if (curl_errno($curl)) { echo 'Curl error: ' . curl_error($curl); } curl_close($curl); print_r($response); $xml = new SimpleXMLElement($response); $array = (array)$xml; print_r($array);