Vanilla is a product of Lussumo. More Information: Documentation, Community Support.
//create the xml file to POST
$putString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$putString .= "<task>\n";
$putString .= "<statusid>67329</statusid>\n";
$putString .= "<projectid>920391</projectid>\n";
$putString .= "<moduleid>667821</moduleid>\n";
$putString .= "<title>New Task</title>\n";
$putString .= "<dateopen>2010-05-26</dateopen>\n";
$putString .= "<datedue>2010-05-29</datedue>\n";
$putString .= "<priorityid>46781</priorityid>\n";
$putString .= "<ownerid>97351</ownerid>\n";
$putString .= "<assigneeid>101881, 100283</assigneeid>\n";
$putString .= "<summary>A summary of the task</summary>\n";
$putString .= "</task>\n";
//set api token value to your api token
$apiToken = "";
//intialize and send the curl request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.myintervals.com/task");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, $apiToken. ":");
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml", "Content-type: application/xml"));
//POST
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $putString);
$response = curl_exec($ch);
curl_close($ch);
//output the resulting XML
echo $response;
1 to 1 of 1