Magento Connection Problem

I’m trying to use the magento module, but am struggling…

I get a bad request error (using an access token and my bare store URL).
I have changed the access token and get the same error, so I’m thinking I have my host name wrong. but I’ve tried all the possible alternatives I can think of.

I have success in Postman using endpoints starting with https://www.XXXXXXXXX/rest/V1/ and using Bearer authorization.

I am running magento version 2.2.7 community edition.

Can anyone help me out of my predicament please?

Hey @Brett,

Welcome to the community :cake:

Have you tried removing the / from the end of the URL?

Hey @Jon - thanks for the super quick reply.

https://www.XXXXXX = ‘Bad request - please check your parameters’
https://www.XXXXXX/ = ‘Bad request - please check your parameters’
https://www.XXXXXX/V1 = ‘The resource you are requesting could not be found’
https://www.XXXXXX/V1/ = ‘The resource you are requesting could not be found’

Interestingly, I get the same errors with or without the ACCESS TOKEN field being blank or populated with any random string or the correct access token from Magento below).

Hey @Brett,

That is odd, When I tested the Magento node a couple of months back it was working well, For that I used the domain without the / at the end.

Out of interest what webhost are you using is it IONOS?

Hi @Jon,

Our magento server is hosted on AWS via MGT-Commerce.

We have quite a few Intergrations connected to our magento instance - Integromat, Skyvia (and previously AfterShip and Parabola). But they all connect in a variety of ways, so this may not be useful.

Hey @Brett,

Do you do any blocking based on user-agent strings maybe? As another test have you tried using the HTTP Request node to see if that can connect?

I can successfully use the HTTP request module using bearer authorization (see below).

I’d prefer to not have to hand-craft the API calls (and use the functions built into your Magento node) but if I have to, I have to.

But I’m a very lazy no-coder… haha

PS : Thanks for all the help.

Alright HTTP Request node working is interesting, The credential test calls /rest/default/V1/modules does that same endpoint work ok?

https://www.XXXXX/rest/default/V1/modules fails.
https://www.XXXXX/rest/V1/modules works.

Looking at online resources, the DEFAULT value is the store code…
(https://developer.adobe.com/commerce/webapi/get-started/gs-web-api-request/)

This is disabled in my store, as I am not using a multilanguage store - I’m not sure what other use cases might be, but in all the years I’ve been using Magento we’ve not needed this…
(How to Add Store Codes to the URLs in Magento 2? - Magefan)

My store’s settings look like this…

Apologies if this is an edge case. :frowning:

Interestingly, https://XXXXX/rest//V1/modules works (double slashes with missing store code …rest//V1…)

So perhaps if you included a store code field in your connection properties, that users could populate or leave blank, that may be a fix?

2 Likes

Hey @Brett,

That is some nice work and will save a bit of time, I guess what we need here is an advanced option for “Use store code” which can default to enabled so we don’t break anything and can be disabled if needed.

I will add it to our feature request list for a future release, If I get a chance I may even add it over the weekend.

2 Likes

Many thanks @Jon,

I’m using n8n.cloud so am assuming I’ll need to wait a bit before I get access to any changes you make.

But that’s okay. :slight_smile:

1 Like

Hey @Brett,

Yeah you got it, Cloud can take an extra week to get the new version but I will let you know when we have a fix in place anyway so you know to keep an eye out for a new cloud version.

2 Likes

Hi @Jon,

I still have the same issue, is this fixed?

Thanks,
Kiran

I’m not aware of this having been fixed yet.
I am still using the HTTP node.
If it was fixed, it would be great.

Not yet, I was going to add it in but never got a chance to. I will see if I can fit it in this month so that we can get this one resolved.

1 Like

A gentle nudge…

1 Like

This one is still on my list, It had to be pushed down a bit as there were issues that were a bit more urgent to resolve. It is looking like this will likely be sorted this month unless anything anything unexpected comes up.

Guess I found the problem: Authentication via Access Token is deprecated and disabled by default: https://developer.adobe.com/commerce/webapi/get-started/authentication/gs-authentication-token/#integration-tokens
Instead OAuth is the preferred/supported auth method which should get implemented instead.

1 Like

I suspect that is a second issue.

The first, is that around store codes.