Cannot connect with Magento 2 Node

I cannot connect to Magento2 with the Magento2 Node.

I use the URL

https://www.shop.de/rest/de/V1/module

I tested every version of the 4 extensions of segments like

rest, de, V1, products

and also all other versions I could find here

Magento Connection Problem - #26 by Brett without ana luck. I also read this: https://developer.adobe.com/commerce/webapi/get-started/authentication/gs-authentication-token/#integration-tokens

and turned of this:

However, while it is not recommended, this behavior can be restored in the Admin by setting the Stores > Configuration > Services > OAuth > Consumer Settings > Allow OAuth Access Tokens to be used as standalone Bearer tokens option to Yes.

Whatever I do I am not getting a connection.

I dont have any problem with the HTTP Access with a Barrier Token.

  • n8n version: 1.291
  • Running n8n via: local
  • Operating system:Ubuntu

Is it possible to integrate Barrier API acces?

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

These was a fix needed for the Magento module.
I’m not sure that ever happened.

I have since moved off Magento and n8n.

@Jon may be able to offer an update.

@Jon
After reading the Server Logs its clear, the module is cutting everything after the domain and ads:

Test Button in the Node:

/rest/de/V1/products/rest/default/V1/modules

In the Node hwere you can type in the SKU for Get Product:

/rest/de/V1/products//rest/default/V1/products/$VarSKU

So this module will only work for shops which have a default view or only one view (?). I am not an expert for Magento Settings but at least for shops with 2 view like DE and EN is will not work because you are not able to choose the view.

To make it work, I moved to

CD /usr/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Magento

And there you find

Magento2.node.js 

in this file you find alot of lines which contain

/default/ 

also one that has no // section for view which would probably not connect at all (?).

So I simply changed every line like

responseData = await GenericFunctions_1.magentoApiRequest.call(this, 'POST', '/rest/**default**/V1/products', body);

to

responseData = await GenericFunctions_1.magentoApiRequest.call(this, 'POST', '/rest/**de**/V1/products', body);

Of cause with the next update this is gone.

It really needs another field where we can enter the shop view, Or maybe more simple the module should not enter the first path like

/rest/de/V1/

So we can simply do that by our own. But it would really need explanation in the docs.
But that would break existing installations.

So it would be need a new “view” field and if it’s empty it uses “default”

1 Like

Ah yeah I never got round to fixing this one, I will make a ticket now for it.

Edit: Internal dev ticket is NODE-1221

Maybe you should simply use the default, but as soon somebody extends the www.url.de with an extension like /rest/V1/de/api/blah it should use this path?

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