Advertisement
AmberT

Untitled

Jul 26th, 2024
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. CURL COMMAND
  2. ------------
  3. curl --silent -H "Accept: application/json" "https://[HOST]/otrs/nph-genericinterface.pl/Webservice/ConvCopierReports/TicketSearch?QueueID=25&TicketCreateTimeNewerMinutes=43200&Title=E-mail+Report&[CREDENTIALS]"
  4.  
  5. OUTPUT (expected output of Python script)
  6. -----------------------------------------
  7. {"TicketID"["TicketID1", "TicketID2", ...]}
  8.  
  9.  
  10. PYTHON SNIPPET
  11. --------------
  12. urlForAPI = 'https://[HOST]/otrs/nph-genericinterface.pl/Webservice/ConvCopierReports/TicketSearch?'
  13. headers = {'Accept': 'application/json'}
  14. params = dict(
  15. QueueID=25,
  16. TicketCreateTimeNewerMinutes=42300,
  17. Title=urllib.parse.quote_plus(subject)
  18. )
  19. response = requests.get(url=urlForAPI, params=params, headers=headers, auth=(OTRSLogin, OTRSPassword))
  20. print(response)
  21.  
  22. OUTPUT
  23. ------
  24. []
  25. Advertisement
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement