首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何使用Laravel 5中的Web Services在Vtiger中提交Leads文档中的文件

如何使用Laravel 5中的Web Services在Vtiger中提交Leads文档中的文件
EN

Stack Overflow用户
提问于 2016-07-19 14:46:11
回答 1查看 555关注 0票数 1

我正在尝试通过Laravel 5中的网络服务在Vtiger中提交/创建新的Leadsdata。为此,我在Laravel中使用了WSClient

我的代码在控制器中是:

代码语言:javascript
运行
复制
$url = http://xxxx.com;
        $config = [
            'auth' => [
                'username' => 'xxxx',
                'accesskey' => 'xxxx'
            ],
            'testing' => []
        ];
        $wsclient = new WSClient($url, $config);
        $create = $wsclient->createObject('Leads', array(
            'firstname' => 'My Firstname',
            'lastname'=>'My Lastname',
            'phone'=>'MyPhone',
            'email'=>'email@email.com',
            'description'=> 'abcdabcd123',
            'assigned_user_id'=>1,
        ));

当我创建Leads时,它工作得很好。但是现在我需要在Leads文档中提交文件,所以我使用了跟随代码而不是Works

代码语言:javascript
运行
复制
$create = $wsclient->createObject('Documents', array(
            'notes_title' => 'Leads Pdf File',
            'file'=>'http://website/pdffile.pdf',
            'assigned_user_id'=>1,
        ));

它可以工作,但不能上传文件

如何在Vtiger中通过Laravel的Web服务通过WSClinet提交Leads文件?

EN

回答 1

Stack Overflow用户

发布于 2016-07-20 21:11:57

您的代码是正确的,但目前Vtiger web服务不提供将文件上传到服务器上的可能性。

如果您的服务器上托管了该文件,则可以将文档创建为:

代码语言:javascript
运行
复制
$create = $wsclient->createObject('Documents', array(
        'notes_title' => 'Leads Pdf File',
        'file'=>'http://website/pdffile.pdf',
        'filelocationtype' => 'External', //This will create a link to your server from the crm
        'assigned_user_id'=>1,
    ));

或者,您可以扩展Vtiger webservices代码,使其可以下载并导入文件。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38451286

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档