Next Matter integrates seamlessly with Freshdesk in two directions. In this integration tutorial you can learn how to trigger a Next Matter process directly from the Freshdesk by setting up an automation rule. You will also receive a reply from Next Matter so that your agents have all context required.

If you are looking for a solution to show ticket details on your Next Matter process or updating a ticket from Next Matter please check this article instead

Integrate Next Matter with Freshdesk

  1. Create your Freshdesk API key

  2. Create custom Ticket Field in Freshdesk

  3. Create an Automation in Freshdesk

  4. Update Ticket with Next Matter instance URL (optional)


Step 1: Create your Freshdesk API key

API keys are necessary so that the Next Matter process can authenticate itself when communicating with Freshdesk. You can obtain your API key by following these steps

How to find your API key

Once you have found your key, Freshdesk requires that you encode it with a tool like

https://base64encode.org

Simply enter your API key in the format APIkey:X and press on "encode". So if your API key is 12345 you need to enter 12345:X. Save the resulting string - it will be needed for the authentication of Next Matter.


Step 2: Create a custom Ticket Field in Freshdesk

Custom fields can be used to write Next Matter specific information such as the Next Matter instance URL back to the Freshdesk ticket. This will help your agents in identifying tickets that have already been send to Next Matter.

You can find this option in Freshdesk under Admin --> General Settings --> Ticket Fields. From the left side drag a "Single-line text" field into the field list. Click on the new field and label it "Next Matter URL".


Step 3: Create an Automation in Freshdesk

While creating an automation rule, you can decide under which circumstances to launch a Next Matter process. For this example a Next Matter process is launched whenever a new ticket with subject "Change of Address" is created.

For this step you will need

  • your Next Matter API Key - please contact your Next Matter support

  • your Next Matter process id. You can find this by accessing the process in the Next Matter platform and checking the URL. The process id is the number at the end of the URL like https://app.nextmatter.com/app/process/xxxx

Access Admin --> Helpdesk Productivity --> Automations

In the Tab "Ticket Creation" click on "New Rule"

configure the rule as seen on below screenshots. This is just a recommendation - you can also use your own conditions.

In "Perform these actions" choose "Trigger Webhook" and fill the Form:

URL - https://core.nextmatter.com/api/instances/

Request type - POST

Enable "Add custom headers"

{
"Authorization": "Api-Key insert_your_NextMatter_apikey_here"
}

Encoding - JSON

Content - Advanced

{
"process": "https://core.nextmatter.com/api/processes/insert_your_NextMatter_processid here/",
"name": "{{ticket.id}}"
}

You have now successfully created the Automation rule.


Step 4 (optional) - Update Ticket with Next Matter instance URL

Although this step is optional, it will give your agents full visibility on the process and will give you an understanding if the automation works as expected.

In this example we will update a custom field "Next Matter URL" on your ticket in Freshdesk. Next Matter will write the url of the process instance into this field.

Access your Process in Next Matter and open the editor. Add a new "Integration Step" right after the start of the process. Configure the step:

Method PUT and URL

https://your_freshdesk_subdomain.freshdesk.com/api/v2/tickets/{{instance_name}}/

The ticket id will be taken from the name of the Next Matter instance.

Add a header

Key Value
Authorization encoded_api_key_from_step_1
Content-Type application/json

Add a body

{"custom_fields":{"cf_next_matter_url":"{{instance_url}}"}}

Did this answer your question?