gpt4 book ai didi

php - 使用 soap api 显示所有 otrs 票

转载 作者:搜寻专家 更新时间:2023-10-31 21:02:58 26 4
gpt4 key购买 nike

我如何使用 soap api 显示所有 otrs 门票。可以通过在 url 中传递票证 ID 来显示个人票证,如下所示:

$url = "https://url/otrs/rpc.pl"; //// URL for OTRS server
$username = "username"; //// SOAP username set in sysconfig
$password = "password"; //// SOAP password set in sysconfig
$TicketID = $_GET['id'];
//////// Initialize new client session ////////
$client = new SoapClient(
null,
array(
'location' => $url,
'uri' => "Core",
'trace' => 1,
'login' => $username,
'password' => $password,
'style' => SOAP_RPC,
'use' => SOAP_ENCODED
)
);
//////// Create and send the SOAP Function Call ////////
$sql =
$TicketDetails = $client->__soapCall("Dispatch",
array($username, $password,
"TicketObject", "TicketGet",
"TicketID", $TicketID,
));
$ticketInfo = array();
$i = 0;

foreach ($TicketDetails as $name => $value){ //// explode the xml response
if (false !== strpos($name, "s-gensym")){

$temp[$i] = $value;
$v = $temp[$i - 1];
if($i % 2 != 0){
$ticketInfo[$v] = $value;
}
$i++;
}
}
var_dump($ticketInfo);
exit();

如何使用 api 显示所有门票?????

最佳答案

使用 TicketSearch API call以检索票证 ID 列表。然后将此列表提供给 TicketGet,正如您已经展示的那样,以检索票的详细信息。

关于php - 使用 soap api 显示所有 otrs 票,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38300081/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com