Schlagwörter: REST API
-
AutorBeiträge
-
-
8. März 2022 um 11:03 Uhr - Views: 1036 #12768
Hallo Zusammen,
gibt es eine Möglichkeit über die REST-API im Modus “Provider” auch DynamicFields mit TicketGet abzurufen und sogar mit TicketUpdate zu befüllen?
Danke für eine Antwort.
Viele Grüße an das OTOBO Team
-
8. März 2022 um 14:31 Uhr #12769
Ja. Bei TicketGet muss als Parameter DynamicFields mit dem Wert 1 übergeben werden, beim TicketUpdate muss im JSON das ungefähr so aussehen:
{
...
"Ticket": { ... },
"DynamicField" : [
{
"Name" : "NameDesDynamischenFeldes",
"Value" : "Neuer Wert des Feldes"
}
]
} -
9. März 2022 um 17:15 Uhr #12805
Ganz herlichen Dank für die schnelle Antwort.
im OTOBO-System mit der Version 10.0.15 funktioniert das alles super.
Aber die Update Funktion der REST-API im 10.1.1 weigert sich.
Version 10.0.15 gibt mir bei Update>Communication sequence started (09.03.2022 16:43:45 (Europe/Berlin), debug)
$VAR1 = {
‘CONTENT_LENGTH’ => ‘123’,
‘CONTENT_TYPE’ => ‘application/json’,
‘GATEWAY_INTERFACE’ => ‘CGI/1.1’,
‘HOME’ => ‘/opt/otobo’,
‘HOSTNAME’ => ’98d3f999a2c1′,
‘HTTPS’ => ‘OFF’,
‘HTTP_ACCEPT’ => ‘*/*’,
‘HTTP_CONNECTION’ => ‘Keep-Alive’,
‘HTTP_EXPECT’ => ‘100-continue’,
‘HTTP_HOST’ => ‘127.0.0.1’,
‘HTTP_USER_AGENT’ => ‘Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)’,
‘LANG’ => ‘C.UTF-8’,
‘LC_ALL’ => ‘C.UTF-8’,
‘OTOBO_GROUP’ => ‘otobo’,
‘OTOBO_HOME’ => ‘/opt/otobo’,
‘OTOBO_RUNS_UNDER_DOCKER’ => ‘1’,
‘OTOBO_RUNS_UNDER_PSGI’ => ‘1’,
‘OTOBO_SYNC_WITH_S3’ => ‘0’,
‘OTOBO_USER’ => ‘otobo’,
‘PATH’ => ‘/opt/otobo/local/bin:/opt/otobo_install/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin’,
‘PATH_INFO’ => ‘/Webservice/TestREST/UpdateTicket/2’,
‘PERL5LIB’ => ‘/opt/otobo/local/lib/perl5:/opt/otobo_install/local/lib/perl5’,
‘PLACK_ENV’ => ‘deployment’,
‘PWD’ => ‘/opt/otobo’,
‘QUERY_STRING’ => ‘UserLogin=xxxx&Password=yyyyy’,
‘REMOTE_ADDR’ => ‘172.18.0.1’,
‘REMOTE_HOST’ => ‘localhost’,
‘REMOTE_PORT’ => ‘34314’,
‘REQUEST_METHOD’ => ‘PATCH’,
‘REQUEST_URI’ => ‘/otobo/nph-genericinterface.pl/Webservice/TestREST/UpdateTicket/2?UserLogin=xxxxxx&Password=yyyyyyy’,
‘SCRIPT_NAME’ => ‘/otobo/nph-genericinterface.pl’,
‘SERVER_NAME’ => ‘0’,
‘SERVER_PORT’ => ‘5000’,
‘SERVER_PROTOCOL’ => ‘HTTP/1.1’,
‘SERVER_SOFTWARE’ => ‘otobo.psgi’,
‘SHLVL’ => ‘0’
};>Received data by provider from remote system (09.03.2022 16:43:45 (Europe/Berlin), debug)
{“Ticket”:{“Title”:”Test-Test-Test”},”DynamicField”:[{“Name” : “TicketAbrechnungsText”,”Value” : “Neuer Wert des Feldes”}]}>Detected operation ‘UpdateTicket’ (09.03.2022 16:43:45 (Europe/Berlin), debug)
No data provided>Incoming data before mapping (09.03.2022 16:43:45 (Europe/Berlin), debug)
$VAR1 = {
‘DynamicField’ => [
{
‘Name’ => ‘TicketAbrechnungsText’,
‘Value’ => ‘Neuer Wert des Feldes’
}
],
‘Password’ => ‘xxxx’,
‘Ticket’ => {
‘Title’ => ‘Test-Test-Test’
},
‘TicketID’ => ‘2’,
‘UserLogin’ => ‘yyyyy’
};bei 10.1.1 bekomme ich leider
>Communication sequence started (09.03.2022 16:21:05 (Europe/Berlin), debug)
$VAR1 = {
‘GATEWAY_INTERFACE’ => ‘CGI/1.1’,
‘HOME’ => ‘/opt/otobo’,
‘HOSTNAME’ => ‘a1c9d0e889be’,
‘LANG’ => ‘C.UTF-8’,
‘LC_ALL’ => ‘C.UTF-8’,
‘OTOBO_GROUP’ => ‘otobo’,
‘OTOBO_HOME’ => ‘/opt/otobo’,
‘OTOBO_RUNS_UNDER_DOCKER’ => ‘1’,
‘OTOBO_SYNC_WITH_S3’ => ‘0’,
‘OTOBO_USER’ => ‘otobo’,
‘PATH’ => ‘/opt/otobo/local/bin:/opt/otobo_install/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin’,
‘PERL5LIB’ => ‘/opt/otobo/local/lib/perl5:/opt/otobo_install/local/lib/perl5’,
‘PLACK_ENV’ => ‘deployment’,
‘PWD’ => ‘/opt/otobo’,
‘SHLVL’ => ‘0’
};>Detected operation ‘UpdateTicket’ (09.03.2022 16:21:05 (Europe/Berlin), debug)
No data provided>Incoming data before mapping (09.03.2022 16:21:05 (Europe/Berlin), debug)
$VAR1 = {
‘Password’ => ‘xxxx’,
‘RequestMethod’ => ‘PATCH’,
‘TicketID’ => ’55’,
‘UserLogin’ => ‘yyyyy’
};Was mache ich falsch?
Die REST-API ist 1:1 aufgebaut -
11. März 2022 um 14:35 Uhr #12829
Das Verhalten ist schon bekannt und unter nachzulesen.
GenericInterface: PATCH and PUT requests fail
-
-
AutorBeiträge
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.