1

Right now, i am trying to use the DHL Shipment Label API Shipment Label API Docs

But i cannot seem to find on the Auth request, what is the client_id and the client_secret The only thing i have from my registered app is the API_KEY and the API_SECRET and that gives me a 401 error code

Any help is amazing!

VLAZ
  • 26,331
  • 9
  • 49
  • 67
filipe
  • 139
  • 2
  • 17
  • DHL has very bad API documentation and very bad support. But the people from "netresearch" are very good at their job and provide very well written projects for interacting with DHL interfaces. I am sure their repositories contain useful information to you: https://github.com/netresearch?q=dhl&type=all&language=&sort= – Daniel W. Feb 23 '22 at 14:00
  • I think I even went into the same problem few years ago. You need to check if the connected client_id is from a business or private account, and if it has the right permission for the right API. Try this login: https://www.dhl.de/de/geschaeftskunden/paket/versandsoftware/entwicklerportal.html – Daniel W. Feb 23 '22 at 14:06
  • wow, glad i am not the only one in this situation. I already tried the login on the private customers tab, and i cannot log in ahaha. Will try to use the github you provided – filipe Feb 23 '22 at 14:29
  • Try the business account login. I think the API isn't even available to private customers. – Daniel W. Feb 23 '22 at 14:30
  • i cannot seem to find that, i can only login with private account... – filipe Feb 23 '22 at 14:33

1 Answers1

0

i had also to fight with the documentation ;-)

That's how my CURL HEADER option looks like:

CURLOPT_HTTPHEADER => ["Accept: application/json",
            "Accept-Language: de-DE",
            "Authorization: Basic ".base64_encode($api_username.':'.$api_password),
            "content-type: application/json",
            "dhl-api-key: ".$api_key ]

I concatenate username and password with a colon and make a base64 encode. And I pass the api key through the parameter dhl-api.key