Reputation: 375
In the VSTS API there's information on how to make GET requests, but I can't find anywhere in the release API information on the artifact that was attached. I'm using Postman to submit requests, but there is no data returned on artifacts anywhere in the response. How do I find it?
Can't show full logs of the request, but the GET URI is https://xxxx.vsrm.visualstudio.com/xxxx/xxxx/_apis/Release/releases?api-version=4.0-preview.4&definitionId=76 and this returns a lot of information, but none on the artifact. Running a similar call but with /build/builds/artifacts returns information on the artifacts, but I can't access the information through the release API for some reason.
Edit: I found information on the artifact by adding the release ID to the URL.
Upvotes: 0
Views: 1258
Reputation: 38106
To get artifacts by GET a release REST API, you can follow below steps:
Use the request
GET https://account.vsrm.visualstudio.com/project/_apis/Release/releases/{releaseID}
Authorization with basic Auth
You can use PAT or Alternate credential for the basic auth.
Send request and get the artifact url through output
Make sure the return status is 200 OK
. Select Body -> Pretty -> JSON for the output. Search artifactSourceVersionUrl
in the output, the value for id
is the url to get the artifacts. such as the url is https://account.visualstudio.com/_permalink/_build/index?collectionId=fc52d179-f3fd-460b-adb1-5ac84bd0e765&projectId=f7855e29-6f8d-429d-8c9b-41fd4d7e70a4&buildId=1402
as below example.
Open the URL and get the artifacts
The URL is the related build page, in the Artifacts Tab, you can download or explore the artifacts.
Upvotes: 1
Reputation: 497
Did you try looking at the Get Build Artifacts section of the API? This will provide the name of the artifact as well as the download URL for that artifact as well:
GET https://{instance}/DefaultCollection/{project}/_apis/build/builds/{buildId}/artifacts
Is there specific information that you are looking for that is not returned in this call?
Upvotes: 0