How to integrate external CRM API with HTTP Post?

Hello everyone, how are you?

I’m new around here and just started my learning with N8N.

I would really appreciate it if you could help me with an integration I’m trying to do with Mautic and a customer’s CRM.

I already connected Mautic to the N8N. Now, I need to integrate each lead captured in Mautic forms into this CRM, whose API documentation has the following instructions:

"The APIs use REST (Representational State Transfer) technology, based on the HTTP protocol.

The requests must be made through the HTTP POST method and to send the content use the JSON notation

This method imports Leads generated through external platforms. The following examples have the basic Lead parameters.


Request Format:

application/json, text/json
“Name”:“Customer Name Here”,
Email":"[email protected]”,
“Phone”:“(00) 00000-0000”,
“Message”:“customer message here”,
“Enterprise”: true,
“Reference”: “987654”

Response Format:

application/json, text/json
“Id”: 1,
“Success”: true,
“Errors”: [
“sample string 4”

The question I ask is: what is the step by step to create this node in the N8N through an HTTP connection?

Thank you very much and I will look forward to it.

Hi @Edney, welcome to the community! n8n offers the HTTP request node which will be the right node for you. Just choose post as a method there and send the data needed by adding it as body content. Happy to help if you’re getting stuck there somehow.

Hello Niklas, how are you?

Thank you very much for the welcome and for your return to my question.

I found the HTTP request node on n8n, but I have no idea how to input data into it…

There are the authentication steps and the data integration itself. This is all very confusing to me. Honestly, I’m lost!

For example, regarding authentication, the CRM documentation says:

“To consume any Sigavi API, it is necessary to use an authentication API. For authentication, our API will request the parameters below:
username: Enter the system to obtain the username and password
password: Enter the system to obtain the username and password
grant_type: password
Field Layout: Click here
A token will be returned through the “access_token” parameter, valid for 24 hours.
The type of token used is bearer, so in the request of all other methods, pass a parameter called Authorization in the header and the content must be “bearer + “ “ + access_token””

In the HTTP request node there is the authentication option Generic Credential Type and, in sequence, Generic Auth Type. In none of the available options did I find enough fields to put the parameters above… I’ve stopped there!

To continue the rest and make the equivalence of fields, I will certainly have the same problem.

Any tips for me?

Once again, thank you for your patience and attention.

Best Regards,

Hi @Edney. Do you have a link to the repective documentation? In n8n we offer a number of ways to authenticate in the HTTP node, but based on your message above, I don’t know what the right one for your need is.
Based on your message above, it sounds like the following:

  1. Create a HTTP request with post to to receive the authentication token. In her use the Generic Credential Type in the Authentication dropdown, together with Basic Auth in Generic Auth type. In there you can then enter your username + password
  2. Now use the authentication token in a next http request node to request the real endpoint (e.g. ). In here choose Header Auth in the Generic Auth Type dropdown. In there enter authentication as name and bearer <token> as value.

Here’s an example in which you of course have to add the right parameters (as I can’t test your CRM without credentials). You might need to play around with it a little.

Hope that helps.

Hi Niklas!

Thank you very much!

I followed your instructions for the first authentication node and this error message popped up:

ERROR: Bad request - please check your parameters

HTTP Code: 400

Data below may contain sensitive information. Proceed with caution when sharing.

“message”:“400 - “{"error":"unsupported_grant_type"}””,
“stack”:“Error: 400 - “{"error":"unsupported_grant_type"}” at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15) at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12) at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11) at IncomingMessage.emit (node:events:525:35) at IncomingMessage.emit (node:domain:489:12) at endReadableNT (node:internal/streams/readable:1358:12) at processTicksAndRejections (node:internal/process/task_queues:83:21)”


NodeApiError: Bad request - please check your parameters
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/HttpRequest/V3/HttpRequestV3.node.js:1167:27)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:658:28)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:585:53

Anyway, follow the link to the documentation: Bem vindo ao Sigavi 360 - Sigavi 360

Best Regards,

Ahh the link helps a lot. You need to change the first HTTP node to run like shown below:

You just need to exchange the username and the password. As you can see, you can pretty much blindly follow the screenshot examples. Hope this works :slight_smile:

Hi Niklas!

I followed your instructions, and after a few tries and tests, I was able to authenticate! However, I used the Form Urlencoded in the Body Content Type to introduce the access parameters, in addition to including the Send Headers parameters in the same node, as you can see in the print below (thanks a lot for your great help!):

Now, I just need to know how to capture the data from Mautic (first node), do the equivalence and send them to the CRM (third node).

When I run the third node to send the data to the CRM, I can’t access the data from the first one (Mautic), only the second one (authentication).

Is there any way for the second node (authentication) to capture data from the first (Mautic) and forward it directly to the CRM, without the need for a third node? Or is there a way to capture the parameters between nodes of different connections?

Once again, thank you for your help!

Best Regards,

You can reference any node when trying to use data. In your case, just toggle the input to Expression and enter {{ $node["Mautic Trigger"].json["propertyYouWantToAccess"] }} in there. You can also easily browse through the data you can use by opening the expression modal (as seen in screenshots below)

Thanks a lot, Niklas, everything worked!!

Now I’m going to try to get by with the other end, which is the CRM.

Best Regards,

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.