Programmatically download issue attachments

Answered

Hi there, 
Is it possible to download issue attachments programmatically?

I tried it from .Net using youtracksharp and injecting the AuthenticationCookie from the connection to an HttpWebRequest, as explained here: http://www.gerbenvanadrichem.com/quality-assurance/how-to-autmatically-download-attachments-from-youtrack/ 

But the response is not the file itself but an html code from "Loading youtrack..." page:

<!doctype html>
<!--[if lte IE 9]>
<html class="no-js">
<![endif]-->
<!--[if gt IE 9]><!-->
<html class="no-js" ng-app="YouTrackLogin" ng-strict-di>
<!--<![endif]-->

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<base href="/">

</head>

<body>
<div yt-loader="screen" message="Loading YouTrack..."></div>

<script src="static/vendor.cb8ae53e7624fa8ba525.js"></script>
<script src="static/unsupported.cb8ae53e7624fa8ba525.js"></script>
<script src="static/oauth.cb8ae53e7624fa8ba525.js"></script>
</body>

</html>

Shouldn't it be part of the REST API?

Thanks!

Ton.

3 comments
Comment actions Permalink

I forgot to say that ghest user must be forbidden in our youtrack setup.

0
Comment actions Permalink

Hi, I'm sorry for the delay. Please use the permanent tokens for authentication: https://www.jetbrains.com/help/youtrack/incloud/2017.2/Manage-Permanent-Token.html

1
Comment actions Permalink

Thanks, it works perfectly now!

Ton.

0

Please sign in to leave a comment.