Move new subscriber from MailChimp to HTTP Request Node

Yes please do. If you still have problems and you can not figure it out tell me, then I try to prepare another example.

You are welcome! Great to hear that it is helpful.

1 Like

Just now tried with the code you have given. Unfortunately, I can’t push the data as Custom Field.

I’m getting this Firstname and Lastname from WooCommerce Trigger and Unfortunately I can’t send it as object to HTTP Request node.

Here is the Mock Data Function.

return [
  {
    json: {
      "email": '[email protected]',
      "customFields": {
      "firstname": 'Jim',
      "lastname": 'Miller'
      }
    }
  }
]

Check the example below. I believe this is what you want to achive

{
  "nodes": [
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "requestMethod": "POST",
        "url": "https://webhook.site/c5d689e3-06da-4f5b-9ed3-e167200b7690",
        "options": {},
        "bodyParametersUi": {
          "parameter": [
            {
              "name": "email",
              "value": "={{$node[\"Function\"].json[\"email\"]}}"
            },
            {
              "name": "customFields",
              "value": "={{$node[\"Function\"].json[\"customFields\"]}}"
            }
          ]
        }
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        700,
        300
      ]
    },
    {
      "parameters": {
        "functionCode": "return [\n  {\n    json: {\n      \"email\": '[email protected]',\n      \"customFields\": {\n      \"firstname\": 'Jim',\n      \"lastname\": 'Miller'\n      }\n    }\n  }\n]\n"
      },
      "name": "Function",
      "type": "n8n-nodes-base.function",
      "typeVersion": 1,
      "position": [
        460,
        300
      ]
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Function",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Function": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

Having some issue.

It sending the data which are specified in Function node. And Not sending the actual data.

Can you please share with me the endpoint you are trying to use?

This same method worked for this too bro.

yup, how is the endpoint you are trying to send the data to expect the data? Like this:

{
    "email": "[email protected]",
    "firstname": 'ricardo',
    'lastname': 'espinoza',
}

Also if you point me out to the Rest API you are trying to consume I can have a look in the docs and help you better.

I sent you PM with login credentials and everything bro.

did not get the message.

Hi @mcnaveen, i hope you are fine
I am a complete newbie at n8n as you ware a few weeks ago
Some worflows are working great (Sheets google…etc)

But i have some problem with Mailchimp as you had : same message

Did you do the “Https” modification ?

@damienOp what is the issue you are having exactly?

@RicardoE105 thanks for your message
i have this message
There was a problem running the workflow:
400 - {“type”:“http://developer.mailchimp.com/documentation/mailchimp/guides/error-glossary/",“title”:"Invalid Resource”,“status”:400,“detail”:“The resource submitted could not be validated. For field-specific details, see the ‘errors’ array.”,“instance”:“xxxxxxxxxxxxxx”,“errors”:[{“field”:“url”,“message”:“Webhooks are no good without a valid URL. Please enter one.”}]}

are you running n8n locally? if so, you have to use a tunnel so Mailchimp can communicate with the local n8n instance. Check the links below.

thanks a lot @RicardoE105 for your answer
I think it runs on a docker installation (did not install it myself). I will ask if it can be changed to tunnel

I will check that on a local installation on a Raspberry Pi also

Have a great day
damien

Be aware that the tunnel is only meant for development and testing, not for production usage.

thansk @jan
So that means it can’t work alone : i mean i can’t have mailchimp connexion all day long ?

Or i can make the conection work in testing and devlopping and when it’s done, i can put it on production and it will work ?

It will work but we do not give any guarantee about data security and that the service is always up.

Hey Jan,
I hope you are fine.

As far i can understand everything i read on tunnel, if i do not run n8n in --tunnel mode, i will not be able to use webhooks (as mailchimp trigger for instance)

Am i wrong ?

Yes that is correct. Unless you are running n8n on a server with it own domain (the way n8n is meant to run in production).

1 Like

Thanks @jan !