OTRS REST Java 客户端

OTRS REST Java Client

有人知道一个好的 java OTRS 客户端吗?或者我可以指出一些信息页面来编写我自己的客户端吗?我对 OTRS 完全陌生,但我听说有一个外部接口 (Webservice) 可以与 java REST 客户端一起完成大部分 OTRS 工作。

有人可以 link 一些信息页面吗?也许是一个如何使用 OTRS 创建 REST WS 的示例以及一些如何使用它的 curl 示例?

已找到 links:

  1. https://github.com/gtudan/OTRS-Client --> 维护级别低
  2. https://www.otrs.com/otrs-help-desk-software-unterstuetzt-jetzt-rest/?lang=de
  3. http://otrs.github.io/doc/manual/admin/stable/en/html/genericinterface.htmls
  4. ...

我用这个 yaml 文件创建了一个网络服务:

---
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 服务很重要。我选择'Test'。导入这个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: ''

然后检查 ticketID 为 1 的票证是否存在,并带有一些示例标题,例如 "first Title"。

然后用这个curl:

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 url

".../Webservice/Test/..." 

".../Webservice/Test123xy/..."

现在对我有用了。