I am using the API to create a Ticket from my website, and I want to create the ticket as an Agent to notify the customer about his order, so I am using the next Structure :
$ticket = Ticket::make([
"source" => Ticket::SOURCE_OUTBOUND_EMAIL,
"responder_id" => $this->agentApiService->getCurrentAdminAgent()->getId(),
"description" => $messageData['body_text'],
"subject" => __('Order tracking ') . $order->getIncrementId(),
"email" => $order->getCustomerEmail(),
"priority" => Ticket::PRIORITY_LOW,
"status" => Ticket::STATUS_OPEN,
"type" => Ticket::TYPE_ORDER,
"attachments" => $this->_getAttachments(),
"custom_fields" =>[
"cf_orderid" => $orderId,
"cf_category"=> $category,
"cf_storeid" => $storeId,
]
]);
After create the ticket successfully, I found an issue, in The Ticket in Freshdesk appear the Agent that has the API token as the creator of the ticket, but I would like to show the Agent that create the ticket as the creator.
So I’ve tried to add in the responder_id the current Agent, and in this way it creates the tickets and assign the agent to the ticket, but then when I try to reply the first message, passing in user_id the id of current Agent, It’s generating an 403 Error as response.
Somebody could help me with this?