https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292016-08-11T06:39:02ZRedmineRedmine - Feature #23566: REST API should return attachment's id in addition to tokenhttps://www.redmine.org/issues/23566?journal_id=726432016-08-11T06:39:02ZJan from Planio www.plan.io
<ul></ul><p>The first part (before the <code>.</code>) of the token <em>is</em> in fact the ID.</p> Redmine - Feature #23566: REST API should return attachment's id in addition to tokenhttps://www.redmine.org/issues/23566?journal_id=726532016-08-11T15:42:28ZAlex Last
<ul></ul><p>Than you, Jan! this is useful to know. it is hard to predict though if that is something that we could rely on going forward. it may be just some internal implementation detail rather than documented API.<br />if I parse id from the token, this may break for the next redmine version - non-starter for the Java library because I can't support separate versions for each Redmine version.</p> Redmine - Feature #23566: REST API should return attachment's id in addition to tokenhttps://www.redmine.org/issues/23566?journal_id=726812016-08-15T09:56:58ZJan from Planio www.plan.io
<ul><li><strong>File</strong> <a href="/attachments/16523">0001-return-attachment-id-in-api-response-to-attachment-u.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/16523/0001-return-attachment-id-in-api-response-to-attachment-u.patch">0001-return-attachment-id-in-api-response-to-attachment-u.patch</a> added</li><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Target version</strong> set to <i>Candidate for next minor release</i></li></ul><p>Alex Last wrote:</p>
<blockquote>
<p>Than you, Jan! this is useful to know. it is hard to predict though if that is something that we could rely on going forward. it may be just some internal implementation detail rather than documented API.<br />if I parse id from the token, this may break for the next redmine version - non-starter for the Java library because I can't support separate versions for each Redmine version.</p>
</blockquote>
<p>I agree. Luckily, it's not hard to return the ID as well, so the attached patch implements this. We've added this to the <a href="https://plan.io/api/#uploading-a-file" class="external">Redmine API at Planio</a> straight away and hopefully this patch can be included in Redmine as well in a next minor release.</p> Redmine - Feature #23566: REST API should return attachment's id in addition to tokenhttps://www.redmine.org/issues/23566?journal_id=727082016-08-18T08:20:21ZGo MAEDA
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>New</i></li><li><strong>Target version</strong> changed from <i>Candidate for next minor release</i> to <i>3.4.0</i></li></ul><p>Thanks for submitting the patch, Jan.<br />I think this should be implemented in Redmine core. I am setting target version to 3.4.0.</p> Redmine - Feature #23566: REST API should return attachment's id in addition to tokenhttps://www.redmine.org/issues/23566?journal_id=731062016-08-30T21:15:58ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Subject</strong> changed from <i>"upload attachment" should return attachment's database id in addition to token because "delete" operation operates on id only</i> to <i>REST API should return attachment's id in addition to token</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Patch committed, thanks.</p>