Home > Software design >  Not able to download attachment from Azure Devops rest API using Postman
Not able to download attachment from Azure Devops rest API using Postman

Time:09-24

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

CodePudding user response:

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

  • Related