You can connect your bots from Freddy Self-service with your Freshdesk account using APIs. This integration is useful if you want the bot to handover conversations to your Freshdesk agents or update existing tickets. This is also useful if you want to share information from your Freshdesk account with your customers.

 

TABLE OF CONTENTS


Setting up the bot flows

  • When your bot is handing over the customer conversation to your Freshdesk agent, it can collect the information needed to create a ticket on behalf of your customer. 



Please make sure to collect the mandatory fields that are required to create a ticket on Freshdesk. For example, contact information (such as their email or phone numbers) is mandatory for ticket creation.



  • Once this is done, you'll need to set up the API to trigger ticket creation.


Setting up the APIs


  • Open the API library from the sidebar and click on the new API button.


  • Give a (1) Name to the API. This is just for your reference and will use it later in the bot flow.

  • Enter an endpoint in the (2) URL / JS function name field. To find the relevant endpoint for the API, please visit the Freshdesk API documentation. For our example, we will be using the Create Ticket API.

 


  • Once this is done, select the (3) Method. The choice for Method will depend on the API that you're using. For our example, we'll pick POST as we're using the Create Ticket API.

  • Let the payload type be (4) JSON.

  • Fill in the (5) Payload content based on the sample code in the API documentation. This is an example of payload content.

{
    "description": "Details about the issue...",
    "subject": "Support Needed...",
    "email": "tom@outerspace.com",
    "parent_id": 1,
    priority ": 1, "
    status ": 2, "
    cc_emails ": ["
    ram @freshdesk.com ","
    diana @freshdesk.com "] }


  • You can also make use of placeholders to use dynamic information in the payload. Click on the + icon and get a list of the placeholders with information that the bot can collect.

  • You can use an authorization header by checking the (6) add header. To set up the authorization header, you can make use of an API tool, or watch this clip and follow along.



  • You can populate the (7) response parameter with a value that can be used in the bot flow. In our example, we are sharing the ticket ID with the customer, and hence, we are using ID as the response parameter.

  • This is how the new API form will look like once you're done.


Finishing up the bot flows

  • So far, we have set up the bot flows to get the customer input, and we have set up an API which will create a ticket using the API and return the ticket ID.

  • Open the dialog where you want to trigger the Freshdesk API > open the Actions tab > Pick Trigger API from the Action type dropdown > Click the button > Select the API that you configured earlier.


Please write to freshbots-support@freshworks.com if you have any more questions. We'll be happy to help you.