### View a Specific Agent using Curl Source: https://developer.freshdesk.com/api/v1 This example demonstrates how to fetch a specific agent's information using the `curl` command-line tool. It includes authentication headers and the GET request to the agent's endpoint. ```bash curl -v -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshdesk.com/agents/19.json ``` -------------------------------- ### View All Agents using Curl Source: https://developer.freshdesk.com/api/v1 This example shows how to retrieve a list of all agents using `curl`. It sends a GET request to the `/agents.json` endpoint with necessary authentication credentials. ```bash curl -v -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshdesk.com/agents.json ``` -------------------------------- ### View Solution Article using GET Source: https://developer.freshdesk.com/api/v1 This section outlines how to retrieve a specific solution article from Freshdesk using a GET request. The API endpoint requires the category, folder, and article IDs. The response is a JSON object containing all details of the specified article, including its content, status, tags, and creation/update timestamps. ```json { "article":{ "art_type":2, "created_at":"2014-01-08T15:14:22+05:30", "delta":true, "desc_un_html":"Steps: 1. Fill in the mandatory fields ...", "description":"
Steps: 1. Fill in the mandatory fields ...
", "folder_id":8, "id":2, "position":1, "seo_data":{}, "status":1, "thumbs_down":0, "thumbs_up":0, "title":"Steps to create a ticket", "updated_at":"2014-01-08T15:14:22+05:30", "user_id":1, "tags":[{ "name":"test" }], "folder":{ "category_id":5, "created_at":"2014-01-08T15:10:40+05:30", "description":"Ticket CRUD Operations", "id":8, "is_default":false, "name":"Ticket API", "position":1, "updated_at":"2014-01-08T15:10:40+05:30", "visibility":1, "customer_folders":[ ] } } } ``` -------------------------------- ### GET /solution/categories/[category_id]/folders/[folder_id]/articles/[article_id] Source: https://developer.freshdesk.com/api/v1 Retrieves a specific solution article within a given folder and category. ```APIDOC ## View Solution Article To view a specific solution article, use this API. ### Method GET ### Endpoint `/solution/categories/[category_id]/folders/[folder_id]/articles/[article_id].json` ### Parameters #### Path Parameters - **category_id** (integer) - Required - The ID of the solution category. - **folder_id** (integer) - Required - The ID of the folder containing the article. - **article_id** (integer) - Required - The ID of the solution article. ### Request Example ```json { "example": "curl -v -u user@yourcompany.com:test -H \"Content-Type: application/json\" -X GET https://domain.freshdesk.com/solution/categories/1/folders/1/articles/1.json" } ``` ### Response #### Success Response (200) - **folder** (object) - Contains details about the folder and its articles. - **category_id** (integer) - The ID of the category. - **created_at** (string) - The creation timestamp. - **description** (string) - The folder description. - **id** (integer) - The folder ID. - **is_default** (boolean) - Whether this is the default folder. - **name** (string) - The folder name. - **position** (integer) - The folder position. - **updated_at** (string) - The last updated timestamp. - **visibility** (integer) - The folder visibility status. - **articles** (array) - A list of articles within the folder. - **art_type** (integer) - The article type. - **created_at** (string) - The article creation timestamp. - **delta** (boolean) - Indicates if the article has changed. - **desc_un_html** (string) - The article description in plain text. - **description** (string) - The article description in HTML. - **folder_id** (integer) - The ID of the folder it belongs to. - **id** (integer) - The article ID. - **position** (integer) - The article position. - **seo_data** (object) - SEO related data. - **status** (integer) - The article status. - **thumbs_down** (integer) - Number of downvotes. - **thumbs_up** (integer) - Number of upvotes. - **title** (string) - The article title. - **updated_at** (string) - The article last updated timestamp. - **user_id** (integer) - The user ID who created the article. #### Response Example ```json { "example": "{\n \"folder\":{\n \"category_id\":5,\n \"created_at\":\"2014-01-08T15:10:40+05:30\",\n \"description\":\"Ticket CRUD Operations\",\n \"id\":8,\n \"is_default\":false,\n \"name\":\"Ticket API\",\n \"position\":1,\n \"updated_at\":\"2014-01-08T15:10:40+05:30\",\n \"visibility\":1,\n \"articles\": [ { \"art_type\":2, \"created_at\":\"2014-01-08T15:14:22+05:30\", \"delta\":true, \"desc_un_html\":\"Steps: 1. Fill in the mandatory fields ...\", \"description\":\"Steps: 1. Fill in the mandatory fields ...
\", \"folder_id\":8, \"id\":2, \"position\":1, \"seo_data\":{}, \"status\":1, \"thumbs_down\":0, \"thumbs_up\":0, \"title\":\"Steps to create a ticket\", \"updated_at\":\"2014-01-08T15:14:22+05:30\", \"user_id\":1 } ] } }" } ``` ``` -------------------------------- ### GET /api/v2/tickets Source: https://developer.freshdesk.com/api/index Retrieves a list of tickets. This endpoint is used as an example for authentication. ```APIDOC ## GET /api/v2/tickets ### Description Retrieves a list of tickets from the helpdesk. This is a common endpoint used to demonstrate API authentication. ### Method GET ### Endpoint `/api/v2/tickets` ### Parameters None directly documented for this example, but authentication is required. ### Request Example (Authentication) ```bash curl -v -u YOUR_API_KEY:X -H "Content-Type: application/json" -X GET 'https://your_helpdesk_domain_name/api/v2/tickets' ``` Replace `YOUR_API_KEY` with your actual API key and `https://your_helpdesk_domain_name` with your helpdesk domain. ### Response #### Success Response (200) - Returns a list of ticket objects. #### Response Example ```json { "tickets": [ { "id": 12345, "subject": "Issue with login", "status": "Open", "description": "User cannot log in to their account.", "created_at": "2023-10-27T10:00:00Z" } // ... more tickets ] } ``` ``` -------------------------------- ### Create Solution Folder using Ruby Source: https://developer.freshdesk.com/api/v1 This Ruby code snippet demonstrates how to create a new solution folder. It requires the 'rest_client' and 'json' gems. The API endpoint and request body are specified, including folder name, visibility, and customer associations. ```Ruby require "rubygems" require "rest_client" require "json" #Need to specify category_id in url #eg: #site = RestClient::Resource.new("https://domain.freshdesk.com/solution/categories/4/folders.json","user@yourcompany.com","test") site = RestClient::Resource.new("https://domain.freshdesk.com/solution/categories/[category_id]/folders.json","user@yourcompany.com","test") #visibility : 1 = All, 2 = Logged in Users, 3 = Agents, 4 = Select Companies [need to provide customer_ids for this option] response = site.post({:solution_folder=>{:name=>"test topic",:visibility=>4,:customer_folders_attributes=>{:customer_id=>[1,2]},:description=>"This is a new topic"}},:content_type=>"application/json") puts "response: #{response.code} \n #{response.body} \n" ``` -------------------------------- ### GET Business Hours API Response Update Source: https://developer.freshdesk.com/api/index The response to the GET Business hours API now includes start time, end time, and time zone information. ```APIDOC ## GET Business Hours API Response Update ### Description Retrieving business hours now provides more detailed information, including the specific start and end times and the associated time zone. ### Method GET ### Endpoint `/business_hours/{id}` ### Response #### Success Response (200) - **id** (integer) - The ID of the business hours. - **name** (string) - The name of the business hours. - **time_zone** (string) - The time zone (e.g., 'UTC', 'America/New_York'). - **start_time** (string) - The start time in HH:MM format (e.g., '09:00'). - **end_time** (string) - The end time in HH:MM format (e.g., '17:00'). - **days** (array) - Days of the week the business hours apply to. #### Response Example ```json { "id": 123, "name": "Standard Business Hours", "time_zone": "America/Los_Angeles", "start_time": "09:00", "end_time": "17:00", "days": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"] } ``` ``` -------------------------------- ### View All Solution Articles - Ruby Source: https://developer.freshdesk.com/api/v1 Fetches all solution articles within a specified folder using Ruby's RestClient. Placeholders for category_id and folder_id need to be replaced. Basic authentication is used, and the response's code and body are logged. ```ruby require "rubygems" require "rest_client" require "json" # Need to specify category_id,folder_id in url # eg: # site = RestClient::Resource.new("https://domain.freshdesk.com/solution/categories/1/folders/2.json","user@yourcompany.com","test") site = RestClient::Resource.new("https://domain.freshdesk.com/solution/categories/[category_id]/folders/folder_id.json","user@yourcompany.com","test") response = site.get(:accept=>"application/json") puts "response: #{response.code} \n #{response.body} \n" ``` -------------------------------- ### Create Solution Article using Ruby Source: https://developer.freshdesk.com/api/v1 This Ruby script utilizes the `rest_client` gem to create a new solution article in Freshdesk. It requires the category and folder IDs to be specified in the URL. The script allows for setting the article's title, status, type, description, folder ID, and even attachments. It handles authentication and sends the data as a JSON payload via a POST request. ```ruby require "rubygems" require "rest_client" require "json" #Need to specify the category_id and folder_id in url #eg: #site = RestClient::Resource.new("https://domain.freshdesk.com/solution/categories/4/folders/5/articles.json?tags=test","user@yourcompany.com","test") site = RestClient::Resource.new("https://domain.freshdesk.com/solution/categories/[category_id]/folders/[folder_id]/articles.json?tags=test","user@yourcompany.com","test") #Status: 1-Draft,2-Published #art_type: 1-Permanent,2-Workaround response = site.post({:solution_article=>{:title=>"test title",:status=>1,:art_type=>2,:description=>"Testing",:folder_id=>5,:attachments=>{''=>[{:resource=>File.new("/document.rtf", 'rb')}]}}},:content_type=>"application/json") puts "response: #{response.code} \n #{response.body} \n" ``` -------------------------------- ### Get Company Fields (Curl) Source: https://developer.freshdesk.com/api/v1 Example using Curl to fetch company fields from the Freshdesk API. It includes authentication headers and specifies the content type. The request method is GET. ```bash curl -v -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshdesk.com/admin/company_fields.json ``` -------------------------------- ### Get all Company Fields via Curl Source: https://developer.freshdesk.com/api/v1 Retrieves all available company fields from Freshdesk. Requires appropriate privileges. This example uses Curl. ```curl curl "https://domain.freshdesk.com/admin/company_fields.json" -v -u user@yourcompany.com:test ``` -------------------------------- ### Create Solution Article using Curl Source: https://developer.freshdesk.com/api/v1 This snippet demonstrates how to create a new solution article in Freshdesk using a cURL command. It requires authentication, specifies the article details like title, status, type, description, and folder ID, and can also include tags. The request is sent as a POST request with a JSON payload. ```curl curl -v -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{ "solution_article": { "title":"Create a ticket", "status":1, "art_type":2, "description":"Steps: Fill in the mandatory fields ...","folder_id":1 }, "tags":{"name": "tag1,tag2"}}' https://domain.freshdesk.com/solution/categories/1/folders/1/articles.json ``` -------------------------------- ### Create Solution Article Source: https://developer.freshdesk.com/api/v1 Creates a new solution article within a specified folder and category. Tags can also be provided. ```APIDOC ## Create Solution Article ### Description Creates a new solution article within a specified folder and category. Tags can also be provided. ### Method POST ### Endpoint /solution/categories/[id]/folders/[id]/articles.json ### Parameters #### Path Parameters - **id** (number) - Required - The ID of the solution category. - **id** (number) - Required - The ID of the folder where the article will be created. #### Query Parameters - **tags[name]** (string) - Optional - Comma-separated list of tags for the article. #### Request Body - **solution_article** (object) - Contains the details of the solution article. - **title** (string) - Required - The title of the solution article. - **status** (number) - Required - The status of the article (1: draft, 2: published). - **art_type** (number) - Required - The type of the article (1: permanent, 2: workaround). - **description** (string) - Required - The content of the solution article. - **folder_id** (number) - Required - The ID of the folder to which the article belongs. - **tags** (object) - Optional - Contains tags for the article. - **name** (string) - Comma-separated list of tags. ### Request Example ```json { "solution_article": { "title": "Create a ticket", "status": 1, "art_type": 2, "description": "Steps: Fill in the mandatory fields ...", "folder_id": 1 }, "tags": { "name": "tag1, tag2" } } ``` ### Response #### Success Response (200) - **article** (object) - Contains details of the created solution article. - **art_type** (number) - The type of the article. - **created_at** (string) - The creation timestamp. - **delta** (boolean) - Indicates if changes were made. - **desc_un_html** (string) - The unformatted description. - **description** (string) - The formatted HTML description. - **folder_id** (number) - The ID of the folder. - **id** (number) - The unique ID of the article. - **position** (number) - The display position. - **seo_data** (object) - SEO-related data. - **status** (number) - The status of the article. - **thumbs_down** (number) - Number of downvotes. - **thumbs_up** (number) - Number of upvotes. - **title** (string) - The title of the article. - **updated_at** (string) - The last update timestamp. - **user_id** (number) - The ID of the creator. - **tags** (array) - List of tags associated with the article. - **folder** (object) - Details of the folder the article belongs to. ### Response Example ```json { "article": { "art_type": 2, "created_at": "2014-01-08T15:14:22+05:30", "delta": true, "desc_un_html": "Steps: Fill in the mandatory fields ...", "description": "Steps: Fill in the mandatory fields ...
", "folder_id": 1, "id": 2, "position": 1, "seo_data": {}, "status": 1, "thumbs_down": 0, "thumbs_up": 0, "title": "Create a ticket", "updated_at": "2014-01-08T15:14:22+05:30", "user_id": 1, "tags": [ { "name": "api" } ], "folder": { "category_id": 5, "created_at": "2014-01-08T15:10:40+05:30", "description": "Ticket CRUD Operations", "id": 1, "is_default": false, "name": "Ticket API", "position": 1, "updated_at": "2014-01-08T15:10:40+05:30", "visibility": 1, "customer_folders": [] } } } ``` ``` -------------------------------- ### Create Solution Folder Source: https://developer.freshdesk.com/api/v1 Creates a new solution folder within a specified solution category. Requires folder details such as name, visibility, and description. ```APIDOC ## Create Solution Folder ### Description Use this API to create a new folder in your solutions. You need to specify the category ID under which the folder will be created. ### Method POST ### Endpoint /solution/categories/[id]/folders.json ### Parameters #### Path Parameters - **id** (number) - Required - The unique identifier of the category to which the folder will be added. #### Request Body - **solution_folder** (object) - Required - An object containing the details of the solution folder to be created. - **name** (string) - Required - The name of the solution folder. Must be unique. - **visibility** (number) - Required - The visibility setting for the folder. See 'Solution Folder Properties' for values. - **description** (string) - Optional - A description for the solution folder. - **customer_folder_attributes** (array) - Optional - Used when visibility is set to 'Company Specific Users' (4). Contains customer IDs. - **customer_id** (number) - Required if visibility is 4 - The ID of the company for which this folder is visible. ### Solution Folder Properties | Visibility Type | Value | |------------------------|-------| | All | 1 | | Logged in Users | 2 | | Agents Only | 3 | | Company Specific Users | 4 | ### Request Example ```json { "solution_folder": { "name": "Ticket API", "visibility": 1, "description": "Ticket CRUD Operations" } } ``` ### Request Example (Curl) ```bash curl -v -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{ "solution_folder": {"name":"Ticket API", "visibility":1, "description":"Ticket CRUD Operations" }}' https://domain.freshdesk.com/solution/categories/4/folders.json ``` ### Response #### Success Response (200) - **folder** (object) - Contains the details of the newly created solution folder. - **category_id** (number) - The ID of the category this folder belongs to. - **created_at** (string) - Timestamp when the folder was created. - **description** (string) - Description of the folder. - **id** (number) - Unique ID of the folder. - **is_default** (boolean) - Indicates if this is the default folder. - **name** (string) - Name of the folder. - **position** (number) - Position of the folder in the list. - **updated_at** (string) - Timestamp when the folder was last updated. - **visibility** (number) - Visibility setting of the folder. #### Response Example ```json { "folder": { "category_id": 4, "created_at": "2014-01-08T11:57:29+05:30", "description": "Ticket CRUD Operations", "id": 6, "is_default": false, "name": "Ticket API", "position": 2, "updated_at": "2014-01-08T11:57:29+05:30", "visibility": 1 } } ``` ``` -------------------------------- ### Embed Requester Details in Ticket View API Call (curl) Source: https://developer.freshdesk.com/api/index This snippet demonstrates how to embed requester details when viewing a ticket using the Freshdesk API. It utilizes the 'include' keyword in the API request to fetch additional resources. The example shows a curl command for a GET request. ```curl curl -v -u 'abcdefgh12345678:X' -X GET 'https://domain.freshdesk.com/api/v2/tickets/20?include=requester' ``` -------------------------------- ### Freshdesk API Best Practices Source: https://developer.freshdesk.com/api/index Recommendations for efficient and secure usage of the Freshdesk API. ```APIDOC ## API Best Practices ### General Recommendations * **Avoid Direct Mobile App Calls**: Instead of making API calls directly from a mobile application, route requests through your server. This allows for easier updates if API endpoints change without requiring users to update their app. * **Use HTTP Keep-Alive**: Employ HTTP connection multiplexing (Keep-Alive) for API requests. This reduces latency by reusing existing TCP connections to Freshdesk. * **Avoid Deep Pagination**: When retrieving lists of objects, refrain from using page numbers beyond 500. Deep pagination can be performance-intensive and lead to long response times. ### Code Samples Code samples for integrating with the Freshdesk API are available in various programming languages on our GitHub repository. | Language | Repository | | :------- | :---------------------------------------------------------------- | | Java | https://github.com/freshdesk/fresh-samples/tree/master/JAVA | | Node JS | https://github.com/freshdesk/fresh-samples/tree/master/NodeJs | | PHP | https://github.com/freshdesk/fresh-samples/tree/master/PHP | | Python | https://github.com/freshdesk/fresh-samples/tree/master/Python | | Ruby | https://github.com/freshdesk/fresh-samples/tree/master/Ruby | | C# | https://github.com/freshdesk/fresh-samples/tree/master/C-Sharp | ``` -------------------------------- ### Get First Page of Tickets with Description (API) Source: https://developer.freshdesk.com/api/index Retrieves the first page of tickets from the Freshdesk API, including the description for each ticket. This is useful for getting a comprehensive overview of ticket content. ```curl curl -v -u yourapikey:X -X GET 'https://domain.freshdesk.com/api/v2/tickets?include=description' ``` -------------------------------- ### View Single Solution Article - Ruby Source: https://developer.freshdesk.com/api/v1 Fetches a specific solution article using Ruby's RestClient library. It requires the category_id, folder_id, and article_id to be substituted into the URL. Authentication is handled via basic authentication with user credentials. The response code and body are printed. ```ruby require "rubygems" require "rest_client" require "json" # Need to specify category_id,folder_id,article_id in url # eg: # site = RestClient::Resource.new("https://domain.freshdesk.com/solution/categories/1813/folders/3216/articles/1355.json","user@yourcompany.com","test") site = RestClient::Resource.new("https://domain.freshdesk.com/solution/categories/[category_id]/folders/[folder_id]/articles/[article_id].json","user@yourcompany.com","test") response = site.get(:accept=>"application/json") puts "response: #{response.code} \n #{response.body} \n" ``` -------------------------------- ### Get all Ticket Fields - Curl Source: https://developer.freshdesk.com/api/v1 Retrieves all available ticket fields from Freshdesk. This GET request requires authentication and returns a JSON array of ticket field objects. ```bash curl -v -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshdesk.com/ticket_fields.json ``` -------------------------------- ### Create Freshdesk Ticket with Attachments (Curl) Source: https://developer.freshdesk.com/api/index This cURL command demonstrates creating a Freshdesk ticket and attaching files to it. The request must use `multipart/form-data` as the Content-Type. Multiple attachments can be uploaded by repeating the `-F "attachments[]=@/path/to/attachment.ext"` parameter for each file. The API key is used for authentication. ```shell curl -v -u yourapikey:X -F "attachments[]=@/path/to/attachment1.ext" -F "attachments[]=@/path/to/attachment2.ext" -F "email=example@example.com" -F "subject=Ticket Title" -F "description=this is a sample ticket" -X POST 'https://domain.freshdesk.com/api/v2/tickets' ``` -------------------------------- ### API Response Link Header Example Source: https://developer.freshdesk.com/api/index Shows an example of the 'link' header in an API response, which provides the URL for the next page of results if available. If the last page is reached, this header will not be present. ```http "link":< https://domain.freshdesk.com/api/v2/tickets?filter=all_tickets&page=2>;rel="next" ``` -------------------------------- ### Create Forum using Curl Source: https://developer.freshdesk.com/api/v1 A sample cURL command to create a forum. This demonstrates how to send a POST request with JSON payload containing forum details to the Freshdesk API. ```shell curl -v -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{ "forum": { "description": "Ticket related functions", "forum_category_id":1, "forum_type":2, "forum_visibility":1, "name":"Ticket Operations" }}' https://domain.freshdesk.com/discussions/forums.json ``` -------------------------------- ### View All Solution Folders Source: https://developer.freshdesk.com/api/v1 Retrieves a list of all solution folders available in your Freshdesk account. ```APIDOC ## GET /solution/categories.json ### Description Retrieves a list of all solution folders available in your Freshdesk account. ### Method GET ### Endpoint `/solution/categories.json` ### Parameters _No parameters required for this endpoint._ ### Response #### Success Response (200 OK) - **categories** (array of objects) - A list of solution categories, each containing folders. - **folders** (array of objects) - A list of folders within the category. - **category_id** (integer) - The ID of the category. - **created_at** (string) - Timestamp of creation. - **description** (string) - Description of the folder. - **id** (integer) - The ID of the folder. - **is_default** (boolean) - Whether the folder is a default folder. - **name** (string) - The name of the folder. - **position** (integer) - The position of the folder. - **updated_at** (string) - Timestamp of the last update. - **visibility** (integer) - Visibility setting of the folder. #### Response Example ```json [ { "id": 5000082621, "name": "General", "description": "General discussion", "position": 1, "visibility": 1, "is_default": false, "created_at": "2014-11-24T14:24:20+05:30", "updated_at": "2014-11-24T14:24:20+05:30", "folders": [ { "category_id": 5000082621, "created_at": "2014-11-24T14:24:20+05:30", "description": "Folder description", "id": 5000129957, "is_default": true, "name": "Drafts", "position": 1, "updated_at": "2014-11-24T14:24:20+05:30", "visibility": 3 } ] } ] ``` ``` -------------------------------- ### Get Company Fields (Ruby) Source: https://developer.freshdesk.com/api/v1 Ruby script to retrieve company fields using the REST client. It makes a GET request to the Freshdesk API endpoint and prints the response code and body. ```ruby require "rubygems" require "rest_client" require "json" #you can also use apikey instead of user/passwd site = RestClient::Resource.new("https://domain.freshdesk.com/admin/company_fields.json","user@yourcompany.com","test") response = site.get(:accept=>"application/json") puts "response: #{response.code} \n #{response.body}" ``` -------------------------------- ### Create User via API (Curl) Source: https://developer.freshdesk.com/api/v1 This example demonstrates how to create a user using the 'curl' command-line tool. It sends a POST request with JSON data to the Freshdesk API endpoint for creating contacts. ```curl curl -v -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{ "user": { "name":"Super Man", "email":"ram@freshdesk.com" }}' https://domain.freshdesk.com/contacts.json ``` -------------------------------- ### WhatsApp Invoice Notification with Document Header Source: https://developer.freshdesk.com/api/index This example shows how to send an invoice notification via WhatsApp, featuring a dynamic document (PDF) header. It includes a dynamic body with three variables. No button is configured in this specific example. ```JSON { "from": { "channel_identifier": "+91999XXXX999" }, "to": { "recipient_identifier": "+91999XXXX999" }, "channel_type": "WHATSAPP", "external_reference_id": "MM-T1-00004", "message": { "type": "TEMPLATE", "template": { "name": "purchase_receipt", "language": { "code": "en" }, "components": [ { "type": "header", "parameters": [ { "type": "document", "document": { "link": "https://media.freshworks.com/document/invoice.pdf" } } ] }, { "type": "body", "parameters": [ { "text": "Visa ending in 4532", "type": "text" }, { "text": "TechMart Electronics", "type": "text" }, { "text": "INV-2024-789", "type": "text" } ] } ] } }, "note_policy": { "on_reply": { "mode": "detailed" } }, "ticket_properties": { "tags": ["Urgent", "Web", "T1"], "custom_fields": { "cf_premium_customer": "Yes" } } } ``` -------------------------------- ### View All Solution Categories Source: https://developer.freshdesk.com/api/v1 Retrieve a list of all available solution categories in your helpdesk. ```APIDOC ## GET /solution/categories.json ### Description Retrieves all solution categories available in the helpdesk. ### Method GET ### Endpoint `/solution/categories.json` ### Response #### Success Response (200) - **categories** (array) - A list of solution category objects. - Each object contains: - **id** (number) - Unique ID of the solution category. - **name** (string) - Name of the solution category. - **description** (string) - Description of the solution category. - **created_at** (string) - Timestamp of creation. - **updated_at** (string) - Timestamp of last update. - **position** (number) - The rank of the solution category. - **is_default** (boolean) - Indicates if it's the default category. #### Response Example ```json [ { "created_at": "2014-01-08T11:53:32+05:30", "description": "API related documents", "id": 4, "is_default": false, "name": "API", "position": 4, "updated_at": "2014-01-08T11:53:32+05:30" }, { "created_at": "2014-01-07T10:00:00+05:30", "description": "General support documents", "id": 3, "is_default": true, "name": "General", "position": 1, "updated_at": "2014-01-07T10:00:00+05:30" } ] ``` ``` -------------------------------- ### Get All Contact Fields in Freshdesk API (cURL) Source: https://developer.freshdesk.com/api/v1 This cURL command retrieves all contact fields available in Freshdesk. It performs a GET request to the /admin/contact_fields.json endpoint and requires user authentication. The response will be a JSON array of contact field objects. ```curl curl -v -u user@yourcompany.com:test -H "Content-Type: application/json" -X GET https://domain.freshdesk.com/admin/contact_fields.json ``` -------------------------------- ### Create Freshdesk Ticket with Custom Object Record (Curl) Source: https://developer.freshdesk.com/api/index This cURL example shows how to create a Freshdesk ticket and associate it with a custom object record. It utilizes the `lookup_parameter` to specify how to identify the custom object record (either by `display_id` or `primary_field_value`) and then provides the custom field value. The API key and JSON payload are used for the request. ```shell curl -v -u yourapikey:X -H "Content-Type: application/json" -d '{ "description": "Details about the issue...", "subject": "Support Needed...", "email": "tom@outerspace.com", "priority": 1, "status": 2, "cc_emails": ["ram@freshdesk.com","diana@freshdesk.com"], "lookup_parameter" : "primary_field_value", "custom_fields" : { "cf_order_number_1" : "12345" } }' -X POST 'https://domain.freshdesk.com/api/v2/tickets' ``` -------------------------------- ### GET /api/v2/contacts/[id] Source: https://developer.freshdesk.com/api/index Retrieves the details of a specific contact by its ID. ```APIDOC ## GET /api/v2/contacts/[id] ### Description Retrieves the details of a specific contact using its unique identifier. ### Method GET ### Endpoint /api/v2/contacts/[id] ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the contact to retrieve. ### Request Example ```bash curl -v -u yourapikey:X -H 'Content-Type: application/json' -X GET 'https://domain.freshdesk.com/api/v2/contacts/434' ``` ### Response #### Success Response (200) - **active** (boolean) - Indicates if the contact is active. - **address** (string) - The address of the contact. - **company_id** (integer) - The ID of the associated company. - **view_all_tickets** (boolean) - Whether the contact can view all tickets. - **deleted** (boolean) - Indicates if the contact is deleted. - **description** (string) - A description for the contact. - **email** (string) - The primary email address. - **id** (integer) - The unique identifier for the contact. - **contact_type** (string) - The type of contact. - **job_title** (string) - The job title of the contact. - **language** (string) - The preferred language of the contact. - **mobile** (string) - The mobile phone number. - **name** (string) - The name of the contact. - **phone** (string) - The primary phone number. - **time_zone** (string) - The time zone of the contact. - **twitter_id** (string) - The Twitter ID of the contact. - **social_handler** (array) - Social media handles. - **other_emails** (array of strings) - Other email addresses. - **other_companies** (array of objects) - Associated companies. - **created_at** (string) - The timestamp when the contact was created. - **updated_at** (string) - The timestamp when the contact was last updated. - **tags** (array of strings) - Tags associated with the contact. - **avatar** (object) - Information about the contact's avatar. ### Response Example ```json { "active": false, "address": null, "company_id": 23, "view_all_tickets": false, "deleted": false, "description": null, "email": "superman@freshdesk.com", "id": 432, "contact_type": "contact", "job_title": null, "language": "en", "mobile": null, "name": "Super Man", "phone": null, "time_zone": "Chennai", "twitter_id": null, "social_handler": [], "other_emails": [ "lex@freshdesk.com", "louis@freshdesk.com" ], "other_companies": [ { "company_id": 25, "view_all_tickets": true }, { "company_id": 26, "view_all_tickets": false } ], "created_at": "2015-08-28T09:08:16Z", "updated_at": "2015-08-28T09:08:16Z", "tags": [], "avatar": null } ``` ``` -------------------------------- ### List All Roles using Freshdesk API (Curl) Source: https://developer.freshdesk.com/api/index This snippet demonstrates how to fetch a list of all available roles within Freshdesk. It requires API authentication. The output is a JSON array containing detailed information for each role, including their ID, name, description, default status, and creation/update timestamps. ```Curl curl -v -u yourapikey:X -X GET 'https://domain.freshdesk.com/api/v2/roles' ``` -------------------------------- ### GET /api/v2/tickets/archived/[id] Source: https://developer.freshdesk.com/api/index Retrieves a specific archived ticket by its ID. ```APIDOC ## GET /api/v2/tickets/archived/[id] ### Description Retrieves a specific archived ticket by its ID. ### Method GET ### Endpoint `/api/v2/tickets/archived/[id]` ### Response #### Success Response (200) - **cc_emails** (array) - Email addresses in CC for the ticket. - **fwd_emails** (array) - Forwarded email addresses. - **reply_cc_emails** (array) - Reply CC email addresses. - **email_config_id** (any) - Email configuration ID. - **fr_escalated** (boolean) - Whether the ticket is FR escalated. - **group_id** (any) - Group ID for the ticket. - **priority** (number) - Priority of the ticket. - **requester_id** (number) - ID of the ticket requester. - **responder_id** (any) - ID of the ticket responder. - **source** (number) - Source of the ticket. - **spam** (boolean) - Whether the ticket is spam. - **status** (number) - Status of the ticket. - **subject** (string) - Subject of the ticket. - **company_id** (number) - Company ID associated with the ticket. - **id** (number) - Unique identifier for the ticket. - **type** (any) - Type of the ticket. - **to_emails** (any) - To email addresses. - **product_id** (any) - Product ID associated with the ticket. - **created_at** (string) - Timestamp when the ticket was created. - **updated_at** (string) - Timestamp when the ticket was last updated. - **due_by** (string) - Timestamp when the ticket is due. - **fr_due_by** (string) - Timestamp for FR due date. - **is_escalated** (boolean) - Whether the ticket is escalated. - **association_type** (any) - Association type of the ticket. - **description_text** (string) - Plain text description of the ticket. - **description** (string) - HTML description of the ticket. - **custom_fields** (object) - Custom fields for the ticket. - **tags** (array) - Tags associated with the ticket. - **archived** (boolean) - Whether the ticket is archived. - **attachments** (array) - Attachments for the ticket. ### Request Example ```bash curl -v -u yourapikey:X -H "Content-Type: application/json" -X GET 'https://domain.freshdesk.com/api/v2/tickets/archived/40' ``` ``` -------------------------------- ### GET /api/v2/tickets/[id]/summary Source: https://developer.freshdesk.com/api/index Retrieves the summary of a specific ticket. ```APIDOC ## GET /api/v2/tickets/[id]/summary ### Description Retrieves the summary of a specific ticket. ### Method GET ### Endpoint `/api/v2/tickets/[id]/summary` ### Request Example ```json { "example": "curl -v -u yourapikey:X -H \"Content-Type: application/json\" -X GET 'https://domain.freshdesk.com/api/v2/tickets/20/summary'" } ``` ### Response #### Success Response (200) - **body** (string) - The HTML content of the summary. - **body_text** (string) - The plain text content of the summary. - **id** (integer) - The unique identifier of the summary. - **user_id** (integer) - The ID of the user who created the summary. - **ticket_id** (integer) - The ID of the ticket the summary belongs to. - **created_at** (string) - The timestamp when the summary was created. - **updated_at** (string) - The timestamp when the summary was last updated. - **attachments** (array) - An array of attachments associated with the summary. - **last_edited_at** (string) - The timestamp when the summary was last edited. - **last_edited_user_id** (integer) - The ID of the user who last edited the summary. - **cloud_files** (array) - An array of cloud files associated with the summary. #### Response Example ```json { "example": "{ \"body\": \"