Infos:
- Used Zammad version: 3.6.x
- Used Zammad installation source: Package
- Operating system: Windows 10 (Client) / Debian 10.8 (Server)
- Browser + version: Microsoft Edge (latest)
Expected behavior:
API should create article for a given ticket.
Actual behavior:
- I get a “not authorized” error when creating a article in a existing ticket for a customer with “setOnBehalfOfUser”.
Steps to reproduce the behavior:
- Create Ticket
Try to create a article in the ticket for a customer via a access token of an admin an “setOnBehalfOfUser”.
When i remove the “setOnBehalfOfUser” i can create an article in the ticket, but then it will be created as agent answer.
Code:
$this->client->setOnBehalfOfUser($userId);
$article = $this->client->resource(ResourceType::TICKET_ARTICLE);
$article->setValues([
“ticket_id” => $ticketId,
“body” => $request->input(“message”),
“type” => “web”,
]);
$article->save();