Harsh
Harsh

Reputation: 169

Not able to download attachment from Azure Devops rest API using Postman

I am using Postman to hit azure devops Rest API for downloading the attachments.(fig) Even after filling proper header, params it is showing { "count": 1, "value": { "Message": "The request is invalid." } }.

I am tried all most all the technique mention on stack overflow but none of them is working. My goal is to download attachment from devops workitem.

enter image description here

Upvotes: 0

Views: 1055

Answers (1)

Joy Wang
Joy Wang

Reputation: 42153

I suppose you used the Work Item ID in the request URL, it is not correct, it should be the Attachment ID.

To get the Attachment ID, you need to use the REST API to get it first.

GET https://dev.azure.com/orgname/proname/_apis/wit/workitems/<Work Item ID>?$expand=all&api-version=6.0

enter image description here

Copy the Attachment ID above, then use it in the API below, it works for me.

enter image description here

Upvotes: 2

Related Questions