Skip to main content
Question

Create a ticket as an Agent from the API


Sebastian Ocampo
Apprentice
Forum|alt.badge.img

We are trying to create ticket as an Agent from the API, we’ve tried different things as using responder_id; or email_config_id, we trying with different source but We can’t get it, 

If somebody get this done, we’ll appreciate any help on this topic. if is not possible because is a limitation of the API. We think this would be a good feature to integrate into the API.

 

Did this topic help you find an answer to your question?

2 replies

aravind.sundararajan
Skilled Expert
Forum|alt.badge.img+12

Hello @Sebastian Ocampo Welcome to the Freshworks Community. Can you please elaborate on the use case here? Are you attempting to generate a ticket on behalf of an agent, with the requester's email address being that of the agent?

Cheers!


Sebastian Ocampo
Apprentice
Forum|alt.badge.img

I am using the API to create a Ticket from my website, and I create the ticket as an Agent to notify a 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 sucessfully I found the issue and is 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;

I hope is more clear now.

 


Reply