Skip to content

Tech1ogic/Freshdesk_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Freshdesk Ticket Update Automation

A Python script that automates the process of updating multiple Freshdesk tickets with status messages.

Features

  • Fetch ticket conversation details
  • Add public notes to tickets
  • Process multiple tickets in batch
  • Check for customer replies in ticket conversations
  • Automated status update messaging

Prerequisites

  • Python 3.x
  • requests library
  • Freshdesk API credentials

Installation

  1. Install required dependencies:
pip install requests
  1. Configure your Freshdesk API credentials in the script:
FRESHDESK_DOMAIN = "your-domain.freshdesk.com"
API_KEY = "your-api-key"

Script Components

Main Functions

  1. get_ticket_details(ticket_id)

    • Fetches conversation details for a specific ticket
    • Returns JSON response of conversations or None if error occurs
  2. add_public_note_to_ticket(ticket_id, note)

    • Adds a public note to the specified ticket
    • Handles success/failure responses
  3. process_ticket(ticket_id)

    • Processes individual tickets
    • Checks for customer replies
    • Adds appropriate status update notes
  4. process_multiple_tickets(ticket_ids)

    • Processes a list of ticket IDs in batch
    • Calls process_ticket() for each ID

Usage

  1. Update the API credentials in the script:
FRESHDESK_DOMAIN = "your-domain.freshdesk.com"
API_KEY = "your-api-key"
  1. Modify the ticket_ids list with your target ticket numbers

  2. Run the script:

python Freshdesk_API_3-11-25.py

Error Handling

The script includes error handling for:

  • Failed API requests
  • Invalid ticket IDs
  • Authentication errors
  • Connection issues

Security Notes

  • Keep your API credentials secure
  • Don't commit the script with real credentials to version control
  • Consider using environment variables for sensitive data

Output

The script provides console output for:

  • Successful ticket updates
  • Failed operations with error messages
  • Processing status for each ticket

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a new Pull Request

License

This project is proprietary to Motive Energy, Inc.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages