N8N Set-Up

Receive data in realtime with Webhook

Step 1: Create a New Workflow in n8n

  1. Open the n8n dashboard
  2. Click on "CREATE WORKFLOW" to start a new one

Step 2: Add a Webhook Node

  1. In the empty workflow, click on “Add first step”
  2. Search for and select the “Webhook” node

Step 3: Configure the Webhook Node in Test Mode

  1. Use the “Test URL” (shown in the node) to test incoming data.
  2. Copy the GET URL and keep it.

Keep the default options.

Important
This Test URL allows n8n to capture and display webhook data so you can configure the rest of your workflow (filters, API calls, automation, etc.).

DO NOT switch to the Production URL yet, or you won’t be able to inspect the incoming data or test your logic.


STEP 4: Set-Up Webhook on Unipile Dashboard

In our case, we will dedicate this webhook to received/sended messages. This webhook will only be used to configure our workflow; later on, we will need to create a new one using the production URL available on N8N.

  1. Go to your unipile dashboard in the webhook section and create a webhook.
  2. Next, paste the TEST URL obtained from N8N and create a webhook
  1. Then, click on "Create Webhook", you should have something like that. If that's not the case, restart the previous steps :
  1. Go to your n8n webhook, and click on “Listen for test event”, and try to send you a message or send a message from one of your provider accounts., you should receive an output like this :
  1. Now it's up to you to play with the various endpoints and drag and drop the information received from the webhook into the fields of your future API request (see N8N documentation), before moving on to producing the webhook URL.
  2. We will now move on to the production url, click on production URL, and copy it.
  3. Go back to the unipile dashboard and recreate a webhook in the same way as described above , and put the production URL in the “Callback URL” field. Don't forget to activate your workflow on N8N
  4. Your workflow is now operational !

Retrieve Profile Example

This is an example of a GET request, you must specify this type of method, and there must always be the following fields in all your GET requests:

 --header 'X-API-KEY: YOUR_API_KEY' \
 --header 'accept: application/json'

  1. In the empty workflow, click on “Add first step”
  2. Search for and select the "HTTP Request" node
  3. Go to the Retrieve Profile endpoint page
  4. Fill in the fields as shown in the image below (you'll see the link between the endpoint page and the N8N fields) You can also download this example here
  1. Click on execute step, you should get an answer like this for a linkedin user :
[
  {
    "object": "UserProfile",
    "provider": "LINKEDIN",
    "provider_id": "ACoAAAXxg9sBsVmolZ8Oq_7jEe92IOOpRSI8dPE",
    "public_identifier": "arnaud-hartmann",
    "member_urn": "99714011",
    "first_name": "Arnaud",
    "last_name": "Hartmann",
    "headline": "Co-founder & CTO at Unipile | One API to Enhance your App with Multi-Channel Messaging",
    "primary_locale": {
      "country": "US",
      "language": "en"
    },
    "is_open_profile": true,
    "is_premium": true,
    "is_influencer": false,
    "is_creator": true,
    "is_relationship": true,
    "network_distance": "FIRST_DEGREE",
    "is_self": false,
    "websites": [
      "http://www.unipile.com"
    ],
    "follower_count": 6296,
    "connections_count": 6145,
    "location": "Riorges, Auvergne-Rhône-Alpes, France",
    "birthdate": {
      "month": 5,
      "day": 4
    },
    "profile_picture_url": "https://media.licdn.com/dms/image/v2/D4E03AQEtIsqhaZFc8Q/profile-displayphoto-shrink_100_100/profile-displayphoto-shrink_100_100/0/1693819290815?e=1755129600&v=beta&t=KonSfCOwQeua3nhsnaJdd0ncySWA-y-RuEQ64eeFFJc",
    "profile_picture_url_large": "https://media.licdn.com/dms/image/v2/D4E03AQEtIsqhaZFc8Q/profile-displayphoto-shrink_800_800/profile-displayphoto-shrink_800_800/0/1693819290815?e=1755129600&v=beta&t=LH4MACfmW_A_yP9mFBrz2nssZMiPyPN9EhN9Ejhl5lE",
    "background_picture_url": "https://media.licdn.com/dms/image/v2/D4E16AQEmOsNC5se14A/profile-displaybackgroundimage-shrink_350_1400/B4EZaHJSXMH8Ak-/0/1746024081353?e=1755129600&v=beta&t=xLah9joKveS5uZfS0Bx91YxIJYJ2sE3qNg5hkNYKBTQ",
    "hashtags": [
      "#saas",
      "#0inbox",
      "#allistask",
      "#productivity",
      "#unifiedinbox"
    ]
  }
]

Send an invitation Example

This is an example of a POST request, you must specify this type of method, and there must always be the following fields in all your POST requests:

     --header 'X-API-KEY: YOUR_API_KEY' \
     --header 'accept: application/json' \
     --header 'content-type: application/json'

  1. In the empty workflow, click on “Add first step”
  2. Search for and select the "HTTP Request" node
  3. Go to the Send an invitation endpoint page
  4. Fill in the fields as shown in the image below (you'll see the link between the endpoint page and the N8N fields) You can also download this example here

for this route you will need retrieve profile, to retrieve the provider id of the person you wish to send an invitation to.


  1. Click on execute step, you should get an answer like this:
[
  {
    "object": "UserInvitationSent",
    "invitation_id": "7338566583293775874"
  }
]

How to import JSON

Go to your favorite workflow, at the top right of the page you'll see three small dots, then “Import from File”.