Article
zendeskcustomer-supportai-agenthelpdesk-automationticket-resolutionapi-testingpython
Automate Support with the Zendesk AI Agent
Activate and configure the Zendesk AI Agent to autonomously resolve common customer support tickets. Learn how to set up its behavior, define its scope, and test its responses by programmatically creating a ticket.
intermediate30 min4 steps
The play
- Activate the AI AgentNavigate to the Zendesk Admin Center. Go to 'Channels' > 'Bots and automations' > 'Bots'. Here you can enable the Zendesk AI Agent for your desired channels (like web, mobile, or email) to start the configuration process.
- Connect Knowledge & Brand VoiceIn the bot settings, connect your Zendesk Help Center. The Zendesk AI Agent uses your existing articles to understand customer issues and provide accurate answers. You can also configure its persona and brand voice to match your company's tone.
- Define Resolution IntentsSelect which types of customer issues the Zendesk AI Agent is authorized to handle autonomously. Start with a few common, high-volume intents like 'check order status' or 'password reset' to see immediate value and ensure quality.
- Test with a Sample TicketUse the starter script to create a test ticket via the Zendesk API. This simulates a real customer request and allows you to immediately see the Zendesk AI Agent in action, verifying its response to a configured intent.
Starter code
import requests
import json
# Your Zendesk credentials
ZENDESK_SUBDOMAIN = 'your_subdomain' # e.g., 'mycompany'
ZENDESK_EMAIL = 'your_admin_email@example.com'
ZENDESK_API_TOKEN = 'your_api_token' # Found in Admin Center > Apps and integrations > APIs > Zendesk API
# API endpoint
url = f'https://{ZENDESK_SUBDOMAIN}.zendesk.com/api/v2/tickets.json'
# Authentication
auth = (f'{ZENDESK_EMAIL}/token', ZENDESK_API_TOKEN)
# Ticket data - The subject should match an intent you configured for the AI Agent
# For example, 'Where is my order?' or 'Password reset needed'
ticket_data = {
'ticket': {
'subject': 'Where is my order?',
'comment': {
'body': 'Hi, I placed an order last week (Order #12345) and I would like to know its current status. Thanks!'
},
'requester': {
'name': 'Test Customer',
'email': 'test.customer@example.com'
}
}
}
headers = {
'Content-Type': 'application/json'
}
# Make the API request
response = requests.post(url, headers=headers, auth=auth, data=json.dumps(ticket_data))
# Check the result
if response.status_code == 201:
print('Successfully created ticket. Check your Zendesk instance to see the AI Agent respond.')
print(f'Ticket URL: {response.json()["ticket"]["url"]}')
else:
print(f'Failed to create ticket. Status code: {response.status_code}')
print(f'Response: {response.text}')