Downloading files via API – how to use downloadUrl?

Hello,

we are working on an integration between AtroPIM and an external business system.

The external system queries the API to obtain the download URL of files linked to products. In the File endpoint we see the downloadUrl attribute. However, when the system tries to call the URL returned in that attribute, AtroPIM requires authentication and the file cannot be downloaded.

Could you please clarify:

  • Which endpoint and attribute should we use to allow an external system to download files via API?
  • Is it possible to perform the download using the same authentication mechanism already used for other API calls (token), without requiring a session login?

Thank you in advance for your support.

Hello,
Sorry for the late response.
To be able to download a file without the need of authentication, you need to create a Sharing entity first using : POST: /v1/Sharing with payload { "fileId": {{fileId}}, "active": true, "validTill":{{validityDate (can be null)}} }, in the response you will have a “link” key with the url for downlaoding without authentication. for more information about this route you can check your api documentation at /apidocs/?atroq=apidocs#/Sharing/createSharingItem