What type of API does Freshdesk provide?
Freshdesk primarily offers a REST API for integrating with its platform. The current version of the Freshdesk API is v2, which offers improved functionality and performance compared to the previous version. The API uses API key-based authentication, and each request must include the API key in the request header. The API primarily uses JSON for data exchange, with responses returned in JSON format and request bodies also in JSON when sending data to the API. Freshdesk implements rate limiting on API requests to ensure fair usage and prevent abuse. The API provides endpoints for various Freshdesk entities such as tickets, contacts, companies, agents, and more, allowing for CRUD (Create, Read, Update, Delete) operations on these entities. In addition to the REST API, Freshdesk also supports webhooks for real-time notifications of events occurring within the platform.
Does the Freshdesk API have webhooks?
Availability of Webhooks
Yes, the official Freshdesk API does have webhooks.
Types of Events You Can Subscribe To
Freshdesk allows you to set up webhooks for various events, primarily through automation rules. Here are some examples of events you can subscribe to:
- Ticket creation
- Ticket updates
- Customer replies to tickets
- Addition of comments to tickets
- Changes in ticket status
- Changes in ticket priority
- Customer satisfaction survey results
- Custom field updates
Key Points to Consider
- Webhooks in Freshdesk are implemented through automation rules that run on ticket creation and ticket updates.
- Webhooks use the Agent API, so they are treated as an agent performing an update.
- You can configure webhooks to make GET, POST, PUT, PATCH, and DELETE requests.
- Webhooks run asynchronously to automations. If you make a GET call with a webhook, your automation rules won't be able to use the response.
- Webhooks are subject to API rate limits based on your Freshdesk plan.
- If a webhook is postponed from execution for more than 24 hours due to rate limiting, Freshdesk drops the webhook and sends an alert email to the helpdesk admin.
Best Practices
- Ensure you set up webhooks with the correct URL and follow the proper syntax for the webhook content to avoid failures during execution.
- Keep your webhooks within the API rate limit to prevent drops.
- Use placeholders to make your webhook URLs dynamic.
- Test your webhooks using tools like requestb.in or Postman before implementing them in your production environment.
- Consider the specific use case when setting up webhooks. For example, you might use webhooks to send SMS notifications, update inventory, sync status with other tools, or trigger external actions based on customer feedback.
In conclusion, Freshdesk's API offers robust webhook functionality that allows you to automate various actions based on ticket-related events. By carefully configuring your webhooks and adhering to best practices, you can extend the capabilities of your Freshdesk implementation and integrate it effectively with other systems and processes.
Rate Limits and other limitations
Here are the key points about the API rate limits for Freshdesk:
Rate Limits
-
The rate limits vary based on the Freshdesk plan:
- Free plan: 0 calls per minute
- Growth plan: 200 calls per minute
- Pro plan: 400 calls per minute
- Enterprise plan: 700 calls per minute
-
There are also sub-limits for specific endpoints:
- Ticket Create
- Ticket Update
- Tickets List
- Contacts List
-
For trial accounts, the limit is 50 calls per minute
Key Points
-
The limits are applied account-wide, regardless of number of agents or IP addresses used
-
Freshdesk is moving from per-hour limits to per-minute limits for all accounts
-
Even invalid API requests count towards the rate limit
-
Custom apps may consume API calls that count towards the limit
Best Practices
-
Check the rate limit status using the response headers:
- X-RateLimit-Total
- X-RateLimit-Remaining
- X-RateLimit-Used-CurrentRequest
-
If the limit is exceeded, the "Retry-After" header will indicate how long to wait before making another request
-
Follow rate limit best practices to stay within limits
-
Contact Freshdesk support to request increased limits if needed
Summary
The Freshdesk API has rate limits that vary by plan, with per-minute limits being rolled out to all accounts. Developers should monitor their usage via response headers and follow best practices to avoid exceeding limits. Additional API calls can be purchased if higher limits are required.
Latest API Version
The most recent version of the Freshdesk API is v2. [1]
Key points to consider:
-
The current version of production level APIs for Freshdesk is v2. [1]
-
Freshdesk APIs belong to the Representational State Transfer (REST) category. [1]
-
They allow performing RESTful operations such as reading, modifying, adding or deleting data from your helpdesk. [1]
-
The APIs support Cross-Origin Resource Sharing (CORS). [1]
Code example:
Here's a basic example of using the Freshdesk API v2 to get ticket details:
curl -v -u yourapikey:X -X GET 'https://domain.freshdesk.com/api/v2/tickets/1'
Best practices:
- Always use HTTPS for API requests to ensure security.
- Include your API key in the authentication header.
- Use appropriate HTTP methods (GET, POST, PUT, DELETE) based on the operation you want to perform.
- Handle rate limits and pagination when working with large datasets.
- Keep your API key confidential and rotate it periodically for security.
How to get a Freshdesk developer account and API Keys?
Here's how you can get a developer account for Freshdesk to create an API integration:
Step 1: Create a Freshdesk Account
To get started, you need to have a Freshdesk account. If you don't already have one:
- Go to the Freshdesk website
- Sign up for a free trial or choose a paid plan
- Complete the registration process
Step 2: Access Your API Key
Once you have a Freshdesk account, you can access your API key:
- Log in to your Freshdesk account
- Click on your profile picture in the top right corner
- Select "Profile settings"
- Look for the "API Key" section on the right side of the page
- Complete the CAPTCHA to view your API key
- Copy and securely store your API key
Key Points to Consider
- Your API key is unique and should be kept secure
- Freshdesk will only show your API key once, so make sure to copy it immediately
- You don't need a separate "developer account" - your regular Freshdesk account provides API access
Using the API
To use the Freshdesk API:
- Use your API key for authentication in API requests
- You can make API calls using the key in the format:
curl -v -u api_key:X -H "Content-Type: application/json" -X GET https://your_domain.freshdesk.com/api/v2/tickets
Replace api_key
with your actual API key and your_domain
with your Freshdesk subdomain.
Best Practices
- Store your API key securely and never share it publicly
- Use HTTPS for all API requests to ensure data security
- Be aware of API rate limits (typically 1000 requests per hour for paid plans)
- Refer to the official Freshdesk API documentation for detailed information on available endpoints and methods
What can you do with the Freshdesk API?
Here's the markdown text with the trailing list of URLs and citation references removed, and any URLs inside the content formatted correctly for the markdown file format:
Here's a list of data models you can interact with using the Freshdesk API, along with what is possible for each:
Tickets
- Create new tickets
- Retrieve ticket details
- Update ticket information
- Delete tickets
- Add notes or replies to tickets
- Assign tickets to agents
- Change ticket status or priority
Contacts
- Create new contacts
- Retrieve contact information
- Update contact details
- Delete contacts
- Merge duplicate contacts
Companies
- Create new companies
- Retrieve company information
- Update company details
- Delete companies
Agents
- Create new agent accounts
- Retrieve agent information
- Update agent details
- Delete agent accounts
Groups
- Create new groups
- Retrieve group information
- Update group details
- Delete groups
- Add or remove agents from groups
Time Entries
- Create time entries for tickets
- Retrieve time entry information
- Update time entries
- Delete time entries
Solutions (Knowledge Base)
- Create solution categories, folders, and articles
- Retrieve solution information
- Update solution content
- Delete solution items
Satisfaction Ratings
- Retrieve satisfaction ratings
- Create or update satisfaction ratings
Custom Objects
- Create custom data entities specific to your business
- Retrieve custom object information
- Update custom object data
- Delete custom objects
Activities
- Record activities from external systems in the contact timeline
SLA Policies
- Retrieve SLA policy information
Products
- Create new products
- Retrieve product information
- Update product details
- Delete products
Canned Responses
- Create canned response folders and responses
- Retrieve canned response information
- Update canned responses
- Delete canned responses
For each of these data models, you can typically perform CRUD (Create, Read, Update, Delete) operations using the appropriate HTTP methods (POST, GET, PUT, DELETE). The specific capabilities may vary depending on the data model and your account permissions.