In this tutorial, I want to write a Python code for the extraction of a customer tickets list with FreshDesk API.

FreshDesk is a customer support management system that deals with tickets. It also has an API for accessing client requests and data and a good developer document.

It also has a Python library to connect with Freshdesk.

Now I want to get list of tickets of special customer.

python
from freshdesk.api
import API
from dotenv
import load_dotenv
import osload_dotenv()a = API(os.getenv('FRESHDESK_DOMAIN'), os.getenv('FRESHDESK_API_KEY') ,
version=2)ticket_number = 100ticket = a.tickets.get_ticket(ticket_number,
"requester")ticket.requester
text
{'id': 200003266492, 'name': 'Customer name ', 'email': 'test@gmail.com', 'mobile': None, 'phone':
None}

And also can get a ticket ID by command below:

text
ticket.requester['id']200003266492

List of customer tickets:

python
mylist = a.tickets.list_tickets(requester_id=ticket.requester['id'],filter_name=None)

In part of filter_name, it is possible to set [‘new_and_my_open,’ ‘watching,’ ‘spam,’ ‘deleted,’ None] for different types of tickets status.

Visit us at DataDrivenInvestor.com

Subscribe to DDIntel here.

Featured Article:

Join our creator ecosystem here.

DDI Official Telegram Channel: https://t.me/+tafUp6ecEys4YjQ1

Follow us on LinkedIn, Twitter, YouTube, and Facebook.