Connection to Akeneo REST API
Good afternoon everyone
I gotta configure a connection to Akeneo PIM and I cant make heads or tails of how am I supposed to configure this connection.
1- Based on their documentation, I got to generate a token by submitting username and password in a JSON request body AND an authorization header with my client and secret in base64.
2- This token must then be included in following requests as an authorization header UNTIL it expires.
I must then submit a new token request. This time, using the refresh token I got in Step 1. This will return a new token that replaces the one I was using until then in step 2
Anyone has an idea ?
Here's Akeneo documentation for the record : https://api.akeneo.com/documentation/authentication.html#
Comments
Thanks Philippe Foisy for providing your time and giving us a walk through of the challenges faced.
Search URL parameter will be added to the required endpoints soon.
Philippe Foisy you would use OAuth 2 and override the body to get an access token. After that, the refresh mechanism is all handled in the connection since it's standard OAuth 2 implementation.
JSON so you can copy:
Tyler Lamparter you are a life saver ! Thank you so much for this very precise walkthrough of the configuration !
Hi Tyler Lamparter
Thank you for the detailed walkthrough; it's greatly appreciated. I attempted to follow your steps and encountered two issues:
It appears that
akeneo.cloud
is not recognized as a valid domain name. However, I had success usingakeneo.com
andapi.akeneo.com
.After completing all the required fields, I received an error during the connection process: "Expected field: AuthURI to be present."
Would appreciate any insights you can offer to resolve these issues. Thank you!
As an addition, you can also create a connection without using an iClient by utilizing a token instead. Here are some screenshots for reference:
Important: Make sure to populate the HTTP header with the
Authorization
field. In the placeholder marked as "removed====", insert your Base64-encodedClientID
andSecret
.In Postman, you can generate this code using the following pre-request script:
Hope this helps :)
Nuri Ensing the authURI should only be required when your OAuth2 iClient is configured for "Authorization code" grant type and not "Client credential" grant type. If it's throwing that error and you have it configured to client credentials, then I'd be curious to know how to reproduce what you did. When you made it, did you change the setup of an existing connection or did you start a new connection from scratch for the Oauth2 configuration?
As for the other method of making this work, you absolutely can use the refresh token method, but since this endpoint is oauth, going the oauth route will present fields that are relevant to the standard. Also, on your refresh method, you don't have to pre generate your base64 encoded string in Postman and we would highly recommend you don't store sensitive credentials in non encrypted fields. Here is how your refresh token method should look like with encrypted fields.
Encrypted fields, but populate with real values:
Unencrypted fields to know the structure placed in encrypted fields if you ever have to come back and update.
Philippe Foisy and fellow Celigo + Akeneo customers,
We added the prebuilt Akeneo connector in the September 2023 release. Hopefully, it streamlines your flow development, and we welcome any feedback you might have.
Hey Stephen !
Thanks for this announcement ! I'm going to take a look at it ASAP
Regards
Hey Stephen Brandt
I've tried the Akeneo connector extensively. Sadly it does not cover all the uses cases I have in its current version. Here's a couple of comments :
All in all, I'm using Akeneo's API extensively so if you guys wanna chat about the challenges I'm facing. It'll be my pleasure
Thanks for helping us improve, Philippe. Our Product team is looking forward to this chat, and we'll try to keep this space posted with updates.
Please sign in to leave a comment.