Skip to main content

authentication.jsonc

  • This file outlines the necessary information needed to securely connect to the external service. It includes details like API keys or OAuth tokens required for authentication. This helps ensure that only authorized users can access the integration's resources.
{
"parameters": [
{
"name": "type",
"meta": {
"displayName": "Authentication Type",
"displayType": "select",
"placeholder": "Select an authentication type",
"description": "Choose the type of authentication you want to use.",
"options": [
{
"label": "API Key",
"value": "api_key"
}
],
"value": "api_key",
"validation": {
"required": true,
"requiredDetail": {
"errorMsg": "Authentication type is required"
}
}
}
}
],
"api_key": {
"parameters": [
{
"name": "api_url",
"meta": {
"displayName": "API URL",
"displayType": "select",
"placeholder": "Select an API URL",
"description": "Choose an API URL endpoint.",
"validation": {
"required": true,
"requiredDetail": {
"errorMsg": "API URL is required"
}
},
"options": [
{
"label": "{{domain}}.myfreshworks.com/crm/sales",
"value": "https://{{secrets.domain}}.myfreshworks.com/crm/sales"
},
{
"label": "{{domain}}.freshsales.io",
"value": "https://{{secrets.domain}}.freshsales.io"
},
{
"label": "{{domain}}.freshworks.com/crm/sales",
"value": "https://{{secrets.domain}}.freshworks.com/crm/sales"
}
],
"dependencies": {
"conditions": [
{
"field": "type",
"operator": "EQUALS",
"value": "api_key"
}
]
}
}
},
{
"name": "domain",
"meta": {
"displayName": "Domain",
"displayType": "text",
"placeholder": "Enter Domain",
"description": "The domain in the Freshworks CRM org URL. For example, in <a href='https://boltic.myfreshworks.com' target='_blank'>https://boltic.myfreshworks.com</a>, the domain is boltic.",
"validation": {
"required": true,
"requiredDetail": {
"errorMsg": "Domain is required"
}
},
"dependencies": {
"conditions": [
{
"field": "type",
"operator": "EQUALS",
"value": "api_key"
}
]
}
}
},
{
"name": "api_key",
"meta": {
"displayName": "API Key",
"displayType": "password",
"placeholder": "Enter API Key",
"description": "Refer to the <a href='https://developers.freshdesk.com/api/#authentication' target='blank'>Freshdesk API authenticaton documentation</a> for detailed instructions on getting your API key.",
"validation": {
"required": true,
"requiredDetail": {
"errorMsg": "API key is required"
}
},
"dependencies": {
"conditions": [
{
"field": "type",
"operator": "EQUALS",
"value": "api_key"
}
]
}
}
}
],
"validate": {
"method": "get",
"url": "{{secrets.api_url}}/api/settings/sales_accounts/fields",
"headers": {
"Authorization": "Token token={{secrets.api_key}}"
},
"response": {
"output": "{{response.data}}",
"error": {
"message": "{{response.data.message}}",
"code": "{{response.status}}"
}
},
"log": {
"sanitize": ["request.headers.authorization"]
}
}
}
}

Example - Add New Secret form API Screenshot

Parameters:

  • This contains UI fields that are going to be visible on click of add new button of resource field in Activity Config form UI.
  • You can check possible input types here

API Key Validation:

{
"api_key": {
"parameters": [],
"validate": {
"method": "get",
"url": "{{secrets.api_url}}/api/settings/sales_accounts/fields",
"headers": {
"Authorization": "Token token={{secrets.api_key}}"
},
"response": {
"output": "{{response.data}}",
"error": {
"message": "{{response.data.message}}",
"code": "{{response.status}}"
}
},
"log": {
"sanitize": ["request.headers.authorization"]
}
}
}
}

To ensure that the provided API key is valid, we perform a validation check using a GET request. This process involves sending a request to the specified endpoint and handling the response accordingly.

Here is the improved and formatted content for your Webhook.jsonc file documentation, ensuring clarity and consistency: