How to update KlickTipp Contacts with HTTP Request

Describe the issue/error/question

I want to update a contact at KlickTipp with data from FluentCRM, but when i send the
fields array, there are no changes. I dont know how the data should be look like.

Here on the “subscriber_update”

What is the error message (if any)?

I get back, TRUE but there are noch changes

Please share the workflow

(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)
{
  "nodes": [
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "https://api.klicktipp.com/account/login",
        "options": {},
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "username",
              "value": "USERNAME"
            },
            {
              "name": "password",
              "value": "PASSWORD"
            }
          ]
        }
      },
      "name": "Get Login Cookie",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        880,
        180
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $node[\"Check if Email exists\"].json[\"error\"][\"message\"] }}",
              "operation": "notContains",
              "value2": "404 - [\"Diesen Empfänger gibt es nicht.\"]"
            }
          ]
        }
      },
      "name": "Contact exist?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [
        1300,
        180
      ],
      "continueOnFail": true
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "https://api.klicktipp.com/subscriber/search.json",
        "options": {},
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "email",
              "value": "={{ $node[\"Extract Email Adress\"].json[\"email\"] }}"
            }
          ]
        },
        "headerParametersUi": {
          "parameter": [
            {
              "name": "cookie",
              "value": "={{ $node[\"Get Login Cookie\"].json[\"session_name\"] }}={{ $node[\"Get Login Cookie\"].json[\"sessid\"] }}"
            }
          ]
        }
      },
      "name": "Check if Email exists",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        1080,
        180
      ],
      "continueOnFail": true
    },
    {
      "parameters": {
        "keepOnlySet": true,
        "values": {
          "string": [
            {
              "name": "email",
              "value": "={{ $node[\"Webhook\"].json[\"body\"][\"email\"] }}"
            }
          ]
        },
        "options": {}
      },
      "name": "Extract Email Adress",
      "type": "n8n-nodes-base.set",
      "typeVersion": 1,
      "position": [
        660,
        180
      ]
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "https://api.klicktipp.com/subscriber.json",
        "options": {},
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "email",
              "value": "={{ $node[\"Extract Email Adress\"].json[\"email\"] }}"
            }
          ]
        },
        "headerParametersUi": {
          "parameter": [
            {
              "name": "cookie",
              "value": "={{ $node[\"Get Login Cookie\"].json[\"session_name\"] }}={{ $node[\"Get Login Cookie\"].json[\"sessid\"] }}"
            }
          ]
        }
      },
      "name": "Create Contact",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        1460,
        220
      ],
      "continueOnFail": true
    },
    {
      "parameters": {
        "requestMethod": "PUT",
        "url": "=https://api.klicktipp.com/subscriber/{{$json[\"0\"]}}.json",
        "options": {},
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "fields",
              "value": "=[\n'fieldFirstName':\"Testname\",\n'fieldLastName':\"Testname\"\n]"
            }
          ]
        },
        "headerParametersUi": {
          "parameter": [
            {
              "name": "cookie",
              "value": "={{ $node[\"Get Login Cookie\"].json[\"session_name\"] }}={{ $node[\"Get Login Cookie\"].json[\"sessid\"] }}"
            }
          ]
        }
      },
      "name": "Update Contact1",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 2,
      "position": [
        1400,
        -100
      ],
      "continueOnFail": true
    }
  ],
  "connections": {
    "Get Login Cookie": {
      "main": [
        [
          {
            "node": "Check if Email exists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Contact exist?": {
      "main": [
        [
          {
            "node": "Update Contact1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create Contact",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if Email exists": {
      "main": [
        [
          {
            "node": "Contact exist?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Email Adress": {
      "main": [
        [
          {
            "node": "Get Login Cookie",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Share the output returned by the last node

Information on your n8n setup

  • n8n version:0.184.0
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:Heroku

Hi @RL-DL90

I am having trouble navigating the german site. Do they have an example of how the request should look like, in something else than PHP?

It is probably simply not understanding the Array you are sending. So no fields are updated but is returned OK because it thinks there are simply no fields to update.

hope that makes sense.

No, iam sorry there is only a documentation in php. But i know that i works.

I’ve tested it with postman, after long playing around there i got the update, with following setting.

But i cant setup on n8n, because iam not know how to :slight_smile:

SubscriberId, Password and Username isnt required by the way.
I can authenticate with the cookie based authentication.

Awesome, that helps a lot!
I will look at it for you.

Thank you so much.
Here is a working request as i mentioned:

Can you please put your workflow in the preformatted text block?
I cannot copy-paste it now as the format is probably messed up with the normal formatting.

also, it is not actually an array it seems, so if you change [ ] with { } it might work already. as you postman example does not have the array.

Could you share a CURL sample of your request (without credentials)?
This can be easily exported with Postman clicking on Code and choosing CURL code.

Ah sorry, i edited it.
I think i’ve tried it already with [] but with the same result

curl --location --request PUT 'https://api.klicktipp.com/subscriber/107576674.json' \
--header 'Content-Type: application/json' \
--header 'Cookie: SSESS5bc3b84d3f1031274d7732e94861cff5=fova-ZOKcC9H9Bn-NV1U5CfaXrFDNB5JAo6E96EG8u0; AWSALBTG=PN4m5n1Z7xM685YG9ohOOIgNXvll3I4h9Al7yaitgxYXGR13wU46mjToi5nJzwjCcO25LtYpMuzq69tV+NMPBbGP8toV8dYmo5WSA+tY3zr/tNdvYHxqaEQvEX24OXwssdjayGUBfkZQuUvm5xi67EMVqIU0/W4CP4zJll+CbsQR; AWSALBTGCORS=PN4m5n1Z7xM685YG9ohOOIgNXvll3I4h9Al7yaitgxYXGR13wU46mjToi5nJzwjCcO25LtYpMuzq69tV+NMPBbGP8toV8dYmo5WSA+tY3zr/tNdvYHxqaEQvEX24OXwssdjayGUBfkZQuUvm5xi67EMVqIU0/W4CP4zJll+CbsQR' \
--data-raw '{
    "fields": {
        "fieldFirstName": "Knoblauch",
        "fieldLastName": "Testwebhook"
    }
}'

Doest this help?

Hmm, what iam doing wrong?
I’ve copied the settings?

Sorry try this:

Edit found a typo.

2 Likes

In the Header were also problems, but now it works.
Thank you so much, for the help :star_struck:

One question, what was my fault?
Does the API only accept RAW Data or where was the problem?

1 Like

You were giving an Array so [ ] around the fields.
even though your postman example was sending an object so { } around it.

Also you had to set it to sending RAW body I think. (not sure if this can be done in a different way, but is also what you did on Postman)

1 Like

Hey @RL-DL90 :blush:

We’re excited to share that we’ve just released a brand-new KlickTipp API client for n8n! :tada:

(Installation via Settings > Community Nodes > Install)

This client gives you access to all the functions that our API offers – the perfect tool to take your workflows with KlickTipp to the next level. :rocket:

Give it a try and let us know what you think! We can’t wait to see how you use it. Happy automating! :raised_hands:


Hey @RL-DL90 :blush:

Wir freuen uns riesig, Dir mitteilen zu können, dass wir einen brandneuen KlickTipp API-Client für n8n veröffentlicht haben! :tada:

(Installation via Settings > Community Nodes > Install)

Mit diesem Client hast Du Zugriff auf alle Funktionen, die unsere API bietet – das perfekte Tool, um Deine Workflows mit KlickTipp auf das nächste Level zu bringen und Deine Automatisierung zu optimieren. :rocket:

Probiere ihn gerne aus und gib uns Feedback! Wir sind schon gespannt darauf, zu sehen, was Du damit alles umsetzt. Viel Spaß beim Testen und Happy Automating! :raised_hands: