Dereferencing a link

Hello Everyone!

I’m trying to dereference a link using N8N. I have found this website that automatically returns the dereferenced link : https://deref.link/ .
What I would like to do is use their API to send an HTTP POST request to their website to get back a JSON with the dereferenced link.
On their website, they have a very brief API explanation on how to do that, and it seems like it could be very simple to do, but I have no clue on how to start.
I’d appreciate a lot some help :slight_smile:

Thanks in advance.

Hi @Spacewalker, looks like their curl example is simple enough and can easily be translated into our HTTP Request node.

Looking at this command:

curl -H "Content-Type: application/json" \
     -d'{"url": "google.com"}' \
     https://deref.link/deref

They are expecting a body parameter with a key of url and a value of google.com (or presumably any other URL) sent as a POST request to https://deref.link/deref. Setting these three values like below seems to work:

Example Workflow
{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "https://deref.link/deref",
        "options": {},
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "url",
              "value": "https://tcrn.ch/3nmp6uO"
            }
          ]
        }
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        450,
        300
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Hope this helps :slight_smile:

Another option would be to use the feature in the new OneSimpleAPI node which came out in version 149 :grinning_face_with_smiling_eyes:

2 Likes

Yes it does work, thanks a lot! :slight_smile:

1 Like

That’s another great solution, thanks!

2 Likes