title: Python - OTRS REST/SOAP API - python-otrs
body: <p>Using a rest/soap API like <a href="https://github.com/ewsterrenburg/python-otrs" rel="nofollow noreferrer">python-otrs</a> or pyotrs is possible to close a ticket?</p>
  
  <p>using python-otrs i try and receive a error:</p>
  
  <pre><code>otrs.client.SOAPError: TicketUpdate: Ticket-&gt;StateID or Ticket-&gt;State parameter is invalid! (TicketUpdate.InvalidParameter)
  </code></pre>
  
  <p>The code i try is:</p>
  
  <pre><code>from otrs.ticket.template import GenericTicketConnectorSOAP
  from otrs.client import GenericInterfaceClient
  from otrs.ticket.objects import Ticket, Article, DynamicField, Attachment
  
  server_uri = r'https://www.example.com'
  webservice_name = 'GenericTicketConnectorSOAP'
  client = GenericInterfaceClient(server_uri, tc=GenericTicketConnectorSOAP(webservice_name))
  
  # user session
  client.tc.SessionCreate(user_login='user', password='pass')
  
  t_upd = Ticket(State='closed',StateID='3')
  client.tc.TicketUpdate(3657,ticket=t_upd)
  </code></pre>
  
  <p>where 3657 is the id of the ticket.</p>
  
  <p>Thanks,
  jp</p>