Opinyin Advanced Webhooks is a simple no-code solution to integrate Freshdesk with your other systems to further increase automation and productivity, getting an even better ROI from your Freshdesk investment. Get real-time enhanced data as events in Freshdesk happen.


It uses the event model available in the Freshdesk Application API to provide richer and more extensive webhooks than are available via the native Freshdesk Automations that currently only notify on ticket changes. 


How to install


Please carefully review the instructions as you need to configure the App on both Freshdesk and Opinyin.


Step 1 – Opinyin Account Creation:

  1. Go to www.opinyin.com/register to register for your Opinyin Account. There is a free 21-day trial, and you will not be asked for card details until you choose to continue using Opinyin. This subscription gives you unrestricted use of Opinyin feedback analytics as well as Opinyin Enhanced Surveys for Freshdesk (https://www.freshworks.com/apps/opinyin_surveys/) and Freshchat (https://www.freshworks.com/apps/opinyin_surveys_1/), Ticket Description Analysis and Freshdesk CSAT Surveys Analysis.
  2. You will get an email asking you to verify your email address. Check your spam folder if it does not arrive.
  3. Verify your email address and login.
  4. On the Opinyin menu sidebar, click Settings > Integrations in the Opinyin menu sidebar and note your API key. You will need it for the Freshdesk Configuration.


Step 2 – Freshdesk Installation


Pre-requisites:

  1. Your Opinyin API key (obtained from your Opinyin Account – see above).
  2. Your Freshdesk subdomain name. This is the first part of your Freshdesk web address - the 'yourcompany' in yourcompany.freshdesk.com.
  3. Your Freshdesk API key. Obtain this from the Profile Settings page. Please note that you should be an administrator on Freshdesk.


Enter the above in the connection details pane and click Install.


Once you have installed the application, reopen the settings page, and you will be presented with options to register your webhooks as detailed below.


How to use


Registering a webhook manually

You can use your custom hooks or prebuilt hooks from platforms like Microsoft Power Automate or Zapier, which can then be utilised to process your data further and send it to your other systems. To set this up:

  1. Enter the URL of your hook.
  2. Select the Freshdesk event you wish to call this hook.
  3. Optionally add the system’s name or process this hook will target so you can see this in the list for future reference.
  4. If your hook needs to authenticate, add the authentication string precisely as it would be added to the Authorization attribute in the HTTPS header, including the type of authentication, ie. Bearer, Basic, etc. The app only currently supports this type of authentication. If an API key needs to be sent as a query parameter, please get in touch with us at [email protected].
  5. Optionally, you can also add a webhook ID. This ID can be used for reference if you have multiple hooks on the same URL or to deregister the hook if required programmatically.

Deregistering a webhook manually

Click the Delete button next to the hook you want to deregister on the App Admin page.


Registering a webhook programmatically

Webhooks can be registered programmatically by making a POST call to the URL provided in the Application Admin settings page (Admin > Apps > Manage Apps > Installed Apps > Opinyin Advanced Webhooks > Settings > Edit Settings)


Example Registration Call

curl -XPOST -H 'opinyinapi: 31dme312dedwqe2' -H Content-type: application/json -d '{url:https://yourdomain.com/yoursubscriber,eventType:onTicketCreate,opinyinAPI:31dme312dedwqe2,target:PowerApps,hookID:12Jdo13dml134LL321,hookApiKey:bhdUJk78DwZXewfq21}'  'https://hooks2.freshworks.com/HG4bIKUN0a01qOcflEKAwf1Q/vle1PSZPxjbqB/Xs0MO4XX'

After a registration call, you will always get a 200 status response with the payload {success:true}. Freshdesk external-facing URLs do not support the ability to give any response other than this. Therefore, you must check App Settings to ensure the hook has been subscribed successfully. If it has not been successful, then you should find an error message in the log that tells you what the issue is.


Header Details

If desired, the Opinyin API Key and the Freshdesk API Key can be sent in the header in the parameters ‘opinyinapi’ and ‘authorisation’, respectively. These will only be read if you do not specify them in the payload.


Payload Details

url (required)

The URL of the endpoint you wish to subscribe to the webhook.

NOTE: The application does not validate the URL sent in the payload. When the hook is triggered, if the URL called is invalid, it will be reported in the App log. The App will try to contact the URL again every 5 minutes so it is recommended incorrect URLs are deleted as soon as possible to avoid wasting your Freshdesk API call rate allowance.

eventType (required)

The type of Freshdesk event you want to subscribe to. See below for list of available events.

target (optional)

The name of the system you are calling

opinyinAPI (required)

Your Opiniyn API key as used in the App Admin settings

freshdeskAPI (required)

Your Freshdesk API key as used in the App Admin settings

hookID (optional)

An optional ID for your hook. This can be used to deregister your hook.

hookApiKey (optional)

An optional API key if your subscriber endpoint requires authorization. If specified, the webhook will add this to the HTTP call header as an attribute called ‘Authorization’. It will use the format exactly as you set it; therefore, you need to add the entire string required, including the type of authentication, ie. Basic, Bearer, etc.


Available Freshdesk Events

The following event types are available. Details of when these are triggered can be found in the Freshdesk Application API documentation here:- https://developers.freshworks.com/docs/app-sdk/v2.3/freshdesk/serverless-apps/product-events/


Entity

Event Type

Tickets

Create, Delete, Update

Conversation

Create, Delete, Update

Time Entry

Create, Delete, Update

Contact

Create, Delete, Update

Company

Create, Delete, Update

Agent

Create, Delete, Update

Agent Status

Create, Delete, Update

Agent Availability

Update

Group

Create, Delete, Update

 

IMPORTANT 

  1. Due to internal Freshdesk restrictions on internal data storage, the maximum aggregate length of subscriber URLS for any event is approximately 7000 characters. This limits the number of subscribers per event; however, 7000 characters should allow for a significant number.
  2. Due to internal Freshdesk rate limit and timeout restrictions, attempting to register too many webhooks too quickly may cause the registration to fail. We recommend registering one at a time with at least a 5-second gap between them if possible.

Deregistering a webhook programmatically

Deregistering the hook programmatically is the same call as registering it but includes a parameter delete:true in the payload. This will search for registered subscribers that match the hookID or the URL and delete that hook.


Event payloads

All payloads provide enhanced data that is not typically available with native Freshdesk Automation webhooks.

All events are sent as payload as defined in the Freshdesk Application API which can be found here:- https://developers.freshworks.com/docs/app-sdk/v2.3/freshdesk/serverless-apps/product-events/


All event payloads have an' eventType' data attribute, which contains details of the event that triggered the hook.

We have also enhanced the Ticket Create and Update events to add extra data on time spent, groups, skills, products, companies, internal groups, and email configurations. Details of these fields are as follows:


Attribute

Type

Details

fr_sla_violated

boolean

If the first response violated any SLA applicable to the ticket

resolution_sla_violated

boolean

If the resolution violated any SLA applicable to the ticket

sla_violated

boolean

If either the First Response or Resolution violated any SLA applicable to the ticket

time_to_resolution

integer

The cumulative business hours taken to resolve the ticket as per the business hours for the group assigned to the ticket or, if none, the default business hours.

time_to_first_response

integer

The cumulative business hours are taken to the first response to the ticket as per the business hours for the group assigned to the ticket or, if none, the default business hours.

company

string

The name of the Company the ticket is linked to, if any.

product

string

The name of the product the ticket is linked to, if any.

internal_agent

string

The name of the Internal Agent the ticket is linked to, if any.

internal_group

string

The name of the Internal Group the ticket is linked to, if any.

group

string

The name of the Group the ticket is linked to, if any.

skill

string

The name of the Skill the ticket is linked to, if any.

to_email

string

The inbound email address the ticket is linked to, if any.

reply_email

string

The outbound email address the ticket is linked to, if any.

 

Please note that the functionality of this application is dependent on Freshworks maintaining its Application and REST API functionality as is currently available.