&lt?php
	// the xml data to send
	$chaineXML = '<?xml version="1.0" encoding="UTF-8"?><agendize><account><campaign><name>Campagne0</name><color>#EC50FF</color><description>This is a campaign uploaded by php</description></campaign></account></agendize>';
	// Encode the parameters in order to build a suitable query
	$query_string = 'key=' . urlencode('3ac024abf8c72460764b965199f81808f4cb08') . '&xml=' . urlencode($chaineXML);		  
	
	// Set the authentication and the http request in POST method
	$context = stream_context_create(array( 
		'http' => array( 
		  'method'  => 'POST', 
		  'header'  => sprintf("Authorization: Basic %s\r\n", base64_encode('myusername:mypassword')). 
					   "Content-type: application/x-www-form-urlencoded\r\n", 
		  'content' => $query_string,
		  'timeout' => 5, 
		), 
	  )); 
	  
	// Make the connection
	$xmlResult = file_get_contents('http://www.agendize.com/api/1.0/data', false, $context);
	// Retrieve AgendiZe response code obtained by searching in the parsed xml content
	$dom = new DomDocument();
	$dom->loadXML($xmlResult);
	$result = $dom->getElementsByTagName('result')->item(0);
	echo $result->nodeValue;
?>