Hi,
we have the starter account to test workflows with n8n.
We want to automate our shipping process. So we need to get the data about DHL API access. I have tried to enter the credentials but an error message came up. Is it possible that this function only works with the enterprise version?
Or is there any chance to load the DHL data into n8n?
According to the DHL API Documentation it looks like you would need to use a âclient credentialsâ style generic Oauth2 credential to set n8n up to fetch an access token for you. I donât have a DHL account, so Iâm partially guessing here, but nothing looks unusual, so thereâs a good chance this will work. Once you have the Credential
item created, use it in an HTTP Request
node on one of the DHL API endpoints.
- Note: Thereâs an alternative authentication endpoint â
https://api.dhlecs.com/auth/v4/accesstoken
that you might need to use instead of the one linked above (and shown in the screenshot below). DHL seems to have different API systems depending on the client/account/task/???.
Create an Oauth2 API
credential type.
Fill in values like this:
Thank you very much!
Client ID is the API KEy?
And Client Secret the API Secret KEy?
And the Access Token Url is the URL in your screenshot?
Try and see. It helps when the documentation matches up on what everything is called, but sometimes it doesnât. Again, I donât have a DHL account so I donât have a way to verify what should/shouldnât work.
Just curious (because of the difference in parameter names)âŚ
Did you register a DHL developer account?
And create an app?
Just curious (because of the difference in parameter names)âŚ
Did you register a DHL developer account?
And create an app?
yes both
According to this article on setting up API authentication on Postman, it should work to use the n8n Basic Auth
credential type and fill in your API Key
and API Secret
(from the App details in the DHL API Developer Portal) for User
and Password
respectively.
I set up a developer account to play around with this (just curiosity to see if I could find a way to make it work).
So far nothing has worked though (various 401 errors).
I also hit a few other issues that you might encounter, so maybe some of this will helpâŚ
- It is EXTREMELY UNCLEAR which DHL APIs must be enabled on the account/app (their documentation is awful). Even if you get the authentication working, you have that puzzle waiting for you.
- I could find no place in the API Developer Portal or docs where âClient ID, and Client Secretâ are mentioned, so Iâm not entirely sure where/how they support Oauth2. The existence of the âget tokenâ endpoints would suggest they do support it, but theyâre certainly not making it easy to figure out.
- The response Content-type header on a 401 response from their token endpoints is
application/problem+json
, which n8n doesnât understand, and masks the actual problem with a different error message:Unsupported content type: application/problem+json
(I ran the request through mitmproxy to see what was happening, and it was actually a401 - Unauthorized
response. The only additional info said something about it being an âInvalid Clientâ (which sounded like a client software type restriction, but adding a âfakeâUser-Agent
header didnât help).- BTW, if you want to set up mitmproxy (which is a free alternative to something like CharlesProxy) to snoop requests from n8n (self hosted n8n), hereâs a link to instructions for that.