Community
Showing results for 
Search instead for 
Do you mean 
Reply

Adding An Activity in ACT WITH API

New Member
Posts: 1
Country: France

Adding An Activity in ACT WITH API

[ Edited ]

hello , 

i tried to Add an activity using the act  web api .with this script :

$token=get_barrer($auth);
function get_barrer($auth)
{

 
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "http://192.168.1.105/act.web.api/authorize");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");


$headers = array();
$headers[] = "Authorization: Basic ".$auth;
$headers[] = "Act-Database-Name: WBCC_BTP";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
return $result;
}

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'http://192.168.1.105/act.web.api/api/organizers/'.$id_respensable.'/Activities');

curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);

$headers = array(
'Authorization: Bearer ' . $token,
'Content-type: application/json'
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

 

$addActivity = array(

"startTime" => $START,
"endTime" => $END,
"location" => $adresse,
"isTimeless" => false,
"isPrivate" => false,
"activityPriorityName" =>$activityPriorityName ,
"activityTypeName" => "Rendez-vous",
"details" => $details,
"subject" => $subject,

"contacts" => array(
      $contact_client
)

);

 

$json = json_encode($addActivity);

curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
$ret = curl_exec($ch);
var_dump($ret);

 my problem is when add an activity that start AT 17:00 act is displayed in the activity a shift of one hour ( display 18:00 )  Capture.PNG (5 KB) 

in THS SQL DATABASE I FOUND THE GOOD  TIMEDATE added By the API .

THIS MY START VALUE STRING =

$START="2018-03-23T15:30:00.000+00:00"

 

any help please ?

Employee
Posts: 92
Country: USA

Re: Adding An Activity in ACT WITH API

Thank you for reporting this, I will have the team take a look at the response you received back from the API that was an hour later. I'll post back once we are done troubleshooting this use case. 

 

Thank you again for reporting this!

 

Regards,

Jeff Hanrahan