简体   繁体   English

使用Spring RestTemplate的Vtiger CRM REST API

[英]Vtiger CRM REST API using Spring RestTemplate

I am trying to create a Java wrapper for Vtiger REST API. 我正在尝试为Vtiger REST API创建Java包装器。 I want to avoid the use of vtwsclib library because I could not find its Maven artifact. 我想避免使用vtwsclib库,因为我找不到它的Maven工件。 I want to use Spring RestTemplate . 我想使用Spring RestTemplate Actually, I don't understand why I need some special library to access REST API of a webservice. 实际上,我不明白为什么我需要一些特殊的库来访问Web服务的REST API。

First a got into problem with login process. 首先,登录过程遇到了问题。 Even when I followed the instructions from this link, I was not be able to retrieve sessionName . 即使按照链接的说明进行操作,我也无法检索sessionName Finally, I resolved it after some research of vtwsclib library. 最后,经过对vtwsclib库的研究后,我解决了该问题。

Next problem is with the retrieve operation. 下一个问题是检索操作。 Even when I had sessionName and tried to retrieve some object by id with request (a ticket I can see in client app) 即使当我具有sessionName并尝试通过请求与ID(我可以在客户端应用中看到的票证)通过ID检索某些对象时

GET .../webservice.php?operation=retrieve&sessionName=xxxxx&id=xxxxx 

I got: 我有:

{"success":false,"error":{"code":"ACCESS_DENIED","message":"Permission to perform the operation is denied for id"}} {“成功”:false,“错误”:{“代码”:“ ACCESS_DENIED”,“消息”:“执行操作的权限被拒绝”}}

Last problem is documentation, even when I visited their wiki Vtiger WIKI I could not find attributes of Ticket entity to create fields map. 最后一个问题是文档,即使当我访问他们的维基Vtiger WIKI时,我也无法找到Ticket实体的属性来创建字段映射。

So the work with this API is a bit painful for me. 因此,使用此API会使我有些痛苦。 My questions are: 我的问题是:

  1. Is there some tutorial how to obtain sessionName using only Spring RestTemplate? 有一些教程如何仅使用Spring RestTemplate获得sessionName吗?

  2. Why retrieve operation failed? 为什么检索操作失败? update: bad id format 更新:错误的ID格式

  3. This is the main question. 这是主要问题。 Is there some better documentation (tutorial, blog, file, ect.) for Vtiger REST API and descriptions of objects like Ticket? 是否有一些更好的Vtiger REST API文档(教程,博客,文件等)以及对票据之类的对象的描述?

I am also using Spring RestTemplate for Vtiger rest api. 我还在Vtiger rest api上使用Spring RestTemplate。

For Retrieving details of record using REST API we need to pass id as moduleId x recordID (2x1234) format, otherwise it will give ACCESS_DENIED Error 为了使用REST API检索记录的详细信息,我们需要将id作为moduleId x recordID (2x1234)格式传递,否则将给出ACCESS_DENIED错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM