Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

TFS API: Downloading an item using API calls

$
0
0

Hey all,

I am trying to streamline workflow between developers, QA testers, and customer updates using a set of tools I've been developing this week for our internal company. The QA tool needs the ability to download files from TFS into a certain directory, so the testers can get newer versions of files that need to be tested.

This is what I have so far: I have the TFS API returning to me a list of URLs for each file I need to download. If I past this URL into my browser (assuming I'm logged in), the file will download. I need to do this programmatically for a List<string> of URLs AND into a certain directory. Is this possible? I am using this endpoint (an example):

https://{instance}/DefaultCollection/_apis/tfvc/items/$/{path}?versionType=Changeset&version={version}

The response I receive from the API call seems to return information about the item, but how do I get the actual file? I get an object back in the JSON response that I assume is what I need. This is what my response looks like: 

For security purposes, I removed the filename and extension from the object below.

"contentMetadata": {"encoding": -1,"contentType": "application/octet-stream","fileName": "[FILENAME]","extension": "[EXTENSION]","isBinary": true,"vsLink": "vsweb://vs/?[A LONG LINK]"
	}

Any help, links to what I can read, or guidance would be appreciated. I've been Googling half the day, but I'm new to this and I'm sure I am looking in the wrong directions.

Thanks.


Viewing all articles
Browse latest Browse all 4410

Latest Images

Trending Articles



Latest Images