Download (Get) Artifacts using the REST API or Web Client

I have a question related to downloading (Get) artifacts using the reset API or the Web client?

Looking at the REST API, I don’t see a way to request the artifacts given the deployment id.
I don’t see any API in the Web client for artifacts at all.

It looks like all it can do is get a global list of artifacts id which some how you can iterate and the use the GET to download?

When I navigate using the Web console to the location here the artifacts appear I see a URL like
http://my-url/app#/projects/projects-[digits]/releases/[release-id]/deployments/deployments-[digits]
where digits are numbers and release-id is a release number (d.d.d.).

When I point at an artifact on this page I see a URL like: my-host/api/artifacts/[digits]/content
where [digits] is a set of digits (like 44 or 43)

I am confused about how to setup the REST request in terms of the data.
I know the following in the context of the request to download the artifact(s):

  1. project name
  2. environment name
  3. release id
  4. deployment id.

Still I don’t understand how to use the information to GET an artifact.

Hi,

Thanks for getting in touch!

To get the artifacts for a deployment you can hit the following API endpoint /api/artifacts?regarding={deploymentid}.

Then for each artifact returned, you call /api/artifacts/{artifactid}/content.

Hope that helps!

Thank you and kind regards,
Henrik

Thanks Henrik,
Your suggestion worked.
Please find attached a link to a GitHub gist. [https://gist.github.com/rirl/412dd80a5fd85a942139]

The gist will download all the artifacts (if any) associated with a deployment-id in the artifacts directory of the currrent directory.

Hi,

Good to hear that I could point you in the right direction to find a solution for your query, and thanks for the Gist, will be sure to use it again if anyone else needs it!

Thank you and warm regards,
Henrik