Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OTRS Webservice curl with REST API empty reply

Tags:

rest

curl

otrs

I have configured the generic ticket connector with the data mapping set to simple/xslt/empty and i get empty response for the curl calls. I could see the request is being received by the server but it is not responding. Can someone help me figuring this out.

My configuration on server side from https://github.com/OTRS/otrs/tree/master/development/webservices

---
Debugger:
  DebugThreshold: debug
  TestMode: '0'
Description: Manage remote tickets
FrameworkVersion: 5.0.20
Provider:
  Operation:
    CreateTicket:
      Description: Create remote tickets
      MappingInbound: {}
      MappingOutbound: {}
      Type: Ticket::TicketCreate
    Get ticket:
      Description: Get ticket
      MappingInbound: {}
      MappingOutbound: {}
      Type: Ticket::TicketGet
    Sessioncreate:
      Description: create remote session
      MappingInbound: {}
      MappingOutbound: {}
      Type: Session::SessionCreate
  Transport:
    Config:
      KeepAlive: ''
      MaxLength: '1000000000'
      RouteOperationMapping:
        CreateTicket:
          RequestMethod:
          - POST
          Route: /Ticket
        Get ticket:
          RequestMethod:
          - GET
          Route: /Ticket/:TicketID
        Sessioncreate:
          RequestMethod:
          - POST
          Route: /Session
    Type: HTTP::REST
RemoteSystem: ''
Requester:
  Transport:
    Type: ''

Curl Call from Remote system as per the documentation:

curl "http://otrs.com/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket/6000?UserLogin=agent&Password=123"

The output of the curlcall:

curl: (52) Empty reply from server

like image 679
coolkrish91 Avatar asked Dec 21 '25 14:12

coolkrish91


1 Answers

I've got the same error and was able to solve it by using following scheme for the URL:

http://otrs.com/otrs/nph-genericinterface.pl/Webservice/[Web Service Name]/[Operation Name]/[Variable]?UserLogin=[Agent Login]&Password=[Agent Password]

The placeholders are taken from the Web Service Configuration in the OTRS settings:

Web Service and Operation Names

And the mapping of the variables can be configured by using the "Configure" button which leads to this form:

Vriable configuration

e.g. if the OTRS URL is localhost, the Web Service name is Foobar, the agent login is agent and his/her password is 123456 a curl request could look like (given that the command TicketGet is configured as shown in the screenshots):

curl "https://localhost/otrs/nph-genericinterface.pl/Webservice/Foobar/TicketGet/10235?UserLogin=agent&Password=123456"
like image 59
Martin M. Avatar answered Dec 23 '25 06:12

Martin M.