Hallo OTRS-Community,

ich verzweifle gerade an der korrekten Powershell-Syntax eines Aufrufes über 
die REST-Schnittstelle zu OTRS.

Folgender Aufruf funktioniert nicht:
$servername="https://service-it.augsburg.de/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket?UserLogin=root@localhost&Password=password";
$content = @'
\"Ticket\":{\"Title\":\"REST Create Test\", \"Type\": \"Unclassified\", 
\"Queue\":\"Servicedesk\",\"State\":\"open\",\"Priority\":\"3 
normal\",\"CustomerUser\":\"customer\"},\"Article\":{\"Subject\":\"Rest Create 
Test\",\"Body\":\"This is only a test\",\"ContentType\":\"text/plain; 
charset=utf8\"
'@
$OTRS= Invoke-WebRequest -Uri $servername -Body @{content=$content} -Method Post
$OTRS.content

Fehlermeldung:
Invoke-WebRequest : Error while decoding request content.
In Zeile:1 Zeichen:7
+ $RT = Invoke-WebRequest -Uri $servername -Body @{content=$content} -M ...
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: 
(System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
    + FullyQualifiedErrorId : 
WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Hat mir jemand ein funktionierendes Beispiel?

Gruß, Thomas
---------------------------------------------------------------------
OTRS mailing list: otrs-de - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/otrs-de
To unsubscribe: http://lists.otrs.org/mailman/listinfo/otrs-de

Reply via email to