[Vtigercrm-developers] Create a Lead in Web service using vtwsclib 1.5

Matteo Baranzoni info at greenbitweb.com
Sun Jun 14 15:38:58 GMT 2015


-> $login = $client->doLogin('user', 'key');

I think that here you need to insert vtiger username and accesskey.

2015-06-14 16:30 GMT+02:00 Christophe Humbert <chrissc.humbert at gmail.com>:

> 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
>
>
> _______________________________________________
> http://www.vtiger.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20150614/cb70d1c8/attachment.html>


More information about the vtigercrm-developers mailing list