Php Zammad API:使用标记创建票证
对于那些不想阅读整个问题的人:Php Zammad API:使用标记创建票证,php,api,zammad,Php,Api,Zammad,对于那些不想阅读整个问题的人: 我正在寻找API请求(Zammad)中的索引,以便在创建票证时设置标记 详细信息: 我正在使用PHP向安装了Zammad的服务器发出API请求。下面显示了我通过curl发送的数据: json_encode([ "title" => $title, "group_id" => 2, "priority_id" => 2, "category&quo
我正在寻找API请求(Zammad)中的索引,以便在创建票证时设置标记 详细信息:
我正在使用PHP向安装了Zammad的服务器发出API请求。下面显示了我通过curl发送的数据:
json_encode([
"title" => $title,
"group_id" => 2,
"priority_id" => 2,
"category" => 'Some Category',
"state_id" => 1,
"type" => "Some Type",
"customer" => $userID,
"article" => [
"body" => $htmlBody,
"type" => "note",
"content_type" => "text/html",
],
"tag_list" => [ // <-- The question is about this segment
"The tag i want to add",
],
]);
最后:
...
"tag" => "The tag i want to add",
不用说,我没有成功。有时我会得到一个错误id(我假设它是因为索引不存在[谁会想到?:)]),有时我什么也得不到,Zammad只是创建了没有标签的票证。我说“有时”是什么意思?我指的是我在上面指定的尝试
我也尝试过的:在网上搜索答案。接近我想要的东西是。但是我宁愿用标签创建票证,而不是仅仅为了添加标签而发出另一个请求。我已经查看了代码内部,它是用ruby编写的。索引是“标签”,需要由
,
指定
基本上:
json_encode([
"title" => $title,
"group_id" => 2,
"priority_id" => 2,
"category" => 'Some Category',
"state_id" => 1,
"type" => "Some Type",
"customer" => $userID,
"article" => [
"body" => $htmlBody,
"type" => "note",
"content_type" => "text/html",
],
"tags" => "tag1,tag2,tag3", // or simply "tags" => "tag1"
]);
它可能会在将来帮助某人
json_encode([
"title" => $title,
"group_id" => 2,
"priority_id" => 2,
"category" => 'Some Category',
"state_id" => 1,
"type" => "Some Type",
"customer" => $userID,
"article" => [
"body" => $htmlBody,
"type" => "note",
"content_type" => "text/html",
],
"tags" => "tag1,tag2,tag3", // or simply "tags" => "tag1"
]);