有人知道OTRS的Java客户端很好吗,或者我可以指向一些信息页面来编写自己的客户端吗?我对OTRS完全陌生,但是我听说有一个外部接口(Web服务)可以与Java REST客户端一起执行大多数OTRS。
有人可以链接一些信息页面吗?也许是一个示例,如何使用OTRS创建带有OTRS的REST WS,以及一些如何使用它的示例?
已找到链接:
https://github.com/gtudan/OTRS-Client->维护级别低
https://www.otrs.com/otrs-help-desk-software-unterstuetzt-jetzt-rest/?lang=de
http://otrs.github.io/doc/manual/admin/stable/en/html/genericinterface.htmls
...
我使用此yaml文件创建了一个Web服务:
---
Debugger:
DebugThreshold: debug
TestMode: '0'
Description: The description of WS
FrameworkVersion: 4.0.5
Provider:
Operation:
TicketGet:
Description: ''
MappingInbound:
Type: Simple
MappingOutbound:
Type: Simple
Type: Ticket::TicketGet
Transport:
Config:
KeepAlive: ''
MaxLength: '20000000'
RouteOperationMapping:
TicketGet:
Route: /Ticket/:TicketID
Type: HTTP::REST
RemoteSystem: ''
Requester:
Transport:
Type: ''
然后,我尝试卷曲到WS:
curl -i -H "Content-Type: application/json" -d {UserLogin:"user",Password="userpass",Ticket={Title="test"}} http://localhost/otrs/nph-genericinterface.pl/Webservice/Test/Ticket/1
但这行不通。
最佳答案
首先,重要的是如何命名Web服务。我选择“测试”。导入此yml或创建自己的WS,导出config yml并将其更改为以下内容。保存更改并重新导入该文件。
---
Debugger:
DebugThreshold: debug
TestMode: '0'
Description: Is used by me
FrameworkVersion: 4.0.5
Provider:
Operation:
TicketGet:
Description: ''
MappingInbound:
Type: Simple
MappingOutbound:
Type: Simple
Type: Ticket::TicketGet
TicketUpdate:
Description: ''
MappingInbound:
Type: Simple
MappingOutbound:
Type: Simple
Type: Ticket::TicketUpdate
Transport:
Config:
KeepAlive: ''
MaxLength: '20000000'
RouteOperationMapping:
TicketGet:
Route: /TicketGet/:TicketID
TicketUpdate:
RequestMethod:
- POST
Route: /TicketUpdate/:TicketID
Type: HTTP::REST
RemoteSystem: ''
Requester:
Transport:
Type: ''
然后检查票证ID为1的票证是否存在带有一些示例标题(例如“ first Title”)的票证。
然后使用此卷曲:
curl -X POST -i -H "content-type: application/json" -d '{"UserLogin": "user", "Ticket": {"Title": "changeme"}, "Password": "userpass"}' "http://localhost/otrs/nph-genericinterface.pl/Webservice/Test/TicketUpdate/1"
如果将WS命名为“ Test123xy”,则重命名curl网址
".../Webservice/Test/..."
至
".../Webservice/Test123xy/..."
现在对我有用。