是否有人知道如何正確格式化vtiger中的更新查詢以更新Lead模塊下的記錄?webservice.php Vtiger更新查詢字符串php curl post
我一直在關注這一點:http://community.vtiger.com/help/vtigercrm/developers/third-party-app-integration.html
,並已能夠登錄,查詢,並接受了這種挑戰的反應,但我一直無法得到更新功能工作,它可能是因爲我不是確定他們希望查詢的外觀。這是我的錯誤,當我發送查詢:
stdClass Object ([success] => [error] => stdClass Object ([code] => ACCESS_DENIED [message] => Permission to perform the operation is denied for id))
電流測試代碼:
function updatesomeone(){
global $createduserleadnum;
global $url;
global $sessionID;
global $createduserid;
$customdata = array(
'firstname'=> 'TestAPILead2',//Update First name
'lastname'=> 'TestAPILeadLast2', //Updated Last name
'leadstatus'=> 'New',
'leadsource'=> 'Some Lead Source', //Not Real Lead source
'assigned_user_id'=> 'User-Assigned', //not real user
'cf_755'=> 'A Custom Field', // A Custom Field
'lead_no' => $createduserleadnum, Acquired from other function/stored value
);
$customdata = json_encode($customdata);
$field = array(
'operation' => 'update',
'sessionName'=> $sessionID,
'element' => $customdata
);
$fields_string;
foreach($field as $key=>$value) { global $fields_string;
$fields_string .= $key.'='.$value.'&'; }
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($field));
curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
$pringjson = json_decode($result);
print_r($pringjson);
}