---
title: Understanding the Developers - Webhook section
description: Webhooks are a powerful feature that enables seamless communication between your application and external services or systems. They allow real-time data exchange, making them a valuable tool for devel
---

[Skip to content](https://support.dataslayer.ai/understanding-the-developers-webhook-section#main-content)

- [English](https://support.dataslayer.ai/understanding-the-developers-webhook-section)
- [Español](https://support.dataslayer.ai/es/entendiendo-la-sección-de-desarrolladores-webhooks)

English

Show submenu for translations

[![Dataslayer](https://support.dataslayer.ai/hs-fs/hubfs/Dataslayer_New_Logo.png?height=35&name=Dataslayer_New_Logo.png)](https://www.dataslayer.ai/)

Open main navigation

Close main navigation

- - [English](https://support.dataslayer.ai/understanding-the-developers-webhook-section)
    - [Español](https://support.dataslayer.ai/es/entendiendo-la-sección-de-desarrolladores-webhooks)

  English
  
  Show submenu for translations

 Hello. How can we help you?

- There are no suggestions because the search field is empty.

1. [Knowledge base](https://support.dataslayer.ai/?hsLang=en)
2. [General](https://support.dataslayer.ai/general?hsLang=en)

May 17, 2024

# Understanding the Developers - Webhook section

### What is a Webhook?

Webhooks are a powerful feature that enables seamless communication between your application and external services or systems. They allow real-time data exchange, making them a valuable tool for **developers** to **automate workflows, trigger actions, and enhance the functionality of their applications.**

In this article, we will walk you through the process of using **Webhooks for Developers in Dataslayer,** a new feature we've added to our platform. When sharing an authentication link to your clients, we will automatically sent you a notification email to let you know that someone has granted you access to his/her credentials. However, this is not the only way to get notified about this. By using the webhooks, we will sent directly to your app some parameters to notify you.

**This is an advanced functionality that requires some coding knowledge.**

### Using webhooks in Dataslayer 

By following these steps, you'll be able to set up and use webhooks efficiently to enhance your application's capabilities.

 

![faqs-2\_mg1ddh](https://support.dataslayer.ai/hs-fs/hubfs/faqs-2_mg1ddh.png?width=688&height=61&name=faqs-2_mg1ddh.png)

**1. Access the Developers Page**

To get started, navigate to the [Developers](https://app.dataslayer.ai/webhooks) section within our platform. This is where you will manage and configure webhooks for your application.

**2. Add a New Webhook**

Once you're in the Developers section, click on the "+ Add Webhook" button on the right. This action will initiate the process of creating a new webhook. You will need to specify the URL of your **endpoint** where you want to receive webhook payloads. This URL should be the location where your application will receive incoming data and has to be public.

**3. Copy the Secret Key**

We recommend copying the secret key generated by our platform during the webhook setup process. This secret key will be used to verify the authenticity of incoming webhook payloads.

 

![faqs-1\_1qw6l9z](https://support.dataslayer.ai/hs-fs/hubfs/faqs-1_1qw6l9z.png?width=688&height=61&name=faqs-1_1qw6l9z.png)

**4. Environment Variable for Secret**

For enhanced security, consider creating an environment variable on your server to store the secret key (copied in Step 3). This practice ensures that your secret key remains protected.

**5. Installing the Fernet Package (NPM)**

To decrypt the content of webhook payloads, you will need to [install the Fernet package](https://www.npmjs.com/package/fernet) using npm. This package allows you to securely decode the data received from the webhook. Find below how to install the package:

```
npm i fernet
```

**We ONLY allow webhook connections from this package.**

**6. Creating a Function or Class**

You will need to create a function or class in your programming language that references your endpoint (URL specified in Step 2).

**7. Implementing the Webhook Handling**

In the controller (or equivalent) of your application, implement one of the following codes (or the language of your choice) to manage the POST request:

**PHP code sample**

```
use Fernet\Fernet;// ...$secret = env("DATASLAYER_WEBHOOK_SECRET");$fernet = new Fernet(base64_encode($secret));$payload = @file_get_contents('php://input');$parsePayload = json_decode($payload, true);$decryptedData = $fernet->decode($parsePayload["encrypted_data"]);$decodeData = json_decode($decryptedData, true);// ... Your custom logic here
```

**PYTHON code sample**

```
import base64import jsonfrom cryptography.fernet import Fernetfrom os import getenv# ...secret = getenv('DATASLAYER_WEBHOOK_SECRET')fernet = Fernet(base64.b64encode(secret.encode()))# payload is the parameter passed in the POST request, this is what we want to decryptdecrypted_data = fernet.decrypt(payload.encrypted_data)decode_data = json.loads(decrypted_data.decode())# ... Your custom logic here
```

*Understanding the codes above:*

- ***secret:** we retrieve the secret key obtained in the Step 3 and established in Step 4.*
- ***fernet:** we initialize a variable using the Fernet library with the previously obtained secret key.*
- ***payload:** we fetch the encrypted data received from the webhook.*
- ***parsePayload:** we parse the content of the webhook payload.*
- ***decryptedData:** we decode the content using the Fernet library.*
- ***decodeData: **we further decode the content into a JSON format that we can work with. After this, you can add any additional processing or logic as needed.*

**8. Handling the Decoded Data**

Once the data is decoded, you can access the payload, which will contain valuable information for your application. This is the information we will send you once a user successfully log in with the shareable link you sent to him/her:

**PHP code sample**

```
$params = [    'type' => 'shared_connection',    'datasource' => $datasource,    'email' => $email,    'created' => time(),];
```

**PYTHON code sample**

```
params = {    type: 'shared_connection',    datasource: datasource,    email: email,    created: time()}
```

- The *time()* function returns the date in *UNIX TIMESTAMP. *

By following these steps, you can successfully set up and use webhooks for developers. This feature will enable your application to receive real-time data updates, enhancing its functionality and automation capabilities. Feel free to customize the decoded data to meet your specific requirements and unlock the full potential of webhooks in your application.

As always, please contact us via our live chat on our [website](https://dataslayer.ai/) or via [email](mailto:info@dataslayer.ai) if you still have doubts or questions. We are happy to help!

- [General](https://support.dataslayer.ai/general?hsLang=en)
- [Billing & Pricing](https://support.dataslayer.ai/billing-pricing?hsLang=en)
- [Data Sources](https://support.dataslayer.ai/data-sources?hsLang=en)
- [Blended Connectors](https://support.dataslayer.ai/blended-connectors?hsLang=en)
- [Google Sheets](https://support.dataslayer.ai/google-sheets?hsLang=en)
- [Microsoft Excel](https://support.dataslayer.ai/microsoft-excel?hsLang=en)
- [Spreadsheets](https://support.dataslayer.ai/spreadsheets?hsLang=en)
- [Looker Studio](https://support.dataslayer.ai/looker-studio?hsLang=en)
- [Big Query](https://support.dataslayer.ai/big-query?hsLang=en)
- [API Query Manager](https://support.dataslayer.ai/api-query-manager?hsLang=en)
- [Power BI](https://support.dataslayer.ai/power-bi?hsLang=en)
- [Amazon S3](https://support.dataslayer.ai/amazon-s3?hsLang=en)
- [Amazon Redshift](https://support.dataslayer.ai/amazon-redshift?hsLang=en)
- [Snowflake](https://support.dataslayer.ai/snowflake?hsLang=en#main-content)

    - [Marketplace](https://support.dataslayer.ai/snowflake?hsLang=en#marketplace)
- [Google Cloud Storage](https://support.dataslayer.ai/google-cloud-storage?hsLang=en)
- [Database](https://support.dataslayer.ai/database?hsLang=en)
- [Azure SQL](https://support.dataslayer.ai/azure-sql?hsLang=en)
- [Azure Storage](https://support.dataslayer.ai/azure-storage?hsLang=en)
- [Dataslayer Atlas](https://support.dataslayer.ai/dataslayer-atlas?hsLang=en)
- [Morpheus](https://support.dataslayer.ai/morpheus?hsLang=en)
- [AI Looker Studio Analyzer](https://support.dataslayer.ai/ai-looker-studio-analyzer?hsLang=en)
- [Dataslayer MCP](https://support.dataslayer.ai/dataslayer-mcp?hsLang=en)
- [Dataslayer GPT](https://support.dataslayer.ai/dataslayer-gpt?hsLang=en)
- [Dataslayer AI Chat](https://support.dataslayer.ai/dataslayer-ai-chat?hsLang=en)

[![Chill listening crop-3](https://support.dataslayer.ai/hs-fs/hubfs/Dataslayer_New_Logo.png?width=142&height=24&name=Dataslayer_New_Logo.png "Chill listening crop-3")](https://dataslayer.ai/)

Dataslayer.ai: Digital Marketing Reporting Made Easy

<https://www.linkedin.com/company/dataslayer/> <https://www.youtube.com/@dataslayers>

Copyright © 2026, DATASLAYER SL