[Vtigercrm-developers] Create a Lead in Web service using vtwsclib 1.5
Christophe Humbert
chrissc.humbert at gmail.com
Sun Jun 14 14:30:58 GMT 2015
Hello
I am trying to create a lead using webservice and vtwsclib but I have an
error
INVALID_SESSIONID:Session Identifier provided is Invalid
Please find my code
Hello
Je fais tourner un web service
Resultat:
<?php
$file = realpath('vtwsclib');
include_once $file.'/Vtiger/WSClient.php';
$url = 'https://www.lib-assur.com/vtiger';
$client = new Vtiger_WSClient($url);
$login = $client->doLogin('user', 'key');
if(!$login) echo 'Login Failed';
else {
$module = 'Leads';
$record = $client->doCreate($module, Array('lastname'=>'Test_LS',
'company'=>'Test'));
if($record) {
$recordid = $client->getRecordId($record['id']);
echo $recordid;
}
else {
$wasError= $client->lastError();
if($wasError) {
echo "</br>last error : ".$wasError['code'] . ':' .
$wasError['message'];
}
}
}
?>
Thanks in advance
VTiger 6.2
Christophe Humbert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20150614/3d4a36ab/attachment.html>
More information about the vtigercrm-developers
mailing list